/* ===========================================
   World Energy Management Center - Styles
   IEA-inspired Full Redesign
   =========================================== */

/* ===========================================
   CSS Variables - IEA Color Scheme
   =========================================== */
:root {
  /* Primary Colors */
  --primary: #0055A5;
  --primary-dark: #003D7A;
  --primary-light: #0066CC;

  /* Accent Colors */
  --accent: #E65100;
  --accent-light: #F57C00;
  --accent-hover: #FB8C00;

  /* Neutral Colors */
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* Text Colors */
  --text-primary: #212121;
  --text-secondary: #616161;
  --text-muted: #9E9E9E;
  --text-inverse: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;

  /* Spacing */
  --nav-height: 64px;
  --container-max: 1280px;
}

/* ===========================================
   Global Reset & Base Styles
   =========================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================================
   Navigation - Frosted Glass Style
   =========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: transparent;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: none;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
}

.navbar.scrolled .logo-text,
.navbar.scrolled .nav-item a,
.navbar.scrolled .lang-switch {
  color: var(--text-primary);
  border-color: var(--gray-300);
}

.navbar.scrolled .logo-sub {
  color: var(--text-secondary);
}

.navbar.scrolled .mobile-menu-btn span {
  background-color: var(--text-primary);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item a {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  border-radius: 4px;
  transition: all var(--transition-fast);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-item a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Language button in nav-links */
.nav-item-lang {
  margin-left: 8px;
}

.nav-item-lang .lang-switch {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Language Switch */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all var(--transition-fast);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lang-switch:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1002;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--white);
  margin: 3px 0;
  transition: all var(--transition-fast);
}

.mobile-nav-overlay {
  display: none;
}

/* ===========================================
   Hero Section - World Energy Style with Background Image
   =========================================== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
}

.hero-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-bg-img:nth-child(1) {
  background-image: url('images/wind-power.jpeg');
  animation: heroFade1 12s ease-in-out infinite;
}

.hero-bg-img:nth-child(2) {
  background-image: url('images/city.jpeg');
  animation: heroFade2 12s ease-in-out infinite;
}

/* Image 1: visible 0-50%, invisible 50-100% */
@keyframes heroFade1 {
  0%, 45% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  95%, 100% {
    opacity: 1;
  }
}

/* Image 2: invisible 0-50%, visible 50-100% */
@keyframes heroFade2 {
  0%, 45% {
    opacity: 0;
  }
  50%, 95% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 55, 100, 0.85) 0%,
    rgba(0, 85, 165, 0.75) 50%,
    rgba(0, 102, 204, 0.7) 100%
  );
  z-index: -1;
}

.hero-content {
  text-align: center;
  padding: 0 24px;
  max-width: 1000px;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.hero-subtitle:empty {
  display: none;
}

.hero-description {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  padding: 16px 40px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--white);
  border-radius: 4px;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background-color: var(--gray-50);
}

/* ===========================================
   Section Base Styles
   =========================================== */
.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ===========================================
   About Section - IEA Style
   =========================================== */
.about-section {
  padding: 80px 0;
  background-color: var(--gray-50);
}

.about-header {
  text-align: center;
  margin-bottom: 40px;
}

.about-content {
  max-width: 800px;
  margin: 0 auto 60px;
}

.about-text p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: center;
}

/* Feature Items */
.about-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.feature-item {
  text-align: center;
  padding: 24px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--primary);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===========================================
   Business Section - IEA Topics Style
   =========================================== */
.business-section {
  padding: 80px 0;
  background-color: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

/* Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.topic-card {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
}

.topic-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.topic-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.topic-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.topic-card:hover .topic-img {
  transform: scale(1.05);
}

.topic-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-content {
  padding: 20px;
}

.topic-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.topic-card:hover .topic-content h3 {
  color: var(--primary);
}

.topic-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================================
   Vision Section - IEA Mission Style
   =========================================== */
.vision-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--text-inverse);
}

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

.vision-intro {
  text-align: center;
  margin-bottom: 48px;
}

.vision-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.vision-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Values Section */
.values-section {
  margin-bottom: 48px;
}

.values-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-align: center;
  margin-bottom: 24px;
}

.values-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.value-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
}

.value-card:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
}

.value-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.value-label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Mission Section */
.mission-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}

.mission-text {
  font-size: 1.1rem;
  line-height: 1.9;
  opacity: 0.95;
  text-align: justify;
}

/* ===========================================
   Footer - IEA Multi-column Style
   =========================================== */
.footer {
  background-color: var(--gray-900);
  color: var(--text-inverse);
  padding: 60px 0 0;
}

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

.footer-main {
  display: flex;
  justify-content: space-between;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer Brand */
.footer-brand {
  max-width: 280px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Footer Navigation */
.footer-nav {
  display: flex;
  gap: 80px;
}

.footer-column h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.footer-column ul li {
  margin-bottom: 12px;
}

.footer-column ul li a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
  color: var(--accent);
}

/* Footer Bottom */
.footer-bottom {
  padding: 24px 0;
}

.footer-legal {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   Responsive Styles
   =========================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .energy-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer-nav {
    gap: 48px;
  }
}

/* Mobile (<768px) */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  /* Mobile Navigation */
  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 24px;
    gap: 0;
    transition: left var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-xl);
  }

  .mobile-menu-toggle:checked ~ .mobile-nav-overlay {
    display: block;
  }

  .nav-container:has(.mobile-menu-toggle:checked) .nav-links {
    left: 0;
  }

  .nav-container:has(.mobile-menu-toggle:checked) .mobile-nav-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .nav-item a {
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 1rem;
    color: var(--text-primary);
    text-shadow: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-container:has(.mobile-menu-toggle:checked) .mobile-menu-btn span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-container:has(.mobile-menu-toggle:checked) .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
  }

  .nav-container:has(.mobile-menu-toggle:checked) .mobile-menu-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .nav-item-lang {
    margin-left: 0;
    margin-top: 16px;
  }

  .lang-switch {
    display: block;
    padding: 14px 24px;
    color: var(--text-primary);
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    text-shadow: none;
    text-align: center;
    font-size: 0.9rem;
    border-radius: 4px;
  }

  /* Hero */
  .hero-section {
    min-height: 70vh;
    padding-top: var(--nav-height);
  }

  .hero-title {
    font-size: 2rem;
  }

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

  .hero-description {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .hero-cta {
    padding: 12px 28px;
    font-size: 0.9rem;
  }

  /* About */
  .about-section {
    padding: 60px 0;
  }

  .about-features {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .feature-item {
    padding: 16px;
  }

  /* Business */
  .business-section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Vision */
  .vision-section {
    padding: 60px 0;
  }

  .vision-title {
    font-size: 1.5rem;
  }

  .values-grid {
    gap: 12px;
  }

  .value-card {
    padding: 16px 20px;
    flex: 1 1 calc(33.333% - 8px);
    min-width: 80px;
  }

  .value-icon {
    font-size: 1.5rem;
  }

  .value-label {
    font-size: 0.85rem;
  }

  .mission-section {
    padding: 20px;
  }

  .mission-text {
    font-size: 1rem;
    text-align: left;
  }

  /* Footer */
  .footer {
    padding: 40px 0 0;
  }

  .footer-main {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    max-width: none;
  }

  .footer-nav {
    flex-direction: column;
    gap: 24px;
  }

  .footer-column h4 {
    margin-bottom: 12px;
  }

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-divider {
    display: none;
  }
}

/* Small Mobile (<480px) */
@media (max-width: 480px) {
  .about-features {
    grid-template-columns: 1fr;
  }

  .value-card {
    flex: 1 1 calc(50% - 6px);
  }
}

/* ===========================================
   Animation Classes
   =========================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}
