/* ==================== CSS Variables ==================== */
:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --secondary: #e53e3e;
  --accent: #38a169;
  --bg-dark: #0f172a;
  --bg-light: #f7fafc;
  --text-dark: #1a202c;
  --text-light: #718096;
  --white: #ffffff;
  --gradient-hero: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #38a169 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

/* ==================== Navigation ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  padding: 0 2rem;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-dark);
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--secondary);
}

.nav-links a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==================== Hero Section ==================== */
.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 100px 2rem 60px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.3);
  animation: fadeInDown 0.8s ease;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero h1 span {
  color: #68d391;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #68d391;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ==================== Section Styles ==================== */
.section {
  padding: 100px 2rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--primary);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--secondary);
  border-radius: 2px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 1.5rem auto 0;
}

/* ==================== Company Cards Grid ==================== */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.company-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.company-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-hero);
  transform: scaleX(0);
  transition: var(--transition);
}

.company-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.company-card:hover::before {
  transform: scaleX(1);
}

.card-rank {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 45px;
  height: 45px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 1;
}

.card-header {
  height: 140px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.card-logo {
  width: 100px;
  height: 100px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.card-body {
  padding: 1.5rem;
}

.card-body h3 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.card-country {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.card-stat {
  text-align: center;
}

.card-stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.card-stat .label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.tag {
  font-size: 0.7rem;
  padding: 4px 10px;
  background: var(--primary);
  color: var(--white);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag.hot { background: var(--secondary); }
.tag.new { background: var(--accent); }

.card-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.card-link:hover {
  color: var(--secondary);
  gap: 10px;
}

/* ==================== Company Detail Page ==================== */
.detail-hero {
  min-height: 60vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 2rem 60px;
  text-align: center;
  color: var(--white);
  position: relative;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.detail-content {
  position: relative;
  z-index: 1;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--white);
  gap: 12px;
}

.detail-rank {
  width: 70px;
  height: 70px;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.detail-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail-hero .subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.detail-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-badge {
  background: rgba(255,255,255,0.2);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.3);
}

/* ==================== Stats Cards ==================== */
.stats-section {
  margin-top: -60px;
  position: relative;
  z-index: 10;
  padding: 0 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.stat-card .icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--white);
  font-size: 1.3rem;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.stat-card .label {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ==================== Content Sections ==================== */
.content-section {
  padding: 80px 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.info-card h3 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card h3 svg {
  width: 24px;
  height: 24px;
  color: var(--secondary);
}

.info-card p {
  color: var(--text-light);
  line-height: 1.8;
}

.feature-list {
  margin-top: 1rem;
}

.feature-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-dark);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ==================== Progress Bars ==================== */
.progress-section {
  margin-top: 3rem;
}

.progress-item {
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-weight: 600;
  color: var(--text-dark);
}

.progress-value {
  color: var(--text-light);
}

.progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-hero);
  border-radius: 5px;
  transition: width 1s ease;
}

/* ==================== Timeline ==================== */
.timeline-section {
  background: var(--bg-light);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: var(--primary);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
  padding-right: 3rem;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-right: 0;
  padding-left: 3rem;
}

.timeline-dot {
  position: absolute;
  right: -10px;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--secondary);
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: var(--shadow-sm);
}

.timeline-item:nth-child(even) .timeline-dot {
  right: auto;
  left: -10px;
}

.timeline-content {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.timeline-year {
  color: var(--secondary);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.timeline-content h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==================== Footer ==================== */
.footer {
  background: var(--bg-dark);
  color: var(--white);
  padding: 60px 2rem 30px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer h4 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #68d391;
}

.footer p, .footer a {
  color: rgba(255,255,255,0.7);
  line-height: 2;
}

.footer a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

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

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

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

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

.animate-fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* ==================== Scroll to Top ==================== */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--secondary);
  transform: translateY(-5px);
}

/* ==================== Responsive ==================== */
@media (max-width: 992px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    padding-left: 50px;
    padding-right: 0;
    margin-left: 0;
  }

  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 10px;
    right: auto;
  }
}

@media (max-width: 768px) {
  .hero-stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .section {
    padding: 60px 1rem;
  }

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

  .card-stats {
    grid-template-columns: 1fr;
  }

  .stats-section {
    margin-top: -40px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 1rem;
  }

  .hero {
    padding: 100px 1rem 40px;
  }

  .detail-hero {
    padding: 100px 1rem 40px;
  }

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

  .detail-badges {
    flex-direction: column;
    align-items: center;
  }
}
