/* ===== CSS VARIABLES ===== */
:root {
  /* Light theme colors */
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  /* Text colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Border colors */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Shadow colors */
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-heavy: rgba(0, 0, 0, 0.25);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Spacing */
  --section-padding: 100px 0;
  --container-padding: 0 15px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border radius */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border-color: #334155;
  --border-light: #475569;
  
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-heavy: rgba(0, 0, 0, 0.6);
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--primary-dark);
}

/* ===== UTILITY CLASSES ===== */
.section-padding {
  padding: var(--section-padding);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

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

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px var(--shadow-light);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px var(--shadow-medium);
}

.theme-toggle i {
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: transform var(--transition-normal);
}

/* ===== NAVIGATION ===== */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  padding: 1rem 0;
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.95);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--text-secondary) !important;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(59, 130, 246, 0.1);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ===== HERO SECTION ===== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%233b82f6" stop-opacity="0.1"/><stop offset="100%" stop-color="%233b82f6" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="150" fill="url(%23a)"/><circle cx="800" cy="300" r="100" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>') no-repeat center center;
  background-size: cover;
  opacity: 0.5;
  z-index: -1;
}

.hero-content {
  padding: 2rem 0;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-buttons {
  margin-bottom: 2rem;
}

.btn {
  padding: 12px 30px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  text-transform: none;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

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

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: all var(--transition-normal);
}

.social-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* ===== HERO IMAGE ===== */
.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.image-container {
  position: relative;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow-medium);
}

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

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.image-container:hover .profile-image {
  transform: scale(1.1);
}

.image-container:hover .image-overlay {
  opacity: 0.2;
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.scroll-down {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  animation: bounce 2s infinite;
  transition: all var(--transition-normal);
}

.scroll-down:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ===== ABOUT SECTION ===== */
.about-content h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.about-stats {
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-item h4 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-weight: 500;
}

.about-image {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.skills-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 400px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-normal);
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-light);
  border-color: var(--primary-color);
}

.skill-item i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.skill-item span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-primary);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: 3rem;
}

.timeline-marker {
  position: absolute;
  left: 20px;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border: 4px solid var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--primary-color);
}

.timeline-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: 0 5px 25px var(--shadow-light);
  transition: all var(--transition-normal);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
}

.timeline-header h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline-header h5 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.period {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.timeline-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.timeline-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

/* ===== SKILLS SECTION ===== */
.skill-category {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  height: 100%;
  box-shadow: 0 5px 25px var(--shadow-light);
  transition: all var(--transition-normal);
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
}

.skill-category-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.skill-category-header i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-right: 1rem;
}

.skill-category-header h4 {
  color: var(--text-primary);
  margin-bottom: 0;
}

.skill-item-detailed {
  margin-bottom: 1.5rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
}

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

.skill-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  width: 0;
  transition: width 1s ease-in-out;
}

/* ===== EDUCATION SECTION ===== */
.education-timeline {
  position: relative;
}

.education-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 5px 25px var(--shadow-light);
  transition: all var(--transition-normal);
}

.education-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
}

.education-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  margin-right: 2rem;
  flex-shrink: 0;
}

.education-icon i {
  font-size: 1.5rem;
  color: white;
}

.education-content h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.education-content h5 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.education-content .period {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.education-content p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ===== CONTACT SECTION ===== */
.contact-info {
  max-width: 800px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 2rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 5px 25px var(--shadow-light);
  transition: all var(--transition-normal);
  height: 100%;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
  border-color: var(--primary-color);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.contact-icon i {
  font-size: 1.5rem;
  color: white;
}

.contact-content h5 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.contact-content p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.contact-content a {
  color: var(--primary-color);
  font-weight: 500;
}

.social-links-large {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-link-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-normal);
  min-width: 150px;
  box-shadow: 0 5px 25px var(--shadow-light);
}

.social-link-large:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px var(--shadow-medium);
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.social-link-large i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  transition: color var(--transition-normal);
}

.social-link-large:hover i {
  color: white;
}

.social-link-large span {
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.social-link-large:hover span {
  color: white;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  text-align: center;
}

.footer p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

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

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

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

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
  }
  
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
  
  .hero-section {
    text-align: center;
    padding: 2rem 0;
  }
  
  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 250px;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .image-container {
    width: 250px;
    height: 250px;
    margin-bottom: 2rem;
  }
  
  .timeline::before {
    left: 15px;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .timeline-marker {
    left: 5px;
  }
  
  .skills-preview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .education-item {
    flex-direction: column;
    text-align: center;
  }
  
  .education-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .social-links-large {
    flex-direction: column;
    align-items: center;
  }
  
  .social-link-large {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }
  
  .timeline-content,
  .skill-category,
  .contact-item,
  .education-item {
    padding: 1.5rem;
  }
  
  .hero-content {
    padding: 1rem 0;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-down {
    animation: none;
  }
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .theme-toggle,
  .navbar,
  .scroll-indicator,
  .back-to-top {
    display: none !important;
  }
  
  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }
  
  .section-padding {
    padding: 2rem 0;
  }
}
