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

/* Enable smooth scrolling when clicking anchor links like #top */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  background: #f8fafc;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* Dark Theme */
[data-theme="dark"] body {
  color: #ffffff;
  background: #000000;
}

[data-theme="dark"] .header {
  background: #1a1a1a;
  border-bottom: 1px solid #333333;
}

[data-theme="dark"] .header__logo .logo-text {
  color: #3b82f6;
}

[data-theme="dark"] .nav__link {
  color: #ffffff;
}

[data-theme="dark"] .nav__link:hover,
[data-theme="dark"] .nav__link:focus,
[data-theme="dark"] .nav__link.active {
  color: #3b82f6;
}

[data-theme="dark"] .nav__link::after {
  background: #3b82f6;
}

[data-theme="dark"] .hamburger {
  background: #3b82f6;
}

[data-theme="dark"] .hero__subtitle,
[data-theme="dark"] .hero__description {
  color: #f5f5f5;
}

[data-theme="dark"] .hero__title .highlight {
  color: #3b82f6;
}

[data-theme="dark"] .btn-primary {
  background: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
  background: #60a5fa;
}

[data-theme="dark"] .btn-secondary {
  background: #333333;
  color: #ffffff;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #555555;
}

[data-theme="dark"] .code-window {
  background: #1a1a1a;
}

[data-theme="dark"] .comment {
  color: #cccccc;
}

[data-theme="dark"] .keyword {
  color: #3b82f6;
}

[data-theme="dark"] .theme-toggle-btn {
  background: #333333;
  color: #ffffff;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: #555555;
}

[data-theme="dark"] .nav__list {
  background: #1a1a1a;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header Styles */
.header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 80px;
  border-radius: 10px;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.header__logo .logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.5px;
}

.header__nav {
  display: flex;
}

.nav__list {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  transition: all 0.3s ease;
}

.nav__link {
  text-decoration: none;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav__link:hover,
.nav__link:focus,
.nav__link.active {
  color: #2563eb;
}

.nav__link::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: #2563eb;
  transition: width 0.3s ease;
  position: absolute;
  bottom: -4px;
  left: 0;
}

.nav__link:hover::after,
.nav__link:focus::after,
.nav__link.active::after {
  width: 100%;
}

.header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger {
  width: 100%;
  height: 4px;
  background: #2563eb;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4rem 0;
  overflow: hidden;
}

.floating-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-element {
  position: absolute;
  background: #2563eb;
  opacity: 0.05;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.floating-element:nth-child(3) {
  width: 60px;
  height: 60px;
  bottom: 20%;
  left: 30%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

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

.hero__text {
  max-width: 500px;
}

.hero__subtitle {
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero__title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero__title .highlight {
  color: #2563eb;
}

.hero__description {
  color: #64748b;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.hero__cta {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-primary,
.btn-secondary {
  color: #fff;
}
.btn-primary {
  background: #2563eb;
}
.btn-secondary {
  background: #64748b;
}


.btn-primary:hover {
  background: #1e40af;
}

.btn-secondary:hover {
  background: #475569;
}

/* Code Window */
.hero__visual {
  perspective: 1000px;
}

.code-window {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transform: rotateY(5deg);
  transition: transform 0.3s ease-in-out;
}

.code-window:hover {
  transform: rotateY(-5deg);
}

.code-window__header {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.code-content {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-line {
  margin-bottom: 0.5rem;
}

.comment { color: #64748b; }
.keyword { color: #2563eb; }
.string { color: #16a34a; }

/* Filter Section */
.challenges-filter {
  background: #fff;
  padding: 1rem 0;
  border-radius: 10px;
  margin-top: 20px;
  margin-bottom: 4rem;
  margin-left:2rem;
  margin-right: 2rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.filter-group label {
  margin-bottom: 0.3rem;
}

.filter-select {
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  transition: border-color 0.3s ease;
}

.filter-select:focus {
  border-color: #2563eb;
}

.search-group {
  flex-grow: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: #2563eb;
}

/* Challenges Grid */
.challenges-grid {
  margin-bottom: 3rem;
}

.challenges-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Challenge Card */
.challenge-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.3s ease;
}

.challenge-card:focus-within,
.challenge-card:hover {
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.3);
  outline: none;
}

.challenge-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.challenge-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2563eb;
}

.difficulty-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.difficulty-easy {
  background: #34d399; /* Green */
}

.difficulty-medium {
  background: #fbbf24; /* Yellow */
}

.difficulty-hard {
  background: #ef4444; /* Red */
}

.challenge-card__description {
  flex-grow: 1;
  color: #64748b;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.4;
}

.challenge-card__meta {
  margin-bottom: 1rem;
}

.category-tag {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  text-transform: capitalize;
}

.challenge-card__actions {
  text-align: right;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* Content Section: Challenge Vault */
.content {
  max-width: 1024px;
  width: 100%;
  padding: 50px 4%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.card {
  width: 100%;
  max-width: 300px;
  min-width: 200px;
  height: 250px;
  background-color: #fff;
  margin: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
  border: 2px solid rgba(249, 15, 15, 0.12);
  font-size: 16px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  cursor: pointer;
  color: black;
  text-align: center;
}

[data-theme="dark"] .card {
  --background-color: #292929;
}

[data-theme="light"] .card {
  --background-color: #C9D9F6;
  color: #212121;
}

.challenge-vault-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0 24px 0;
}

.vault-card {
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(37,99,235,0.07), 0 1.5px 7px rgba(37,99,235,0.09);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  padding: 2rem 3rem;
  max-width: 510px;
  width: 100%;
  margin: 0 auto;
  transition: box-shadow 0.2s;
  border: 1.5px solid #e0e7ff;
}
.vault-card:hover {
  box-shadow: 0 12px 40px #2563eb35;
}

.vault-icon-circle {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2563eb12;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 34px;
}

.vault-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.vault-title {
  margin: 0 0 6px 0;
  font-size: 1.55rem;
  color: #2563eb;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.vault-desc {
  color: #334155;
  margin-bottom: 1.15rem;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 320px;
}

.vault-cta {
  font-size: 1rem;
  padding: 0.5rem 1.3rem;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.18s;
}
.vault-cta:hover,
.vault-cta:focus {
  background: #1e40af;
}

/* Responsive tweaks */
@media (max-width: 700px) {
  .vault-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    align-items: stretch;
    text-align: center;
  }
  .vault-icon-circle {
    margin: 0 auto 18px auto;
  }
  .vault-card-content {
    align-items: center;
  }
}

.icon {
  margin: 0 auto;
  width: 80px;
  height: 80px;
  background: linear-gradient(90deg, #93C5FD 0%, #3B82F6 40%, rgba(0, 0, 0, 0.28) 60%);
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  transition: all 0.8s ease;
  background-position: 0;
  background-size: 200px;
}

.material-icons.md-36 {
  font-size: 36px;
}

.card .title {
  margin-top: 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 1rem;
}

.card .text {
  width: 80%;
  margin: 20px auto 0;
  font-size: 13px;
  font-weight: 200;
  letter-spacing: 2px;
  opacity: 0;
  max-height: 0;
  transition: all 0.3s ease;
}

.card:hover {
  height: 270px;
}

.card:hover .text {
  opacity: 1;
  max-height: 40px;
}

.card:hover .icon {
  background-position: -120px;
}

.card:hover .icon i {
  background: linear-gradient(90deg, #93C5FD, #3B82F6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1;
}

/* Footer */
.footer {
  background: #ffffff;
  padding: 2rem 0;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #64748b;
}

.footer__content {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer__section h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #2563eb;
}

.footer__section ul {
  list-style: none;
}

.footer__section a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer__section a:hover,
.footer__section a:focus {
  color: #2563eb;
}

.footer__bottom p {
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Responsive Styles */

@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__cta {
    justify-content: center;
  }
  .hero__visual {
    margin: 0 auto;
    max-width: 400px;
  }
  .filter-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  .nav__list {
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  .nav__list {
    position: absolute;
    top: 60px;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    border-radius: 0 0 10px 10px;
  }
  [data-theme="dark"] .nav__list {
    background: #1a1a1a;
  }
  .nav__list.open {
    visibility: visible;
    opacity: 1;
    display: flex;
  }
  .nav__link {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
  }
  .header__toggle {
    display: flex;
  }
  .hero__title {
    font-size: 2.5rem;
  }
  .content {
    padding-top: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  .header__logo .logo-text {
    font-size: 1.4rem;
  }
  .hero__title {
    font-size: 2rem;
  }
  .hero .container {
    padding: 0 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .hero__content {
    text-align: center;
    justify-items: center;
  }
}

/* Utility: Visually Hidden for Accessibility */
.visually-hidden {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}


