:root {
  --color-primary: #5ADBFF;
  --color-primary-dark: #3AADE5;
  --color-secondary: #0F1C2E;
  --color-background: #F1F3F6;
  --color-surface: #FAFBFC;
  --color-text: #2E2E2E;
  --color-accent: #BFFFD9;
  --color-border: #CCC;
}

[data-theme="dark"] {
  --color-primary: #5ADBFF;
  --color-primary-dark: #2697c6;
  --color-secondary: #0F0F0F;
  --color-background: #121212;
  --color-surface: #1A1A1A;
  --color-text: #E0E0E0;
  --color-accent: #88FFE0;
  --color-border: #444;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

/* Header */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--color-surface);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
}

header.scrolled {
  background: var(--color-surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

nav {
  max-width: 1100px;
  margin: auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a,
.theme-toggle {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.theme-toggle:hover {
  color: var(--color-primary);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Hero */
.hero {
  text-align: center;
  padding: 100px 2rem 80px;
  background: linear-gradient(120deg, var(--color-secondary), var(--color-primary));
  color: white;
  animation: fadeUp 1s ease;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
}

/* Sections */
.content-section {
  max-width: 960px;
  margin: 60px auto;
  padding: 80px 2rem;
  background: linear-gradient(to bottom, var(--color-surface), var(--color-background));
  border-radius: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: background 0.3s ease;
  animation: fadeUp 0.8s ease both;
}

.content-section h2 {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Projects */
.projects-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
  background: linear-gradient(135deg, var(--color-surface), var(--color-background));
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.6s ease both;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: break-word;
}

.project-card p {
  margin-bottom: 0.5rem;
  overflow-wrap: break-word;
}

.project-card a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.project-card a:hover {
  text-decoration: underline;
}

/* Skills */
.skills-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 1.5rem;
}

.skill-box {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(90, 219, 255, 0.3);
  transition: transform 0.2s ease;
  animation: fadeUp 0.8s ease both;
}

.skill-box:hover {
  transform: scale(1.05);
}

/* Contact */
#contact a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Connect With Me Section */
#connect {
  max-width: 600px;
  margin: 2rem auto 4rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--color-surface), var(--color-background));
  border-radius: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  text-align: center;
  transition: background 0.3s ease;
}

#connect h2 {
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 600;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  font-size: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  resize: vertical;
  color: var(--color-text);
  background: var(--color-surface);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #888;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 5px var(--color-primary);
}

.contact-form button {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  padding: 0.95rem 1.4rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 1.1rem;
}

.contact-form button:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.contact-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  min-height: 1.5rem;
}

.form-status.error {
  color: #ff4d6d;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: #777;
  background: var(--color-surface);
}

/* Animations */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* GitHub Stats Widget */
.github-stats-widget {
  margin-top: 2rem;
  text-align: center;
  background: var(--color-surface);
  padding: 1.5rem 1rem;
  border-radius: 14px;
  transition: background-color 0.3s ease;
}

.github-stats-widget h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.5rem;
}

.github-stats-widget img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(90, 219, 255, 0.3);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.github-stats-widget img:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Responsive Fixes */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }

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

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

  #connect {
    margin: 1rem 1rem 3rem;
    padding: 1.5rem;
  }

  .contact-form button {
    font-size: 1rem;
  }
}
