/* Design System: AfriNet Hub */
:root {
  --primary: #0a1f44;
  --accent: #ff6b35;
  --gold: #ffc107;
  --white: #ffffff;
  --light-grey: #f4f7f6;
  --dark-grey: #333333;
  --error: #e63946;
  --success: #2a9d8f;
  --transition: all 0.3s ease;
  --container-width: 1200px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --primary: #050f22;
  --white: #1a1a1a;
  --light-grey: #242424;
  --dark-grey: #e0e0e0;
  --text-color: #ffffff;
  --bg-color: #0a1f44;
}

[data-theme="light"] {
  --text-color: #333333;
  --bg-color: #ffffff;
}

/* Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  background-image: url('../images/unilesa_background.png');
  background-size: 300px; /* Smaller background logo */
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  transition: var(--transition);
}

/* Add a semi-transparent overlay to ensure readability over the background image */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.945); /* Preserve a quiet university emblem without covering copy */
  z-index: -1;
  transition: var(--transition);
}

[data-theme="dark"] body::before {
  background: rgba(10, 31, 68, 0.95);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Typography */
h1, h2, h3 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 2rem;
}

/* Header & Navigation */
header {
  background-color: var(--primary);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  align-items: center;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: bold;
}

.powered-by {
  font-size: 0.8rem;
  opacity: 0.8;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo > span {
  font-size: 0.8rem;
  opacity: 0.8;
  display: block;
}

nav ul {
  display: flex;
  gap: 20px;
}

nav ul li a:hover {
  color: var(--accent);
}

#theme-toggle {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

/* Buttons */
.cta-button, .cta-button-secondary {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.cta-button {
  background-color: var(--accent);
  color: white;
}

.cta-button:hover {
  background-color: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255,107,53,0.3);
}

.cta-button-secondary {
  background-color: var(--gold);
  color: var(--primary);
}

.cta-button-secondary:hover {
  background-color: #e6ac00;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--primary) 0%, #1a3a6a 100%);
  color: white;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.5rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

.trust-signals {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.trust-signals span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

/* Order Guide Section */
.order-guide {
  padding: 80px 0;
  background-color: var(--light-grey);
  text-align: center;
}

.how-it-works-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 20px;
}

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

.step {
  padding: 30px;
  background: var(--white);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto 20px;
}

/* Services Section */
.services {
  padding: 80px 0;
  text-align: center;
}

.service-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.service-item {
  padding: 40px;
  border: 2px solid var(--light-grey);
  border-radius: 20px;
}

.service-item h3 {
  color: var(--primary);
}

/* Portal & Gadgets CTAs */
.portal-services-cta, .gadgets-cta {
  padding: 60px 0;
}

.card {
  background: var(--primary);
  color: white;
  padding: 60px;
  border-radius: 30px;
  text-align: center;
}

.card h2 {
  font-size: 2.5rem;
}

.card p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Form Styles */
.order-form-section, .portal-form-section {
  padding: 80px 0;
}

.order-form, .portal-form {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: bold;
  margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 12px;
  border: 2px solid var(--light-grey);
  border-radius: 10px;
  font-size: 1rem;
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

.price-calculator {
  background: var(--light-grey);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
}

#price-display {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: bold;
}

/* Checkout Page */
.order-summary {
  background: var(--light-grey);
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 40px;
}

.order-summary .total {
  font-size: 1.4rem;
  color: var(--accent);
  border-top: 2px solid #ddd;
  margin-top: 15px;
  padding-top: 15px;
}

.payment-details {
  text-align: center;
}

.account-info {
  background: var(--white);
  border: 2px dashed var(--accent);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0 30px;
  display: inline-block;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: var(--white);
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Legal & About Pages */
.legal-page, .about-page {
  padding: 80px 0;
}

.legal-page section {
  margin-bottom: 40px;
}

.last-updated {
  font-style: italic;
  margin-bottom: 30px;
  color: #666;
}

.about-hero {
  background: var(--primary);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.about-content .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-top: 60px;
}

.uni-link {
  display: block;
  padding: 15px;
  background: var(--light-grey);
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  color: var(--primary);
}

/* Footer */
footer {
  background-color: var(--primary);
  color: white;
  padding: 60px 0;
  margin-top: 80px;
}

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

.footer-section h4 {
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.footer-section a {
  display: block;
  margin-bottom: 10px;
  opacity: 0.8;
  font-size: 0.95rem;
}

.footer-section a:hover {
  opacity: 1;
  color: var(--accent);
  text-decoration: none;
}

.footer-section p {
  opacity: 0.8;
  margin-bottom: 15px;
}

/* Announcements Ticker */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background-color: var(--accent);
  color: white;
  padding: 10px 0;
  white-space: nowrap;
  position: relative;
  z-index: 1001;
}

.ticker {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
}

.ticker:hover {
  animation-play-state: paused;
}

.ticker__item {
  display: inline-block;
  padding: 0 2rem;
  font-weight: bold;
}

.ticker__item a {
  text-decoration: underline;
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Ad Banners */
.ad-banner {
  margin: 40px auto;
  padding: 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ad-content {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
}

.ad-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 21 / 9;
}

.ad-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
}

/* News & Partners Pages */
.page-header {
  text-align: center;
  padding: 60px 0 40px;
}

.news-list {
  display: grid;
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.news-item {
  padding: 30px;
  background: var(--white);
}

.news-date {
  color: var(--accent);
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.cta-button-small {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: white;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-top: 15px;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.partner-card {
  text-align: center;
  padding: 40px;
}

.partner-logo {
  height: 80px;
  width: auto;
  max-width: 100%;
  margin-bottom: 20px;
  object-fit: contain;
}

/* Advertise With Us */
.advertise-with-us {
  text-align: center;
  margin: 60px auto;
}

.feedback-section {
  text-align: center;
  margin: 60px auto;
}

.feedback-section .form-card {
  max-width: 760px;
}

.form-card {
  max-width: 600px;
  margin: 30px auto;
  padding: 40px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  text-align: left;
}

/* Utils */
.loading, .empty-state {
  text-align: center;
  padding: 50px;
  color: #666;
}

/* Active Nav Link */
nav ul li a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1.1rem; }
  .form-grid, .about-content .grid { grid-template-columns: 1fr; }
  header .container { flex-direction: column; gap: 15px; }
}

/* PWA Install Prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 20px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.install-prompt button {
  padding: 8px 15px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

#install-button { background: var(--accent); color: white; }
#close-install-prompt { background: transparent; color: white; }
