/**
 * ============================================================================
 * COCONUT COMPUTER CLUB - BASE THEME & GLOBAL LAYOUT CSS
 * Modular stylesheet for base.html, Navbar, Footer, and Utilities
 * Preserves 100% of exact design, hover states, layout, and animations.
 * ============================================================================
 */

:root {
  --primary: #243B77;
  --primary-dark: #16254c;
  --primary-hover: #1c2f61;
  --accent: #4d82f3;
  --accent-light: #60a5fa;
  --surface-tint: #f0f4fa;
  --white-text: #FFFFFF;
  --font-poppins: 'Poppins', sans-serif;
  --font-inter: 'Inter', sans-serif;
  --header-offset: 80px; 
  --header-height: 80px; 
}

body {
  font-family: var(--font-inter);
  color: #1f2937;
  background-color: #F6F8FA;
  margin: 0;
}

/* ============================================================================
 * Global Typography Hierarchy (Inter for body/data/UI, Poppins for Headings/CTA)
 * ============================================================================ */
body,
p,
span,
li,
a,
input,
select,
textarea,
label,
table,
td,
th,
small,
.lead,
.card-text,
.form-text,
.form-control,
.form-select,
.invalid-feedback,
.valid-feedback,
.copyright {
  font-family: var(--font-inter);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-poppins);
}

.btn,
button,
.nav-link {
  font-family: var(--font-poppins);
}

/* ============================================================================
 * Header & Navbar
 * ============================================================================ */
#header {
  background: linear-gradient(90deg, rgba(36, 59, 119, 0.96), rgba(28, 47, 97, 0.94));
  color: var(--white-text);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(22, 37, 76, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}

#header:hover {
  box-shadow: 0 6px 24px rgba(22, 37, 76, 0.25);
  background: linear-gradient(90deg, rgba(36, 59, 119, 0.98), rgba(28, 47, 97, 0.96));
}

#header.scrolled {
  background: linear-gradient(90deg, rgba(36, 59, 119, 1), rgba(28, 47, 97, 1));
  box-shadow: 0 4px 20px rgba(22, 37, 76, 0.28);
  transform: translateY(0);
}

#header .logo img {
  max-height: 50px;
  transition: transform 0.3s ease;
}

#header .logo img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.navbar {
  display: flex;
  align-items: center;
}

.navbar ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.navbar a {
  color: var(--white-text);
  text-decoration: none;
  font-family: var(--font-poppins);
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.navbar a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #93c5fd);
  transition: width 0.3s ease;
}

.navbar a:hover::before {
  width: 100%;
}

.navbar a:hover {
  color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.navbar a.active {
  color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.mobile-nav-toggle {
  color: var(--white-text);
  font-size: 28px;
  display: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px;
  border-radius: 4px;
  margin-left: 1rem;
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.mobile-nav-toggle.active {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Mobile Navigation Drawer */
.navbar-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: -100%;
  width: 70%;
  height: 100vh;
  background: rgba(30, 64, 175, 0.95);
  transition: right 0.36s ease, opacity 0.36s ease;
  z-index: 999;
  backdrop-filter: blur(15px);
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  padding-top: 1rem;
  opacity: 0;
  pointer-events: none;
}

.navbar-mobile.active {
  right: 0;
  opacity: 1;
  pointer-events: auto;
}

.navbar-mobile ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.navbar-mobile li {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-mobile li:last-child {
  border-bottom: none;
}

.navbar-mobile a {
  display: block;
  padding: 1rem 2rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-poppins);
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  border-radius: 0;
}

.navbar-mobile a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  padding-left: 2.5rem;
}

@media (max-width: 991px) {
  .navbar ul {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-block;
  }
  .navbar-mobile {
    display: flex;
  }
}

/* ============================================================================
 * Main Content Container
 * ============================================================================ */
#main {
  padding-top: var(--header-offset);
  padding-bottom: 100px;
}

/* ============================================================================
 * Footer
 * ============================================================================ */
#footer {
  background: linear-gradient(180deg, #243B77 0%, #16254c 100%);
  color: var(--white-text);
  font-family: var(--font-inter);
  padding: 2.5rem 0 2rem;
  position: relative;
  min-height: 240px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#footer .container {
  max-width: 1200px;
  padding: 1rem;
}

#footer .background-decoration {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  display: none;
}

@media (min-width: 576px) {
  #footer .background-decoration {
    display: block;
  }
}

#footer .background-decoration svg {
  position: absolute;
}

#footer .background-decoration .top-line {
  top: 20px;
  right: 40px;
  width: 150px;
  height: 80px;
}

#footer .background-decoration .bottom-line {
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 100px;
}

#footer .mobile-decoration {
  position: absolute;
  inset: 0;
  opacity: 0.05;
}

@media (min-width: 576px) {
  #footer .mobile-decoration {
    display: none;
  }
}

#footer .mobile-decoration .circle-top {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--white-text);
  border-radius: 50%;
}

#footer .mobile-decoration .circle-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--white-text);
  border-radius: 50%;
}

/* Menu Section */
#footer .menu-section {
  margin-bottom: 1.5rem;
}

#footer .menu-section h3 {
  font-family: var(--font-poppins);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--white-text);
  text-align: center;
}

@media (min-width: 768px) {
  #footer .menu-section h3 {
    text-align: left;
  }
}

#footer .menu-section .desktop-menu {
  display: none;
  gap: 1rem;
}

@media (min-width: 576px) {
  #footer .menu-section .desktop-menu {
    display: flex;
  }
}

#footer .menu-section .desktop-menu a {
  color: var(--white-text);
  font-size: 0.875rem;
  text-decoration: none;
  font-family: var(--font-inter);
  transition: color 0.3s ease;
}

#footer .menu-section .desktop-menu a:hover {
  color: var(--accent);
}

#footer .menu-section .mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 576px) {
  #footer .menu-section .mobile-menu {
    display: none;
  }
}

#footer .menu-section .mobile-menu a {
  color: var(--white-text);
  font-size: 0.75rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.3s ease;
}

#footer .menu-section .mobile-menu a:hover {
  color: var(--accent);
}

/* Contact Section */
#footer .contact-section {
  margin-bottom: 1.5rem;
}

#footer .contact-section h3 {
  font-family: var(--font-poppins);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--white-text);
  text-align: center;
}

@media (min-width: 768px) {
  #footer .contact-section h3 {
    text-align: left;
  }
}

#footer .contact-section .contact-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 576px) {
  #footer .contact-section .contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

#footer .contact-section .contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

#footer .contact-section .contact-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

#footer .contact-section .contact-item i {
  color: var(--accent);
  font-size: 1rem;
  min-width: 20px;
}

#footer .contact-section .contact-item a {
  color: var(--white-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-family: var(--font-inter);
  transition: color 0.3s ease;
}

#footer .contact-section .contact-item a:hover {
  color: var(--accent);
}

/* Bottom Section & Copyright */
#footer .bottom-section {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
}

#footer .bottom-section .bottom-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

@media (min-width: 768px) {
  #footer .bottom-section .bottom-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

#footer .bottom-section .copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  text-align: center;
  margin: 0;
}

@media (min-width: 768px) {
  #footer .bottom-section .copyright {
    text-align: left;
  }
}

#footer .bottom-section .copyright a {
  color: var(--accent);
  text-decoration: none;
}

#footer .bottom-section .copyright a:hover {
  color: var(--primary);
}

/* Scroll top button */
.scroll-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white-text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 990;
  text-decoration: none;
  transition: all 0.3s ease;
}

.scroll-top:hover {
  background: var(--primary);
  color: var(--white-text);
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #F6F8FA;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preloader::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--primary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
