/**
 * Fares Jebril Portfolio - CSS
 **/

/* =========================================
           1. CSS Variables & Reset
========================================= */
:root {
  --bg-color: #f0f2f5;
  --card-bg: rgba(255, 255, 255, 0.8);
  --modal-overlay: rgba(0, 0, 0, 0.5);
  --text-main: #1a1a1a;
  --text-secondary: #555;
  --accent-color: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --border-color: rgba(0, 0, 0, 0.1);
  --gradient-text: linear-gradient(45deg, #6c63ff, #ff6584);
  --cursor-color: #6c63ff;
  --blob-color: rgba(108, 99, 255, 0.1);
  --timeline-line: rgba(108, 99, 255, 0.2);
}

[data-theme="dark"] {
  --bg-color: #050505;
  --card-bg: rgba(20, 20, 20, 0.7);
  --modal-overlay: rgba(0, 0, 0, 0.85);
  --text-main: #ffffff;
  --text-secondary: #b0b0b0;
  --accent-color: #00ff41;
  --accent-glow: rgba(0, 255, 65, 0.2);
  --border-color: rgba(0, 255, 65, 0.1);
  --gradient-text: linear-gradient(45deg, #00ff41, #008f11);
  --cursor-color: #00ff41;
  --blob-color: rgba(0, 255, 65, 0.05);
  --timeline-line: rgba(0, 255, 65, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: none;
}
body.modal-open {
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 5px;
}

/* =========================================
           2. Custom Cursor
========================================= */
.cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition:
    width 0.2s,
    height 0.2s,
    background-color 0.2s,
    border-color 0.2s;
  mix-blend-mode: difference;
  top: 0;
  left: 0;
  opacity: 0;
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background-color: var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  top: 0;
  left: 0;
  opacity: 0;
}

body.mouse-moved .cursor,
body.mouse-moved .cursor-dot {
  opacity: 1;
}

body.hovered .cursor {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: transparent;
}

/* =========================================
           3. Background Animations (Blobs)
========================================= */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(80px);
  border-radius: 50%;
  opacity: 0.6;
  animation: floatBlob 20s infinite alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: var(--blob-color);
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: var(--accent-glow);
  animation-delay: -5s;
}

@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 50px) scale(1.1);
  }
}

/* =========================================
           4. Navbar
========================================= */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main);
  text-decoration: none;
  position: relative;
}

.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: transparent;
  border: 2px solid var(--text-main);
  color: var(--text-main);
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle:hover {
  background: var(--text-main);
  color: var(--bg-color);
}

/* =========================================
           5. Hero Section
========================================= */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10%;
  position: relative;
}

.hero-content {
  max-width: 600px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 900;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 450px;
}

.btn {
  display: inline-block;
  padding: 12px 35px;
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: 0 10px 20px var(--accent-glow);
  transform: translateY(0);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--text-main);
  margin-right: 15px;
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--accent-color);
  color: white;
}

.hero-visual {
  position: relative;
  width: 400px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-shape {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--accent-color), #20bf55);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morph 8s ease-in-out infinite;
  position: absolute;
  z-index: 1;
  opacity: 0.8;
}

.hero-img {
  width: 90%;
  height: auto;
  position: relative;
  z-index: 2;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.8);
}

@keyframes morph {
  0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
  }
  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
}

/* =========================================
           6. Sections General
========================================= */
section {
  padding: 100px 10%;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.section-title::before {
  content: attr(data-heading);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  color: var(--text-main);
  opacity: 0.05;
  white-space: nowrap;
  z-index: -1;
}

/* =========================================
           7. Services / Skills (Cards)
========================================= */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  transition:
    transform 0.4s,
    box-shadow 0.4s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.card-icon {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* =========================================
           7.5 Timeline (Resume) Section - LTR Adjusted
========================================= */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background: var(--timeline-line);
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 0 15px var(--accent-glow);
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
  perspective: 1000px;
}

.timeline-item.left {
  left: 0;
}

.timeline-item.right {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--bg-color);
  border: 4px solid var(--accent-color);
  border-radius: 50%;
  top: 25px;
  z-index: 10;
  box-shadow: 0 0 15px var(--accent-color);
  transition: transform 0.3s;
}

.timeline-item.left .timeline-dot {
  right: -12px;
}

.timeline-item.right .timeline-dot {
  left: -12px;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  background: var(--accent-color);
}

.timeline-content {
  padding: 30px;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: relative;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  text-align: left;
}

.timeline-content:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-color);
}

.timeline-date {
  display: inline-block;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.timeline-content h3 {
  font-size: 1.4rem;
  margin-bottom: 5px;
  color: var(--text-main);
}

.timeline-content h4 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-weight: 600;
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.timeline-content::after {
  content: "";
  position: absolute;
  border-style: solid;
  top: 25px;
  width: 0;
  height: 0;
  display: block;
}

.timeline-item.left .timeline-content::after {
  right: -10px;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--border-color);
}

.timeline-item.right .timeline-content::after {
  left: -10px;
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--border-color) transparent transparent;
}

/* =========================================
           8. Projects (Gallery)
========================================= */
.project-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
  group: project;
}

.project-img {
  width: 100%;
  height: 200px;
  background-color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.project-img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover .project-img::after {
  opacity: 1;
}

.project-info {
  padding: 25px;
}

.project-tags {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  border-radius: 10px;
  font-weight: 700;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.project-link:hover {
  color: var(--accent-color);
}

.project-link i {
  transition: transform 0.3s;
}

.project-link:hover i {
  transform: translateX(5px);
}

/* =========================================
           9. Contact
========================================= */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
  background: var(--card-bg);
  padding: 50px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.contact-info h3 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.contact-item i {
  color: var(--accent-color);
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: "Poppins", sans-serif;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* =========================================
           10. Footer
========================================= */
footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* =========================================
           11. Animations Classes
========================================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.slide-in-right.visible,
.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================
           12. Responsive
========================================= */
@media (max-width: 991px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    justify-content: center;
    gap: 50px;
    padding-top: 100px;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .hero-content {
    margin: 0 auto;
  }

  .contact-container {
    grid-template-columns: 1fr;
  }

  .timeline::after {
    left: 31px;
    right: auto;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item.right {
    left: 0%;
  }

  .timeline-item.left .timeline-dot,
  .timeline-item.right .timeline-dot {
    left: 22px;
    right: auto;
  }

  .timeline-item.left .timeline-content::after,
  .timeline-item.right .timeline-content::after {
    left: -10px;
    right: auto;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--border-color) transparent transparent;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .cursor,
  .cursor-dot {
    display: none;
  }

  body {
    cursor: auto;
  }
}

/* =========================================
            5. Modal
 ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 850px;
  border-radius: 25px;
  border: 1px solid var(--accent-color);
  padding: 40px 30px 30px;
  position: relative;
  transform: translateY(50px);
  transition: transform 0.4s;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.8rem;
  cursor: pointer;
  transition: 0.3s;
}
.modal-close:hover {
  color: #ff6584;
  transform: rotate(90deg);
}

.modal-tags {
  margin-bottom: 10px;
}
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  border: 1px solid var(--border-color);
}
.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: 0.6s ease-out;
}
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: 0.8s ease-out;
}
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: 0.8s ease-out;
}
.visible {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

@media (max-width: 991px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 120px;
  }
  .nav-links {
    display: none;
  }
}
