/* ===== BASE STYLES ===== */
:root {
  /* Color Palette */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #7c3aed;
  --accent-color: #ec4899;
  --dark-color: #1e293b;
  --dark-gray: #334155;
  --medium-gray: #64748b;
  --light-gray: #e2e8f0;
  --light-color: #f8fafc;
  --white: #ffffff;
  --black: #000000;
  
  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Playfair Display', serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 4rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-round: 50%;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  color: var(--dark-color);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xxl) 0;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  position: relative;
  text-align: center;
  display: block; /* Change from inline-block to block */
  margin-left: auto;
  margin-right: auto;
}

.section-title .highlight {
  color: var(--primary-color);
}
.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--primary-color);
  margin: var(--space-sm) auto var(--space-md);
  border-radius: 3px;
  display: none !important;
}
.section-subtitle {
  color: var(--medium-gray);
  margin-bottom: var(--space-xl);
  font-size: 1.1rem;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-normal);
  cursor: pointer;
  border: none;
  outline: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

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

.btn-outline:hover {
  background-color: var(--dark-color);
  color: var(--white);
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
}

.nav-item {
  position: relative;
}

.nav-link {
  padding: var(--space-sm) 0;
  font-weight: 500;
  color: var(--dark-gray);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background-color: var(--light-gray);
}

.dark-theme .theme-toggle:hover {
  background-color: var(--dark-gray);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition-normal);
}

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

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1001;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--dark-color);
  transition: var(--transition-normal);
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        padding: var(--space-xl) 0;
        box-shadow: var(--shadow-md);
        transition: var(--transition-normal);
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: var(--space-sm) 0;
        width: 100%;
        text-align: center;
    }

    .nav-link {
        padding: var(--space-sm) var(--space-md);
        display: block;
        width: 100%;
    }

    .hamburger {
        display: block;
        z-index: 1000;
        background: none;
        border: none;
        cursor: pointer;
        padding: var(--space-xs);
    }
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 70px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(226, 232, 240, 0.7) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0) 70%);
  z-index: -1;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

.hero-text {
  flex: 1;
  max-width: 600px;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.hero-title .highlight {
  color: var(--primary-color);
}

.typing-container {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-sm);
  min-height: 3rem;
}

.typing-text {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-color);
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1.5rem;
  background-color: var(--primary-color);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--medium-gray);
  margin-bottom: var(--space-lg);
  max-width: 90%;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.hero-image {
  position: relative;
  flex: 1;
  max-width: 400px;
  display: flex;
  justify-content: center;
}

.profile-img {
  
  width: 60%;
  max-width: 350px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transition: var(--transition-normal);
  z-index: 1;
}

.profile-img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.social-links {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
  background-color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background-color: var(--light-gray);
  color: var(--dark-color);
  transition: var(--transition-normal);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

/* ===== ABOUT SECTION ===== */
.about {
  background-color: var(--light-color);
}

.about-content {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-text {
  flex: 1;
}

.about-subtitle {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--dark-gray);
}

.about-description {
  margin-bottom: var(--space-md);
  color: var(--medium-gray);
}

.about-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.detail-item {
  display: flex;
  gap: var(--space-xs);
}

.detail-label {
  font-weight: 600;
  color: var(--dark-color);
}

.detail-value {
  color: var(--medium-gray);
}

/* Responsive styles for medium screens */
@media (max-width: 992px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-text {
    max-width: 100%;
    margin-bottom: var(--space-xl);
  }
  
  .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .about-text {
    order: 2;
  }
  
  .about-image {
    order: 1;
    margin-bottom: var(--space-lg);
  }
}
/* ===== PROJECTS SECTION ===== */
.projects {
  background-color: var(--white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.project-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  overflow: hidden;
  height: 200px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-content {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--dark-color);
}

.project-description {
  color: var(--medium-gray);
  margin-bottom: var(--space-md);
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.project-tech span {
  background-color: var(--light-gray);
  color: var(--dark-gray);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: var(--space-sm);
}

/* ===== CODING PROFILES SECTION ===== */
.coding {
    background-color: var(--light-color);
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.platform-card {
    background-color: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.platform-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    border-radius: var(--radius-round);
    color: var(--primary-color);
    font-size: 1.75rem;
    transition: var(--transition-normal);
}

.platform-card:hover .platform-icon {
    background-color: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.platform-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    color: var(--dark-color);
}

.platform-stats {
    width: 100%;
    margin-bottom: var(--space-md);
    flex-grow: 1;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
    padding: var(--space-xs) 0;
    border-bottom: 1px dashed var(--light-gray);
}

.stat-label {
    font-weight: 500;
    color: var(--medium-gray);
}

.stat-value {
    font-weight: 600;
    color: var(--dark-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .platforms-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .platforms-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== SKILLS SECTION ===== */
.skills {
  background-color: var(--light-color);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.skill-card {
  background-color: var(--white);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.skill-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-gray);
  border-radius: var(--radius-round);
  color: var(--primary-color);
  font-size: 1.75rem;
  transition: var(--transition-normal);
}

.skill-card:hover .skill-icon {
  background-color: var(--primary-color);
  color: var(--white);
  transform: rotate(15deg) scale(1.1);
}

.skill-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--dark-color);
}

.skill-description {
  color: var(--medium-gray);
  font-size: 0.9rem;
}

/* ===== CONTACT SECTION ===== */
.contact {
  background-color: var(--white);
}

.contact-content {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.contact-info {
  flex: 1;
}

.contact-item {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  align-items: flex-start;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: var(--light-gray);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: var(--transition-normal);
}

.contact-item:hover .contact-icon {
  background-color: var(--primary-color);
  color: var(--white);
  transform: scale(1.1);
}

.contact-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
  color: var(--dark-color);
}

.contact-link, .contact-text {
  color: var(--medium-gray);
  transition: var(--transition-fast);
}

.contact-link:hover {
  color: var(--primary-color);
}

.contact-social {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background-color: var(--light-gray);
  color: var(--dark-color);
  transition: var(--transition-normal);
}

.contact-social a:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

/* ===== CONTACT FORM FIXES ===== */
.contact-form {
  flex: 1;
  background-color: var(--light-color);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.form-group {
  position: relative;
  margin-bottom: var(--space-lg);
  padding-top: 20px; /* Space for floating label */
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px var(--space-xs) 6px; /* Adjusted padding */
  border: none;
  border-bottom: 1px solid var(--medium-gray);
  background-color: transparent;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--dark-color);
  transition: var(--transition-normal);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  padding-top: 18px; /* Extra space for textarea */
}

/* Label styling */
.form-group label {
  position: absolute;
  left: var(--space-xs);
  top: 30px; /* Initial position */
  color: var(--medium-gray);
  pointer-events: none;
  transition: var(--transition-normal);
  font-size: 1rem; /* Match input font size */
}

/* Focused/filled state */
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: 10px; /* Final raised position */
  left: var(--space-xs);
  font-size: 0.8rem;
  color: var(--primary-color);
  background: var(--light-color); /* Solid background */
  padding: 0 4px;
}

/* Remove default browser behavior that may cause overlap */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--light-color) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--dark-color);
  color: var(--light-gray);
  padding: var(--space-xxl) 0 var(--space-md);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-logo {
  margin-bottom: var(--space-md);
}

.footer-text {
  color: var(--medium-gray);
  margin-top: var(--space-sm);
}

.footer-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--white);
}

.footer-links ul,
.footer-contact ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a,
.footer-contact li {
  color: var(--medium-gray);
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-contact i {
  margin-right: var(--space-xs);
  color: var(--primary-color);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--dark-gray);
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.footer-social a {
  color: var(--medium-gray);
  transition: var(--transition-fast);
}

.footer-social a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* ===== DARK MODE ===== */
:root {
    --background-light: #ffffff;
    --text-light: #1e293b;
    /* ... other light mode vars ... */
}

[data-theme="dark"] {
    --background-light: #1e293b;
    --text-light: #f8fafc;
    /* Update other vars for dark mode */
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
}

body.dark-mode .theme-toggle i.bi-sun-fill {
    display: none;
}

body.dark-mode .theme-toggle i.bi-moon-fill {
    display: inline;
}

.theme-toggle i.bi-moon-fill {
    display: none;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: 999;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

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

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

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-item {
    margin: var(--space-sm) 0;
  }

  .hamburger {
    display: block;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .typing-text {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .about-details {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

