:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1c1b1d;
  --text-primary: #ededed;
  --text-secondary: #c8c8c8; /* Improved contrast - WCAG AA compliant (4.5:1 ratio) */
  --accent-purple: #a855f7;
  --accent-teal: #14b8a6;
  --accent-red: #ef4444;
}

/* Light Theme Variables */
body.light {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a; /* Improved contrast - WCAG AA compliant (7:1 ratio) */
}

/* Accessibility - Focus states for keyboard navigation */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3);
}

/* Improve contrast for interactive elements */
button, a, input, textarea, select {
  transition: outline 0.2s ease;
}

/* Screen reader only class - hides visually but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Improved contrast for secondary text - WCAG AA compliant */
.text-text-secondary {
  color: #d0d0d0 !important; /* 4.5:1 contrast ratio on dark background */
}

body.light .text-text-secondary {
  color: #525252 !important; /* 7:1 contrast ratio on light background */
}

/* Page Loader Styles */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Spinner Animation */
.spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
  animation-delay: -0.45s;
  border-top-color: var(--accent-purple);
}

.spinner-ring:nth-child(2) {
  animation-delay: -0.3s;
  border-top-color: var(--accent-teal);
  width: 85%;
  height: 85%;
  top: 7.5%;
  left: 7.5%;
}

.spinner-ring:nth-child(3) {
  animation-delay: -0.15s;
  border-top-color: var(--accent-red);
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
}

.spinner-ring:nth-child(4) {
  border-top-color: var(--accent-purple);
  width: 55%;
  height: 55%;
  top: 22.5%;
  left: 22.5%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loader Text */
.loader-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.loader-name {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-purple);
  animation: dot-bounce 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loader-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dot-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Main Content Hidden Initially */
.main-content.hidden {
  display: none !important;
}

/* Utility class for hiding elements */
.hidden {
  display: none !important;
}

/* Light mode adjustments for loader */
body.light .page-loader {
  background: var(--bg-primary);
}

body.light .loader-text {
  color: var(--text-primary);
}

/* Ensure minimum contrast for links on light background */
body.light a {
  color: #1a1a1a;
}

body.light a:hover {
  color: var(--accent-purple);
}

/* Ensure minimum contrast for buttons on light background */
body.light button.text-white {
  color: #ffffff !important;
}

/* Improve contrast for glass elements */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light .glass {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

body.light .glass {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light .nav-fixed.scrolled {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light .language-menu {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light .language-option {
  color: var(--text-primary);
}

body.light .language-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.light .language-option.active {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

body.light .control-button {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light .control-button:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light .control-button.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-purple);
}

/* Light theme scrollbar */
body.light ::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

body.light ::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
}

body.light ::-webkit-scrollbar-thumb:hover {
  background: var(--accent-teal);
}

/* Light theme card hover */
body.light .card-hover:hover {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.3);
}

/* Light theme timeline dot */
body.light .timeline-dot {
  border-color: var(--bg-primary);
}

/* Light theme for experience and certification cards */
body.light .glass .text-white {
  color: var(--text-primary) !important;
}

body.light .glass h3.text-white,
body.light .glass h4.text-white {
  color: var(--text-primary) !important;
}

body.light .glass span.text-white {
  color: var(--text-primary) !important;
}

body.light .glass button.text-white {
  color: var(--text-primary) !important;
}

/* View All Certifications Button - Light Theme */
body.light #viewAllCertificationsBtn {
  color: var(--text-primary) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light #viewAllCertificationsBtn:hover {
  border-color: var(--accent-purple) !important;
  color: var(--accent-purple) !important;
}

/* View All Projects Button - Light Theme */
body.light #viewAllProjectsBtn {
  color: var(--text-primary) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light #viewAllProjectsBtn:hover {
  border-color: var(--accent-purple) !important;
  color: var(--accent-purple) !important;
}

/* View All Experiences Button - Light Theme */
body.light #viewAllExperiencesBtn {
  color: var(--text-primary) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light #viewAllExperiencesBtn:hover {
  border-color: var(--accent-purple) !important;
  color: var(--accent-purple) !important;
}

body.light .glass .bg-white\/5 {
  background: rgba(0, 0, 0, 0.05) !important;
}

body.light .glass .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light .glass .hover\:border-white\/20:hover {
  border-color: rgba(0, 0, 0, 0.2) !important;
}

body.light .glass i.text-white {
  color: var(--text-primary) !important;
}

body.light .glass span.text-white {
  color: var(--text-primary) !important;
}

/* Hobby card text - always visible with strong shadow */
.hobby-card-title {
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.8) !important;
  -webkit-text-stroke: 0.5px rgba(0,0,0,0.3);
  color: #ffffff !important;
}

body.light .hobby-card-title {
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.8) !important;
  -webkit-text-stroke: 0.5px rgba(0,0,0,0.3);
  color: #ffffff !important;
}

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

body {
  font-family: 'Outfit', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  justify-content: center;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-teal);
}

/* Filter Button Active */
.filter-btn.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* Skill Bar Animation */
@keyframes fillBar {
  from {
    width: 0;
  }
}

.skill-bar-fill {
  animation: fillBar 1.5s ease-out forwards;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Hover Effect */
.card-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  transform: translateZ(0); /* Force hardware acceleration */
}

.card-hover:hover {
  transform: translate3d(0, -5px, 0);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.2);
}

/* Gradient Text */
.gradient-text-purple {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-teal {
  background: linear-gradient(135deg, var(--accent-teal), #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Timeline Line */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-purple), var(--accent-teal));
  transform: translateX(-50%);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: 3px solid var(--bg-primary);
  z-index: 10;
}

/* Hide timeline line and dots on mobile */
@media (max-width: 768px) {
  .timeline-line {
    display: none;
  }
  
  .timeline-dot {
    display: none;
  }
}

/* Footer Styles */
footer {
  background: var(--bg-secondary);
}

footer a {
  text-decoration: none;
}

/* Light theme footer styles */
body.light footer {
  background: var(--bg-secondary);
}

body.light footer .text-white {
  color: var(--text-primary) !important;
}

body.light footer a.text-white {
  color: var(--text-primary) !important;
}

body.light footer .bg-white\/5 {
  background: rgba(0, 0, 0, 0.05) !important;
}

body.light footer .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light footer .hover\:bg-white\/10:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

body.light footer .hover\:border-white\/20:hover {
  border-color: rgba(0, 0, 0, 0.2) !important;
}

/* Override Tailwind classes to use CSS variables */
.bg-bg-primary {
  background-color: var(--bg-primary) !important;
}

.bg-bg-secondary {
  background-color: var(--bg-secondary) !important;
}

.text-text-primary {
  color: var(--text-primary) !important;
}

/* text-text-secondary already defined above with improved contrast */

/* Accent colors for Tailwind compatibility */
.bg-accent-red\/20 {
  background-color: rgba(239, 68, 68, 0.2) !important;
}

.text-accent-red {
  color: var(--accent-red) !important;
}

/* Light theme overrides */
body.light .bg-bg-primary {
  background-color: var(--bg-primary) !important;
}

body.light .bg-bg-secondary {
  background-color: var(--bg-secondary) !important;
}

body.light .text-text-primary {
  color: var(--text-primary) !important;
}

/* text-text-secondary contrast already improved above */


