/* Custom Styles */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Outfit:wght@300;500;700&display=swap");

:root {
  /* Light Mode Palette */
  --primary-color: #2563eb; /* Royal Blue */
  --secondary-color: #64748b; /* Slate */
  --accent-color: #0ea5e9; /* Sky Blue */

  --body-bg: #f8fafc; /* Very light slate/white */
  --body-text: #1e293b; /* Slate 800 */

  --section-bg: #ffffff;
  --section-bg-alt: #f1f5f9; /* Slate 100 */

  --card-bg: #ffffff;
  --card-text: #1e293b;
  --card-border: rgba(148, 163, 184, 0.2);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);

  --navbar-bg: rgba(255, 255, 255, 0.8);
  --navbar-backdrop: blur(12px);
  --navbar-text: #334155;
  --navbar-brand: #0f172a;
  --navbar-active: #2563eb;

  --footer-bg: #0f172a; /* Slate 900 */
  --footer-text: #f8fafc;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);

  --transition-speed: 0.3s;
}

body.dark-mode {
  /* Dark Mode Palette */
  --primary-color: #3b82f6;
  --secondary-color: #94a3b8;
  --accent-color: #38bdf8;

  --body-bg: #0f172a; /* Slate 900 */
  --body-text: #e2e8f0; /* Slate 200 */

  --section-bg: #0f172a;
  --section-bg-alt: #1e293b; /* Slate 800 */

  --card-bg: #1e293b;
  --card-text: #e2e8f0;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  --navbar-bg: rgba(15, 23, 42, 0.8);
  --navbar-text: #cbd5e1;
  --navbar-brand: #f8fafc;
  --navbar-active: #38bdf8;

  --footer-bg: #020617; /* Slate 950 */
  --footer-text: #94a3b8;

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* Global Styles */
body {
  font-family: "Inter", sans-serif;
  background-color: var(--body-bg);
  color: var(--body-text);
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  transition: color var(--transition-speed);
}

section {
  padding: 80px 0;
  position: relative;
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--navbar-backdrop);
  -webkit-backdrop-filter: var(--navbar-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

/* Navbar */
.navbar {
  background-color: var(--navbar-bg) !important;
  backdrop-filter: var(--navbar-backdrop);
  -webkit-backdrop-filter: var(--navbar-backdrop);
  border-bottom: 1px solid var(--card-border);
  transition: all var(--transition-speed);
  padding: 1rem 0;
}

.navbar-brand {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navbar-brand) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--navbar-text) !important;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--navbar-active) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--navbar-active);
  transition: width var(--transition-speed);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Section */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.1),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(14, 165, 233, 0.1),
      transparent 40%
    );
  padding-top: 80px; /* Account for fixed navbar */
}

#home h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

#home .lead {
  font-size: 1.25rem;
  color: var(--secondary-color);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all var(--transition-speed);
  border: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  ); /* Keep gradient */
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* About Section */
#about {
  background-color: var(--section-bg);
}

/* Skills Section */
#skills {
  background-color: var(--section-bg-alt);
}

.skill-item {
  background: var(--card-bg);
  color: var(--card-text);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.skill-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.skill-item h5 {
  margin: 0;
  font-weight: 600;
}

/* Projects Section */
#projects {
  background-color: var(--section-bg);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed);
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
  color: var(--card-text);
  height: 250px;
}

.card-title {
  font-weight: 700;
  margin-bottom: 1rem;
}

.card-text {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  min-height: 100px;
}

/* Contact Section */
#contact {
  background-color: var(--section-bg-alt);
  text-align: center;
}

/* Footer */
footer {
  background-color: var(--footer-bg) !important;
  color: var(--footer-text);
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark Mode Toggle */
#theme-toggle {
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.05);
  transition: all var(--transition-speed);
}

body.dark-mode #theme-toggle {
  background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Carousel Controls */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary-color);
    border-radius: 50%;
    background-size: 50%;
    width: 3rem;
    height: 3rem;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-item .card-img-top {
    height: 200px; /* Reset to smaller height for 3-column layout */
    object-fit: cover;
}

/* Move controls outside the cards slightly */
.carousel-control-prev {
    left: -5%;
}
.carousel-control-next {
    right: -5%;
}

/* Ensure carousel doesn't overflow due to negative margins of controls */
/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background-color: var(--card-border);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  border-radius: 2px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-item.left {
  left: 0;
}

.timeline-item.right {
  left: 50%;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border: 4px solid var(--section-bg);
  position: absolute;
  border-radius: 50%;
  top: 20px;
  z-index: 1;
  right: -10px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.timeline-item.right .timeline-dot {
  left: -10px;
}

.timeline-content {
  padding: 20px 30px;
  background-color: var(--card-bg);
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed);
}

.timeline-content:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  font-family: "Outfit", sans-serif;
}

.timeline-title {
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--card-text);
}

.timeline-subtitle {
  color: var(--secondary-color);
  font-weight: 500;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.timeline-desc {
  margin: 0;
  color: var(--card-text);
}

/* Responsive Timeline */
@media screen and (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item.left,
  .timeline-item.right {
    left: 0;
  }

  .timeline-item.left::after,
  .timeline-item.right::after {
    left: 15px;
  }

  .timeline-dot {
    left: 21px;
    right: auto;
  }
  
  .timeline-item.right .timeline-dot {
    left: 21px;
  }
}
