/* Programming Club - Modern Dark Mode Styles */

:root {
  --primary-color: #00d4ff;
  --secondary-color: #7c3aed;
  --bg-dark: #0a0a0f;
  --bg-card: #1a1a2e;
  --bg-card-hover: #252540;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 212, 255, 0.2);
  --nav-bg: rgba(10, 10, 15, 0.95);
  --nav-bg-mobile: rgba(10, 10, 15, 0.98);
  --border-subtle: rgba(0, 212, 255, 0.1);
  --border-strong: rgba(0, 212, 255, 0.3);
  --tag-bg: rgba(0, 212, 255, 0.1);
  --footer-bg: #12121f;
}

/* Light theme overrides */
[data-theme="light"] {
  --primary-color: #0284c7;
  --secondary-color: #7c3aed;
  --bg-dark: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f6fb;
  --text-primary: #0f172a;
  --text-secondary: #52607a;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
  --shadow: 0 4px 20px rgba(2, 132, 199, 0.12);
  --shadow-hover: 0 8px 30px rgba(2, 132, 199, 0.2);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --nav-bg-mobile: rgba(255, 255, 255, 0.98);
  --border-subtle: rgba(2, 132, 199, 0.18);
  --border-strong: rgba(2, 132, 199, 0.35);
  --tag-bg: rgba(2, 132, 199, 0.1);
  --footer-bg: #e4eaf2;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  animation: fadeIn 0.5s ease-in;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  padding: 1rem 5%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

nav .logo .logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

nav .logo span {
  font-size: 1.4rem;
  font-weight: bold;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav .logo:hover,
nav .logo:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Right-hand nav group: links + social + controls */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-icon:hover,
.nav-icon:focus {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

nav a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
}

nav a:hover,
nav a:focus {
  color: var(--primary-color);
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
  animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInDown 1s ease-out;
}

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

.hero p {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-gradient);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  animation: fadeInUp 1s ease-out 0.6s both;
}

.btn:hover,
.btn:focus {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

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

.btn-outline:hover,
.btn-outline:focus {
  background: var(--primary-color);
  color: var(--bg-dark);
}

/* Sections */
section {
  padding: 5rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 2rem;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-subtle);
}

.card:hover,
.card:focus-within {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
  border-color: var(--primary-color);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

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

.card .date {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: bold;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--tag-bg);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-strong);
}

/* Team Section */
.team-photo {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 3rem;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.team-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.member-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.member-card:hover::before,
.member-card:focus-within::before {
  opacity: 0.1;
}

.member-card:hover,
.member-card:focus-within {
  transform: translateY(-10px) scale(1.05);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.member-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.member-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.member-card .role {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.member-card .bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s;
  border: 1px solid var(--border-strong);
}

.social-link:hover,
.social-link:focus {
  background: var(--primary-color);
  color: var(--bg-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* Contact Form */
.contact-info {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 3rem;
  box-shadow: var(--shadow);
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-info a:hover,
.contact-info a:focus {
  color: var(--text-primary);
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Footer */
footer {
  background: var(--footer-bg);
  padding: 3.5rem 5% 2rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border-strong);
}

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

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
  text-align: left;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.footer-logo-separator {
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: 300;
  margin: 0 0.5rem;
}

/* CCSG logo swaps with theme */
.ccsg-light { display: none; }
.ccsg-dark { display: inline-block; }
[data-theme="light"] .ccsg-light { display: inline-block; }
[data-theme="light"] .ccsg-dark { display: none; }

.footer-about {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-heading {
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--primary-color);
}

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

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

.footer-email a {
  color: var(--primary-color);
  text-decoration: none;
  word-break: break-word;
}

.footer-email a:hover,
.footer-email a:focus {
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logos,
  .footer-social {
    justify-content: center;
  }

  .footer-about {
    margin: 0 auto;
  }

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

/* Responsive Design */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--nav-bg-mobile);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

  section {
    padding: 3rem 5%;
  }

  section h2 {
    font-size: 2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

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

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  section h2 {
    font-size: 1.8rem;
  }
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Hero logo */
.hero-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  animation: fadeInDown 1s ease-out;
  filter: drop-shadow(0 6px 24px rgba(0, 212, 255, 0.25));
}

/* Layout helpers */
.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-spacer {
  height: 80px;
}

.section-intro {
  text-align: center;
  color: var(--text-secondary);
  max-width: 800px;
  margin: -1rem auto 3rem;
}

/* Legal pages (terms / privacy) */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-secondary);
}

.legal-content p {
  margin-bottom: 1.25rem;
}

.legal-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.legal-content a:hover,
.legal-content a:focus {
  text-decoration: underline;
}

.card-link {
  margin-top: 1rem;
  margin-bottom: 0;
}

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

.card-link a:hover,
.card-link a:focus {
  text-decoration: underline;
}

/* Featured card emphasis */
.feature-card {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-hover);
}

/* Group headings within a section */
.group-heading {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 3rem 0 1.5rem;
  text-align: center;
}

.group-note {
  text-align: center;
  color: var(--text-secondary);
  max-width: 700px;
  margin: -0.75rem auto 2rem;
  font-size: 0.95rem;
}

/* Project status labels */
.status-line {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.status-planned {
  color: var(--primary-color);
}

.status-progress {
  color: #fbbf24;
}

/* Contact page helpers */
.accent-heading {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.accent-heading.centered {
  text-align: center;
  margin-bottom: 2rem;
}

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

.social-section {
  margin: 3rem 0;
}

/* Call-to-action box */
.cta-box {
  text-align: center;
  background: var(--bg-card);
  padding: 4rem 2rem;
  border-radius: 20px;
  margin-top: 3rem;
}

.cta-box h2 {
  margin-bottom: 1rem;
}

.cta-inline {
  margin-top: 4rem;
  padding: 3rem 2rem;
}

.cta-heading {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.cta-text {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Footer subtext */
.footer-sub {
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  nav .logo span {
    font-size: 1.15rem;
  }

  .hero-logo {
    width: 84px;
    height: 84px;
  }
}
