/* ============================================================================
   BLOCKCHAIN NEWS VIETNAM - MASTER STYLESHEET
   ============================================================================ */

:root {
  /* Color Palette */
  --primary-red: #C41E3A;
  --primary-white: #FFFFFF;
  --dark-bg: #0F1419;
  --dark-card: #1A1F2E;
  --light-bg: #F5F7FA;
  --light-card: #FFFFFF;
  --text-dark: #1A1F2E;
  --text-light: #F5F7FA;
  --text-gray: #6B7280;
  --border-color: #E5E7EB;
  --dark-border: #2D3748;
  --accent-blue: #0EA5E9;
  --accent-green: #10B981;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;

  /* Mode: Light (default) */
  --current-bg: var(--light-bg);
  --current-card-bg: var(--light-card);
  --current-text: var(--text-dark);
  --current-text-muted: var(--text-gray);
  --current-border: var(--border-color);
  --current-shadow: var(--shadow-md);
}

/* Dark Mode */
[data-theme="dark"] {
  --current-bg: var(--dark-bg);
  --current-card-bg: var(--dark-card);
  --current-text: var(--text-light);
  --current-text-muted: #9CA3AF;
  --current-border: var(--dark-border);
  --current-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--current-bg);
  color: var(--current-text);
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

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

a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-fast);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--current-text);
}

.text-muted {
  color: var(--current-text-muted);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

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

.container-sm {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

section {
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

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

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

.flex {
  display: flex;
  gap: var(--spacing-md);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-col {
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

header {
  background-color: var(--current-card-bg);
  border-bottom: 1px solid var(--current-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--current-shadow);
}

.header-top {
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-red);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo span {
  color: var(--current-text);
}

.nav-main {
  display: flex;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-main a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--current-text);
  transition: color var(--transition-fast);
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--primary-red);
  text-decoration: none;
}

.header-controls {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--current-border);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--current-text);
  font-size: 0.875rem;
  cursor: pointer;
}

.theme-toggle:hover {
  background-color: var(--primary-red);
  color: var(--primary-white);
  border-color: var(--primary-red);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--current-text);
}

/* ============================================================================
   BANNER & ALERTS
   ============================================================================ */

.breaking-banner {
  background: linear-gradient(135deg, var(--primary-red) 0%, #8B1428 100%);
  color: var(--primary-white);
  padding: var(--spacing-lg);
  text-align: center;
  font-weight: 600;
  animation: pulse 2s infinite;
}

.breaking-banner span {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.2);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: 700;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

/* ============================================================================
   CARDS & ARTICLES
   ============================================================================ */

.card {
  background-color: var(--current-card-bg);
  border: 1px solid var(--current-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

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

.card-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--accent-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-white);
  font-size: 0.875rem;
  text-align: center;
  padding: var(--spacing-md);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--current-text);
}

.card-excerpt {
  color: var(--current-text-muted);
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--current-text-muted);
}

.card-tag {
  display: inline-block;
  background-color: var(--primary-red);
  color: var(--primary-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: var(--spacing-sm);
}

.card-link {
  color: var(--primary-red);
  font-weight: 600;
}

/* ============================================================================
   HERO & FEATURED
   ============================================================================ */

.hero {
  background: linear-gradient(135deg, var(--primary-red) 0%, #8B1428 100%);
  color: var(--primary-white);
  padding: var(--spacing-3xl) var(--spacing-lg);
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--spacing-lg);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-xl);
  color: rgba(255, 255, 255, 0.9);
}

.featured-article {
  background-color: var(--current-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl);
  border: 1px solid var(--current-border);
}

.featured-article-content h2 {
  color: var(--primary-red);
  font-size: 2rem;
}

.featured-article-image {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--accent-blue) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-white);
  font-size: 0.875rem;
  text-align: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-red);
  color: var(--primary-white);
}

.btn-primary:hover {
  background-color: #A01631;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
}

.btn-secondary:hover {
  background-color: var(--primary-red);
  color: var(--primary-white);
}

.btn-small {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
  margin-bottom: var(--spacing-lg);
}

label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--current-text);
}

input,
textarea,
select {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--current-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: var(--current-card-bg);
  color: var(--current-text);
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
  background-color: var(--current-card-bg);
  border-top: 1px solid var(--current-border);
  padding: var(--spacing-3xl) var(--spacing-lg);
  margin-top: var(--spacing-3xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

.footer-section h4 {
  margin-bottom: var(--spacing-lg);
  color: var(--primary-red);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--spacing-md);
}

.footer-section a {
  color: var(--current-text);
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--primary-red);
  text-decoration: none;
}

.footer-contact {
  background-color: var(--current-bg);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-contact p {
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.social-links {
  display: flex;
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--primary-red);
  color: var(--primary-white);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--accent-blue);
  transform: scale(1.1);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--current-border);
  padding-top: var(--spacing-xl);
  text-align: center;
  color: var(--current-text-muted);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.footer-links a {
  color: var(--current-text);
}

/* ============================================================================
   COOKIE CONSENT
   ============================================================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--current-card-bg);
  border-top: 2px solid var(--primary-red);
  padding: var(--spacing-lg);
  z-index: 999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.cookie-message {
  flex: 1;
  font-size: 0.95rem;
}

.cookie-buttons {
  display: flex;
  gap: var(--spacing-md);
}

.cookie-banner.hidden {
  display: none;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

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

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

  .nav-main {
    gap: var(--spacing-lg);
  }

  .menu-toggle {
    display: block;
  }

  .nav-main {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--current-card-bg);
    flex-direction: column;
    gap: 0;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--current-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
  }

  .nav-main.active {
    max-height: 500px;
  }

  .nav-main li {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--current-border);
  }

  .nav-main li:last-child {
    border-bottom: none;
  }

  .featured-article {
    grid-template-columns: 1fr;
  }

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

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

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

  .footer-content {
    grid-template-columns: 1fr;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  .cookie-buttons button {
    width: 100%;
  }

  section {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }
}

@media (max-width: 480px) {
  .container,
  .container-sm {
    padding: 0 var(--spacing-md);
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

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

  .hero {
    padding: var(--spacing-2xl) var(--spacing-md);
  }

  .header-top {
    padding: var(--spacing-md);
  }

  section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .card-img {
    height: 150px;
  }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-2xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-2xl); }

.py-1 { padding: var(--spacing-sm) 0; }
.py-2 { padding: var(--spacing-md) 0; }
.py-3 { padding: var(--spacing-lg) 0; }
.py-4 { padding: var(--spacing-xl) 0; }
.py-5 { padding: var(--spacing-2xl) 0; }

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

.text-right {
  text-align: right;
}

.opacity-75 {
  opacity: 0.75;
}

.opacity-50 {
  opacity: 0.5;
}
