/* ==========================================================================
   PORTFOLIO WEBSITE STYLESHEET - DHIVAGAR S (WEB APP DEVELOPER)
   Theme: Modern Dark UI with Soft Purple Glows & Glassmorphism
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & RESET
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg-primary: #0a0812;
  --bg-secondary: #120e24;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(18, 14, 36, 0.75);

  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-purple-dark: #6d28d9;
  --accent-purple-glow: rgba(139, 92, 246, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-purple: rgba(167, 139, 250, 0.2);
  --border-purple-active: rgba(167, 139, 250, 0.6);

  /* Fonts & Shadows */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(109, 40, 217, 0.1) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #261f3d;
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* --------------------------------------------------------------------------
   2. REUSABLE UTILITIES & LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--accent-purple-light);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  display: block;
}

.section-description {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 50px auto;
  font-size: 1.05rem;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-purple-light) 70%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple-light), var(--accent-purple-dark));
  color: #ffffff;
  box-shadow: 0 4px 20px var(--accent-purple-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #b89eff, var(--accent-purple));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-purple);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--accent-purple-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

/* Glass Card Component */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-purple-active);
  box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   3. NAVBAR
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition-normal);
}

.navbar.scrolled {
  padding: 14px 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo span {
  color: var(--accent-purple-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-purple-light);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple-light), var(--accent-purple));
  transition: var(--transition-normal);
  border-radius: 2px;
}

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

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  z-index: 1001;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background-color: var(--text-primary);
  transition: var(--transition-normal);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 130px;
  padding-bottom: 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-purple);
  color: var(--accent-purple-light);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-badge-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent-purple-light);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-purple-light);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-purple-light);
  margin-bottom: 24px;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 540px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-normal);
}

.social-icon:hover {
  color: #ffffff;
  background: var(--accent-purple);
  border-color: var(--accent-purple-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* Avatar Frame */
.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.avatar-container {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  padding: 10px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.4), rgba(109, 40, 217, 0.1));
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.3);
  animation: float 6s ease-in-out infinite;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: var(--bg-secondary);
  border: 2px solid var(--border-purple);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* --------------------------------------------------------------------------
   5. ABOUT SECTION
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-text p {
  margin-bottom: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-purple-light);
  margin-bottom: 6px;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. SKILLS SECTION
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.skill-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skill-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skill-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.skill-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.skill-percentage {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-purple-light);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple-light), var(--accent-purple-dark));
  border-radius: 4px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   7. PROJECTS SECTION
   -------------------------------------------------------------------------- */
.project-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 8px 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-purple);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple-light);
  box-shadow: 0 4px 20px var(--accent-purple-glow);
  transform: translateY(-2px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border-radius: 20px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.project-card.fade-out {
  opacity: 0;
  transform: scale(0.95);
}

.project-card.hide {
  display: none !important;
}

.project-image-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #0b0914;
}

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

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

.project-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-description {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.65;
}

/* Feature Checkmarks List Box */
.project-features-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.project-features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feature-icon {
  color: var(--accent-purple-light);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tech-tag {
  font-size: 0.775rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple-light);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.project-link {
  flex: 1;
  text-align: center;
}


/* --------------------------------------------------------------------------
   8. CONTACT SECTION & FORMSPREE INTEGRATION
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
}

.contact-info-card {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;

}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-detail-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.contact-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.contact-form-card {
  padding: 36px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-normal);
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent-purple-light);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* Status Notifications */
.form-status {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.form-status.success {
  display: flex;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.form-status.error {
  display: flex;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Loading Spinner on Button */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn.loading .btn-spinner {
  display: block;
}

.btn.loading .btn-text {
  opacity: 0.8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 40px 0;
  background: var(--bg-primary);
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. SCROLL REVEAL ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   11. MEDIA QUERIES (RESPONSIVE DESIGN)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content {
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-socials {
    justify-content: center;
  }

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

@media (max-width: 768px) {
  .section {
    padding: 70px 0;
  }

  .hamburger {
    display: block;
  }

  .hamburger.active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 40px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    transition: var(--transition-normal);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .avatar-container {
    width: 250px;
    height: 250px;
  }

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

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.25rem;
  }
  
  .hero-subtitle {
    font-size: 1.35rem;
  }

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

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

  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}
