/* SGX ESG Portal - Base Styles */

/* Ensure Lato font loads properly */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,400&display=swap');

/* SGX Design System - Exact colors from original specification */
:root {
  /* SGX Official Colors */
  --sgx-green: #4CAF50;       /* Primary SGX green */
  --sgx-blue: #0094b3;        /* SGX blue */
  --sgx-navy: #0c236b;        /* SGX navy/dark blue */
  --sgx-yellow: #FFD700;      /* SGX accent yellow */
  --sgx-success: #a4de36;     /* Success green */
  --sgx-warning: #ff9800;      /* Warning orange */
  --sgx-error: #f44336;        /* Error red */
  
  /* Chart Color Palette - 10 colors that work with SGX branding */
  --chart-color-1: #4CAF50;    /* SGX Green */
  --chart-color-2: #0094b3;    /* SGX Blue */
  --chart-color-3: #0c236b;    /* SGX Navy */
  --chart-color-4: #a4de36;    /* Light Green */
  --chart-color-5: #2196F3;    /* Bright Blue */
  --chart-color-6: #607D8B;    /* Blue Grey */
  --chart-color-7: #795548;    /* Brown */
  --chart-color-8: #9C27B0;    /* Purple */
  --chart-color-9: #FF9800;    /* Orange */
  --chart-color-10: #E91E63;   /* Pink */
  
  /* Gray scale */
  --gray-50: #fafafa;
  --gray-200: #e0e0e0;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  
  /* Text colors */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  
  /* Layout colors */
  --bg-light: #f8f9fa;
  --border-color: #e1e5e9;
  --white: #ffffff;
  
  /* Typography - Lato font family like SGX */
  --font-primary: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  
  /* Spacing system */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Shadows - subtle and professional */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--white);
  font-size: var(--font-size-base);
  margin: 0;
  padding: 0;
}

/* Typography - matching SGX style */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  color: var(--sgx-navy);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 { 
  font-size: 2.25rem; 
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
}
h2 { 
  font-size: 1.875rem; 
  margin-bottom: var(--spacing-md);
}
h3 { 
  font-size: 1.5rem; 
  margin-bottom: var(--spacing-md);
}
h4 { 
  font-size: var(--font-size-xl); 
  margin-bottom: var(--spacing-sm);
}
h5 { 
  font-size: var(--font-size-lg); 
  margin-bottom: var(--spacing-sm);
}
h6 { 
  font-size: var(--font-size-base); 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Links */
a {
  color: var(--sgx-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--sgx-navy);
  text-decoration: underline;
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.grid-2 { 
  grid-template-columns: repeat(2, 1fr); 
  gap: 2rem;
}
.grid-3 { 
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.5rem;
}
.grid-4 { 
  grid-template-columns: repeat(4, 1fr); 
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Cards - SGX style with better spacing */
.card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ULTIMATE NUCLEAR OPTION - KILL ALL TRANSFORMS AND TRANSITIONS */
* {
  transition: none !important;
  transform: none !important;
}

*:hover {
  transform: none !important;
}

.card,
.card.no-hover,
.card.text-center,
div.card,
section .card,
main .card {
  transition: none !important;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
  border-color: var(--border-color) !important;
}

.card:hover,
.card.no-hover:hover,
.card.text-center:hover,
div.card:hover,
section .card:hover,
main .card:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
  border-color: var(--border-color) !important;
  transform: none !important;
  transition: none !important;
}

/* ONLY enable hover for index page navigation cards */
.view-card {
  transition: all 0.2s ease !important;
  transform: none !important;
}

.view-card:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
  border-color: var(--sgx-blue) !important;
  transform: translateY(-2px) !important;
  transition: all 0.2s ease !important;
}

/* ALSO enable hover for ESG Framework cards */
.interactive-card {
  transition: all 0.2s ease !important;
  transform: none !important;
  cursor: pointer !important;
}

.interactive-card:hover {
  box-shadow: 0 8px 16px rgba(76, 175, 80, 0.2) !important;
  border-color: var(--sgx-green) !important;
  transform: translateY(-3px) !important;
  transition: all 0.2s ease !important;
  background-color: rgba(76, 175, 80, 0.02) !important;
}

.card h3 {
  color: var(--sgx-navy);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

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

.card-header {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sgx-navy);
}

/* Grade badges (shared across views) */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
  min-width: 2.5rem;
}

.grade-a, .grade-aplus, .grade-aminus { background: var(--sgx-success); color: #fff; }
.grade-b, .grade-bplus, .grade-bminus { background: var(--sgx-blue); color: #fff; }
.grade-c, .grade-cplus, .grade-cminus { background: var(--sgx-warning); color: #fff; }
.grade-d, .grade-dplus, .grade-dminus { background: var(--sgx-error); color: #fff; }
.grade-f { background: var(--gray-700); color: #fff; }

/* Buttons - professional and clean */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--sgx-green);
  color: white;
  border: 1px solid var(--sgx-green);
}

.btn-primary:hover {
  background-color: var(--sgx-success);
  border-color: var(--sgx-success);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--gray-600);
  color: white;
  border-color: var(--gray-600);
}

.btn-secondary:hover {
  background-color: var(--gray-700);
  color: white;
  text-decoration: none;
  border-color: var(--gray-700);
}

.btn-outline {
  background-color: transparent;
  color: var(--sgx-navy);
  border: 1px solid var(--sgx-navy);
}

.btn-outline:hover {
  background-color: var(--sgx-navy);
  color: white;
  text-decoration: none;
}

/* Score Displays */
.score-display {
  text-align: center;
  padding: 1rem;
}

.score-number {
  font-size: 3rem;
  font-weight: 700;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin-bottom: 0.5rem;
}

.score-excellent { color: var(--text-primary); }
.score-good { color: var(--text-primary); }
.score-fair { color: var(--sgx-yellow); }
.score-poor { color: var(--sgx-warning); }
.score-very-poor { color: var(--sgx-error); }

.score-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

/* Progress Bars */
.progress {
  width: 100%;
  height: 8px;
  background-color: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  transition: width 0.5s ease;
}

.progress-bar.excellent { background-color: var(--sgx-success); }
.progress-bar.good { background-color: var(--sgx-green); }
.progress-bar.fair { background-color: var(--sgx-yellow); }
.progress-bar.poor { background-color: var(--sgx-warning); }
.progress-bar.very-poor { background-color: var(--sgx-error); }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background-color: var(--gray-50);
  font-weight: 600;
  color: var(--sgx-navy);
}

.table tr:hover {
  background-color: var(--gray-50);
}

/* Navigation - SGX style white header */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  position: relative;
  z-index: 1000;
}

.nav-brand {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--sgx-navy);
  text-decoration: none;
  display: flex;
  align-items: center;
}

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

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--sgx-navy);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--gray-700);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--sgx-green);
}

/* Hero Section - SGX navy to blue gradient */
.hero {
  background: linear-gradient(135deg, var(--sgx-navy) 0%, var(--sgx-blue) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  margin-bottom: 3rem;
}

.hero h1 {
  color: white;
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.hero p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Section spacing */
.section {
  margin-bottom: 3rem;
}

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  color: var(--sgx-navy);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Sub-component indicators positioning */
.sub-component-indicators {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.sub-component-performance {
  color: var(--sgx-warning);
  font-size: 0.9rem;
}