/* CSS Variables for Theme */
:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: #1a1a2e;
  --card: #ffffff;
  --card-foreground: #1a1a2e;
  --popover: #ffffff;
  --popover-foreground: #1a1a2e;
  --primary: #16213e;
  --primary-foreground: #ffffff;
  --secondary: #e3e4e6;
  --secondary-foreground: #1a1a2e;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: rgba(0, 0, 0, 0.2);
  --radius: 0.625rem;
}

.dark {
  --background: #0a0a0a;
  --foreground: #ffffff;
  --card: #1a1a2e;
  --card-foreground: #ffffff;
  --popover: #1a1a2e;
  --popover-foreground: #ffffff;
  --primary: #3f4c6b;
  --primary-foreground: #ffffff;
  --secondary: #2c2c54;
  --secondary-foreground: #ffffff;
  --muted: #2c2c2c;
  --muted-foreground: #a0a0a0;
  --accent: #2c2c2c;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #2c2c2c;
  --input: #2c2c2c;
  --ring: rgba(255, 255, 255, 0.2);
}

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

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
}

h2 {
  font-size: 1.875rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

h3 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

h4 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

p {
  font-size: 1rem;
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
}

/* Utility Classes */
.text-primary {
  color: var(--primary);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

.btn-primary:hover {
  background-color: var(--primary);
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary);
  opacity: 0.9;
}

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

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  height: 3rem;
  padding: 0 2rem;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
}

.btn-icon:first-child {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* Navigation */
.navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.dark .navbar {
  background-color: rgba(26, 26, 46, 0.8);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-logo h1 {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.nav-links-desktop {
  display: none;
  gap: 1rem;
}

.nav-link {
  background: none;
  border: none;
  color: var(--foreground);
  font-weight: var(--font-weight-medium);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.nav-link.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.nav-theme-desktop {
  display: none;
}

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

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.theme-icon {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  transition: all 0.3s ease;
}

.theme-icon.sun-icon {
  opacity: 1;
}

.theme-icon.moon-icon {
  opacity: 0;
  position: absolute;
}

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

.dark .theme-icon.moon-icon {
  opacity: 1;
}

.mobile-menu-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background-color: var(--accent);
}

.menu-icon,
.close-icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  transition: all 0.3s ease;
}

.close-icon {
  opacity: 0;
  position: absolute;
}

.mobile-menu-btn.active .menu-icon {
  opacity: 0;
}

.mobile-menu-btn.active .close-icon {
  opacity: 1;
}

.nav-mobile-menu {
  display: none;
  background-color: var(--card);
  border-top: 1px solid var(--border);
}

.nav-mobile-menu.active {
  display: block;
}

.nav-mobile-links {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link-mobile {
  background: none;
  border: none;
  color: var(--foreground);
  font-weight: var(--font-weight-medium);
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.nav-link-mobile:hover {
  background-color: var(--accent);
}

.nav-link-mobile.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Page System */
.page {
  display: none;
  min-height: calc(100vh - 4rem);
}

.page.active {
  display: block;
}

.page-title {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* Hero Section */
.hero-section {
  padding: 5rem 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

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

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 32rem;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-image {
  position: relative;
}

.image-wrapper {
  position: relative;
  z-index: 1;
}

.hero-img {
  width: 100%;
  height: 31.25rem;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 33, 62, 0.2), transparent);
  border-radius: var(--radius);
}

/* Services Section */
.services-section {
  padding: 5rem 1rem;
  background-color: rgba(236, 236, 240, 0.3);
}

.dark .services-section {
  background-color: rgba(44, 44, 44, 0.3);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.service-card {
  background-color: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.service-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.service-icon {
  width: 4rem;
  height: 4rem;
  background-color: rgba(22, 33, 62, 0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.service-icon svg {
  width: 2rem;
  height: 2rem;
  stroke: var(--primary);
}

.service-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.service-description {
  color: var(--muted-foreground);
}

/* Featured Projects Section */
.featured-projects-section {
  padding: 5rem 1rem;
}

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

.project-card {
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.project-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-description {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* About Page */
.about-container {
  padding: 5rem 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.about-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 5rem;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-text {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

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

.profile-image-wrapper {
  position: relative;
}

.profile-image {
  width: 20rem;
  height: 20rem;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.profile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(22, 33, 62, 0.1));
  border-radius: 50%;
}

/* Skills Section */
.skills-section {
  margin-bottom: 5rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-badge {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

/* Experience Section */
.experience-section {
  margin-bottom: 5rem;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-card {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.experience-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.experience-title {
  font-size: 1.25rem;
}

.experience-date {
  display: flex;
  align-items: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.date-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

.experience-company {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.experience-description {
  color: var(--muted-foreground);
}

/* Contact Section */
.contact-section {
  margin-bottom: 5rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.contact-info-card,
.contact-form-card {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.contact-card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--primary);
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.contact-value {
  font-weight: var(--font-weight-medium);
}

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

/* Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: var(--font-weight-medium);
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 33, 62, 0.1);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

textarea.form-input {
  resize: vertical;
  min-height: 6rem;
}

/* Projects Page */
.projects-container {
  padding: 5rem 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.projects-header {
  text-align: center;
  margin-bottom: 4rem;
}

.projects-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 48rem;
  margin: 0 auto;
}

/* Filter */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: var(--accent);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.filter-icon {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.project-image-container {
  position: relative;
  overflow: hidden;
}

.project-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.project-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

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

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badge {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

/* Projects CTA */
.projects-cta {
  text-align: center;
  padding: 2rem;
  background-color: rgba(236, 236, 240, 0.3);
  border-radius: var(--radius);
}

.dark .projects-cta {
  background-color: rgba(44, 44, 44, 0.3);
}

.cta-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.cta-description {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  background-color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid var(--border);
  margin-top: 5rem;
}

.dark .footer {
  background-color: rgba(26, 26, 46, 0.5);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 600;
}

.footer-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background-color: var(--accent);
}

.social-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.footer-heading {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-medium);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  background: none;
  border: none;
  color: var(--foreground);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
}

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

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.contact-item .contact-icon {
  width: 1rem;
  height: 1rem;
  stroke: var(--primary);
  flex-shrink: 0;
}

.footer-separator {
  height: 1px;
  background-color: var(--border);
  margin: 2rem 0;
}

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

.footer-copyright {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.legal-link {
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
}

.legal-link:hover {
  color: var(--foreground);
}

/* Responsive Design */
@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .experience-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .nav-links-desktop {
    display: flex;
  }

  .nav-theme-desktop {
    display: block;
  }

  .nav-mobile-controls {
    display: none;
  }

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

  .page-title {
    font-size: 3.75rem;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-hero {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .container {
    padding: 0 2rem;
  }

  .hero-section {
    padding: 5rem 2rem;
  }

  .services-section {
    padding: 5rem 2rem;
  }

  .featured-projects-section {
    padding: 5rem 2rem;
  }
}

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

.page.active {
  animation: fadeIn 0.5s ease-out;
}

/* Hidden projects for filtering */
.project-card.hidden {
  display: none;
}

/* Loading states */
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Focus styles for accessibility */
.btn:focus,
.form-input:focus,
.nav-link:focus,
.filter-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar,
  .footer {
    display: none;
  }
  
  .page {
    display: block !important;
  }
}