/* CSS Variables for Theme Switching */
:root {
  /* Blue Theme Colors (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  
  /* Fonts */
  --font-primary: 'Inter', sans-serif;
  
  /* Spacing */
  --section-padding: 3rem 0;
  --container-max-width: 1200px;
  --border-radius: 0.5rem;
  --transition: all 0.3s ease;
}

/* Black Theme Colors - FIXED */
[data-theme="black"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #666666;
  --accent-color: #3b82f6;  /* Changed from #000000 to visible blue */
  --accent-hover: #60a5fa;  /* Changed from #333333 to lighter blue */
  --border-color: #333333;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Header background for black theme */
[data-theme="black"] .header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

[data-theme="black"] .theme-selector {
  background: rgba(0, 0, 0, 0.9);
}

/* Base Styles - Mobile First */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition);
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: white;
  padding: 8px;
  z-index: 1000;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  font-weight: 500;
}

.skip-link:focus {
  top: 0;
}

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

h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

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

a:hover {
  color: var(--accent-hover);
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: var(--transition);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  z-index: 1001;
}

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

.nav-links {
  display: none;
  list-style: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--border-color);
}

.nav-links.active {
  display: flex;
}

.nav-link {
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.75rem 0;
  display: block;
  position: relative;
  text-align: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link:focus::after {
  width: 30px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
}

.theme-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.theme-icon i {
  position: absolute;
  top: 0;
  left: 0;
  transition: var(--transition);
}

.theme-icon .fa-sun {
  opacity: 0;
}

[data-theme="black"] .theme-icon .fa-sun {
  opacity: 1;
}

[data-theme="black"] .theme-icon .fa-moon {
  opacity: 0;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  justify-content: space-between;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Theme Selector Styles */
.theme-selector {
  position: fixed;
  top: 1rem;
  right: 4.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem;
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.theme-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: white;
  font-size: 0.9rem;
}

.theme-option:hover {
  transform: scale(1.1);
}

.theme-option.active {
  box-shadow: 0 0 0 2px var(--accent-color);
}

.theme-blue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.theme-black {
  background: linear-gradient(135deg, #000000, #333333);
}

/* Hero Section */
.hero {
  padding: 7rem 0 3rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
}

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

.hero-text {
  text-align: center;
  max-width: 100%;
}

.hero-title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin-bottom: 0.5rem;
}

.hero-title span {
  color: var(--accent-color);
}

.hero-subtitle {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.profile-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  font-size: 5rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
  gap: 0.5rem;
  text-decoration: none;
  min-width: fit-content;
  width: 100%;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

/* Sections */
.section {
  padding: var(--section-padding);
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
}

.section-title.center {
  text-align: center;
}

/* About Section */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-text p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

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

.stat {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

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

/* Skills Section */
.skills {
  background-color: var(--bg-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.skill-category {
  background-color: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.skill-category-title {
  margin-bottom: 1.5rem;
  color: var(--accent-color);
  font-size: 1.25rem;
  text-align: center;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.skill-item {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.skill-item:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.project-image {
  height: 200px;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

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

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.tech-tag {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

/* Contact Section */
.contact-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-text {
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
  text-align: center;
}

.contact-details {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-direction: column;
  text-align: center;
}

.contact-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-text h3 {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
}

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

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

.social-link {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-3px);
}

/* Form Styles */
.contact-form {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  transition: var(--transition);
  font-size: 1rem;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-text {
  color: var(--text-secondary);
}

.copyright {
  margin: 0;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  color: var(--accent-color);
}

/* Tablet Styles */
@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    width: auto;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
  }
  
  .nav-link {
    padding: 0.5rem 0;
    text-align: left;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .hero-content {
    flex-direction: row;
    text-align: left;
  }
  
  .hero-text {
    text-align: left;
    max-width: 60%;
  }
  
  .hero-actions {
    flex-direction: row;
    max-width: none;
    margin: 0;
  }
  
  .btn {
    width: auto;
  }
  
  .hero-visual {
    max-width: 35%;
  }
  
  .profile-image {
    max-width: 350px;
  }
  
  .about-content {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .about-text {
    flex: 2;
  }
  
  .about-text p {
    text-align: left;
  }
  
  .about-stats {
    flex: 1;
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skill-category-title {
    text-align: left;
  }
  
  .skill-items {
    justify-content: flex-start;
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .project-tech {
    justify-content: flex-start;
  }
  
  .project-links {
    flex-direction: row;
  }
  
  .contact-content {
    flex-direction: row;
  }
  
  .contact-info {
    flex: 1;
  }
  
  .contact-text {
    text-align: left;
  }
  
  .contact-item {
    flex-direction: row;
    text-align: left;
  }
  
  .social-links {
    justify-content: flex-start;
  }
  
  .contact-form {
    flex: 1;
  }
  
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .section {
    padding: 5rem 0;
  }
  
  .hero {
    padding: 8rem 0 4rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .theme-selector {
    top: 1.5rem;
    right: 5rem;
  }
  
  .theme-option {
    width: 40px;
    height: 40px;
  }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
  .container {
    padding: 0 2rem;
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
  }
}

/* Small Mobile Optimization */
@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .hero {
    padding: 6rem 0 2rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .profile-image {
    max-width: 250px;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
  
  .contact-form {
    padding: 1rem;
  }
  
  .theme-selector {
    right: 4rem;
    transform: scale(0.9);
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .theme-toggle,
  .mobile-menu-toggle,
  .theme-selector {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .hero,
  .section {
    padding: 1rem 0 !important;
    page-break-inside: avoid;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  .btn {
    border: 1px solid black !important;
    background: white !important;
    color: black !important;
  }
}