/* ============================================================
   NAVBAR — Apple-Style Scroll-Dependent
   ============================================================ */

  /* Active nav link inside pill */
  .nav-link:hover { color: #ffffff !important; background: var(--glow) !important; }
  .nav-link.active { color: var(--text) !important; background: var(--glow) !important; box-shadow: inset 0 0 8px var(--glow); border-color: var(--accent); }

  /* Mobile: hide pill & right-action area; show hamburger */
  @media (max-width: 768px) {
    #navLinks { display: none !important; }
    #navThemePicker { display: none !important; }
    .nav-hamburger { display: flex; }
  }
  @media (min-width: 769px) {
    .nav-hamburger { display: none !important; }
  }

  /* Hamburger bars */
  .nav-hamburger {
    flex-direction: column; justify-content: space-between;
    width: 26px; height: 18px;
    background: none; border: none; cursor: pointer;
    padding: 0; z-index: 201; flex-shrink: 0;
  }
  .nav-hamburger span {
    display: block; width: 100%; height: 2px;
    background: #f1f5f9; border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* Theme btn sizes inside navbar (override old values) */
  .theme-btn {
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
  }
  .theme-btn:hover { transform: scale(1.25) !important; }
  .theme-btn.active {
    box-shadow: 0 0 0 2px #fff, 0 0 8px var(--accent) !important;
    transform: scale(1.1) !important;
  }
  /* Mini CTA hover */
  #mainNav button[onclick="openSubscribeModal()"]:hover {
    transform: scale(1.05);
    box-shadow: 0 0 22px var(--glow);
  }

/* ============================================================
   AI RESPONSE — Premium Full-Screen Modal
   ============================================================ */
  @keyframes aiModalIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  @keyframes borderGlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  .ai-modal-overlay {
    position: fixed; inset: 0;
    z-index: 999;
    background: rgba(7, 11, 26, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .ai-modal-card {
    position: relative;
    width: 100%; max-width: 560px;
    max-height: 80vh; overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 24px;
    padding: 2.5rem;
    animation: aiModalIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }

  .ai-modal-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 1.25rem;
  }
  .ai-modal-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(236,72,153,0.15));
    border: 1px solid rgba(129,140,248,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .ai-modal-sender {
    font-size: 0.8rem; font-weight: 600;
    color: var(--accent, #818cf8);
    letter-spacing: 0.8px; text-transform: uppercase;
  }
  .ai-modal-subtitle {
    font-size: 0.72rem; color: rgba(148,163,184,0.7); margin-top: 1px;
  }

  .ai-modal-text {
    font-size: 1.05rem; line-height: 1.8;
    color: #f1f5f9;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    white-space: pre-wrap;
    font-weight: 400;
  }

  .ai-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(148,163,184,0.8);
    font-size: 1rem; line-height: 1;
    transition: background 0.2s, color 0.2s;
  }
  .ai-modal-close:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }

  .ai-modal-dismiss {
    display: block; width: 100%; margin-top: 2rem;
    padding: 0.85rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: rgba(241,245,249,0.95); font-size: 0.95rem; font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }
  .ai-modal-dismiss:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
  }

/* ============================================================
   CTA BUTTON — "Kích hoạt AI Nhắc nhở" redesign
   ============================================================ */
  @keyframes shimmerSweep {
    0%   { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(250%) skewX(-15deg); }
  }
  @keyframes ctaPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--glow),
                            0 8px 32px var(--glow); }
    50%       { box-shadow: 0 0 0 10px transparent,
                            0 8px 42px var(--glow); }
  }

body {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      height: 100%;
      overflow-x: hidden;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    
    html {
      height: 100%;
      scroll-behavior: smooth;
      scroll-padding-top: 80px;
    }

    /* Theme Variables */
    :root {
      --bg-start: #111315;
      --bg-end: #1D2125;
      --accent: #9CA3AF;
      --secondary: #D1D5DB;
      --text: #E5E7EB;
      --text-dim: #9CA3AF;
      --glow: rgba(156, 163, 175, 0.3);
    }

    .theme-emerald {
      --bg-start: #0F2222;
      --bg-end: #183C3C;
      --accent: #6EE7B7;
      --secondary: #A7F3D0;
      --text: #E6F2E6;
      --text-dim: #A7F3D0;
      --glow: rgba(110, 231, 183, 0.3);
    }

    .theme-slate {
      --bg-start: #111315;
      --bg-end: #1D2125;
      --accent: #9CA3AF;
      --secondary: #D1D5DB;
      --text: #E5E7EB;
      --text-dim: #9CA3AF;
      --glow: rgba(156, 163, 175, 0.3);
    }

    .theme-rose {
      --bg-start: #1F0A1A;
      --bg-end: #2D1B2E;
      --accent: #F472B6;
      --secondary: #FBBF24;
      --text: #FDF2F8;
      --text-dim: #F9A8D4;
      --glow: rgba(244, 114, 182, 0.3);
    }

    .theme-brown {
      --bg-start: #1C1410;
      --bg-end: #2A1F1A;
      --accent: #D97706;
      --secondary: #F59E0B;
      --text: #FEF3E2;
      --text-dim: #FCD34D;
      --glow: rgba(217, 119, 6, 0.3);
    }

    .theme-deep {
      --bg-start: #0D1117;
      --bg-end: #1A2332;
      --accent: #00B4D8;
      --secondary: #0077B6;
      --text: #E1F5FE;
      --text-dim: #81D4FA;
      --glow: rgba(0, 180, 216, 0.3);
    }

    /* Animated Background */
    .animated-bg {
      background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
      background-size: 400% 400%;
      animation: gradientShift 15s ease-in-out infinite;
      min-height: 100%;
      position: relative;
      overflow: hidden;
      transition: background 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes gradientShift {
      0%, 100% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
    }

    /* Floating particles */
    .particles {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 1;
    }

    .particle {
      position: absolute;
      width: 2px;
      height: 2px;
      background: var(--accent);
      border-radius: 50%;
      opacity: 0.6;
      animation: float 20s linear infinite;
    }

    @keyframes float {
      0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
      }
      10% {
        opacity: 0.6;
      }
      90% {
        opacity: 0.6;
      }
      100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
      }
    }

    /* Glass morphism */
    .glass {
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 24px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* AI Trigger Button Wrapper */
    .ai-trigger-wrapper {
      display: flex;
      justify-content: center;
      margin-top: 10px;
      margin-bottom: 40px;
      position: relative;
      z-index: 2;
    }

    /* Hero Section */
    .hero-section {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 2rem;
      padding-top: 100px;
      padding-bottom: 0;
      position: relative;
      z-index: 2;
    }

    .hero-subtitle-pill {
      background: rgba(30, 41, 59, 0.8);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 50px;
      padding: 0.5rem 1.25rem;
      font-size: 0.95rem;
      color: #cbd5e1;
      margin-bottom: 1.5rem;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .hero-subtitle-pill strong {
      color: var(--accent);
      font-weight: 600;
    }

    .hero-title {
      font-size: clamp(2rem, 5vw, 4rem);
      font-weight: 800;
      color: var(--text);
      margin-bottom: 1rem;
      margin-top: 0.5rem;
      text-shadow: 0 0 30px var(--glow);
      animation: fadeInUp 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      letter-spacing: 2px;
      line-height: 1.2;
      transition: color 1.5s cubic-bezier(0.4, 0, 0.2, 1), text-shadow 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hero-subtitle {
      font-size: clamp(1rem, 2.5vw, 1.5rem);
      color: var(--text-dim);
      margin-bottom: 3rem;
      animation: fadeInUp 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s both;
      font-weight: 300;
    }

    /* Countdown */
    .countdown-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 2.5rem;
      max-width: 800px;
      width: 100%;
      margin-bottom: 0;
      animation: slideInScale 2.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.2s both;
    }

    .countdown-box {
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(15px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 24px;
      padding: 2.5rem 1.5rem;
      text-align: center;
      transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
      position: relative;
      overflow: hidden;
      opacity: 0;
      transform: translateY(60px) scale(0.8);
      animation: countdownBoxIn 1.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    .countdown-box:nth-child(1) { animation-delay: 1.6s; }
    .countdown-box:nth-child(2) { animation-delay: 1.8s; }
    .countdown-box:nth-child(3) { animation-delay: 2.0s; }
    .countdown-box:nth-child(4) { animation-delay: 2.2s; }

    .countdown-box:hover {
      transform: translateY(-15px) scale(1.05);
      box-shadow: 0 40px 100px var(--glow);
      border-color: var(--accent);
    }

    .countdown-box:hover .countdown-number {
      transform: scale(1.1);
      text-shadow: 0 0 30px var(--glow), 0 0 50px var(--accent);
      color: var(--secondary);
    }

    .countdown-box:hover .countdown-label {
      color: var(--accent);
      transform: translateY(-2px);
    }

    .countdown-box::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      transition: left 0.8s ease;
    }

    .countdown-box:hover::before {
      left: 100%;
    }

    .countdown-number {
      font-size: 3.5rem;
      font-weight: 700;
      color: var(--accent);
      line-height: 1;
      margin-bottom: 0.8rem;
      text-shadow: 0 0 20px var(--glow);
      transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1), color 1.5s cubic-bezier(0.4, 0, 0.2, 1), text-shadow 1.5s cubic-bezier(0.4, 0, 0.2, 1);
      transform-style: preserve-3d;
      perspective: 1000px;
      position: relative;
      display: inline-block;
    }

    .countdown-number::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      opacity: 0;
      transition: opacity 0.3s ease;
      border-radius: 8px;
    }

    .countdown-number:hover::before {
      opacity: 1;
    }

    .countdown-label {
      font-size: 1.1rem;
      color: var(--text-dim);
      text-transform: uppercase;
      letter-spacing: 1.5px;
      font-weight: 500;
    }

    /* Section spacing */
    .section {
      padding: 5rem 2rem;
      position: relative;
      z-index: 2;
    }

    .section-title {
      font-size: clamp(1.5rem, 3vw, 2.5rem);
      font-weight: 700;
      color: var(--text);
      text-align: center;
      margin-bottom: 3rem;
      text-shadow: 0 0 20px var(--glow);
      letter-spacing: 1px;
    }

    /* Form Section */
    .form-container {
      max-width: 600px;
      margin: 0 auto;
    }

    .form-group {
      margin-bottom: 2rem;
    }

    .form-label {
      display: block;
      color: var(--text);
      font-weight: 500;
      margin-bottom: 0.5rem;
      font-size: 1rem;
    }

    .form-input, .form-textarea {
      width: 100%;
      padding: 1rem 1.5rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 12px;
      color: var(--text);
      font-size: 1rem;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
    }

    .form-input:focus, .form-textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 20px var(--glow);
      background: rgba(255, 255, 255, 0.08);
    }

    .form-input::placeholder, .form-textarea::placeholder {
      color: var(--text-dim);
    }

    .submit-btn {
      width: 100%;
      padding: 1rem 2rem;
      background: linear-gradient(135deg, var(--accent), var(--secondary));
      border: none;
      border-radius: 12px;
      color: white;
      font-size: 1.1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      text-transform: uppercase;
      letter-spacing: 1px;
      position: relative;
      overflow: hidden;
    }

    .submit-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 40px var(--glow);
    }

    .submit-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    /* Messages Display */
    .messages-container {
      max-width: 1200px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem;
      padding: 0 1rem;
      position: relative;
    }

    .message-card {
      background: rgba(255, 255, 255, 0.03);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      padding: 1.5rem;
      transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      animation: gentleFloat 6s ease-in-out infinite;;
      position: relative;
      overflow: visible;
      z-index: 1;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
      transform-origin: center;

      /* 👇 THÊM CÁC DÒNG NÀY 👇 */
      display: flex;
      flex-direction: column;
      justify-content: space-between; /* Đẩy các phần tử ra xa nhau */
      height: 100%; /* Chiếm toàn bộ chiều cao của ô lưới */
      min-height: 200px; /* Đặt chiều cao tối thiểu để các ô đều nhau hơn */
    }

    .message-card::before {
      content: '💬';
      position: absolute;
      top: 1rem;
      right: 1rem;
      font-size: 1.2rem;
      opacity: 0.6;
    }

    /* 2. Sửa lại icon dấu ngoặc kép (Làm nó đẹp hơn cho ô không có ảnh) */
    .message-card::before {
      /* content: '❝'; */ /* Dấu ngoặc kép đậm hơn */
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 2rem; /* Phóng to lên */
      color: var(--accent);
      /* opacity: 0.05; */ /* Làm mờ đi để làm nền */
      font-family: serif;
      line-height: 1;
      pointer-events: none;
    }

    /* 3. Nếu CÓ ảnh sticker thì ẩn cái dấu ngoặc kép to đi cho đỡ rối */
    .message-card:has(.sticker-container)::before {
      display: none;
    }

    
    
    /* Phần tác giả luôn nằm dưới đáy */
    .message-footer {
      margin-top: auto; 
      border-top: 1px solid rgba(255,255,255,0.1); /* Thêm đường kẻ mờ ngăn cách cho đẹp */
      padding-top: 10px;
    }

    .message-card:hover {
      transform: translateY(-12px) scale(1.02);
      border-color: var(--accent);
      box-shadow: 0 30px 80px var(--glow);
      background: rgba(255, 255, 255, 0.06);
      z-index: 100;
    }

    .message-card:nth-child(odd) {
      animation-delay: 0.1s, 0s;
    }

    .message-card:nth-child(even) {
      animation-delay: 0.2s, 2s;
    }

    .message-card:nth-child(3n) {
      animation-delay: 0.3s, 4s;
    }

    .message-text {
      color: var(--text);
      font-size: 1.1rem;
      line-height: 1.7;
      margin-bottom: 1.5rem;
      font-style: italic;
      position: relative;
      padding: 0.5rem 1rem;
      margin: 0.5rem 0 1.5rem 0;
    }

    .message-text::before {
      content: '"';
      font-size: 2rem;
      color: var(--accent);
      position: absolute;
      top: -0.3rem;
      left: -0.8rem;
      opacity: 0.7;
      z-index: -1;
    }

    .message-text::after {
      content: '"';
      font-size: 2rem;
      color: var(--accent);
      position: absolute;
      bottom: -0.8rem;
      right: -0.3rem;
      opacity: 0.7;
      z-index: -1;
    }

    .message-author {
      color: var(--accent);
      font-weight: 600;
      font-size: 0.95rem;
    }

    .message-time {
      color: var(--text-dim);
      font-size: 0.8rem;
      margin-left: 1rem;
    }

    /* Class Logo Section */
    .class-logo-section {
      position: absolute;
      top: 0.5rem;
      left: 0.5rem;
      z-index: 1000;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 0.4rem 0.6rem;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
      transition: all 0.3s ease;
      animation: slideInFromLeft 1.5s cubic-bezier(0.23, 1, 0.32, 1) 0.5s both;
    }

    .class-logo-section:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 40px var(--glow);
      border-color: var(--accent);
    }

    .class-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      animation: scaleIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s both;
    }

    .class-logo svg {
      filter: drop-shadow(0 0 10px var(--glow));
      transition: all 0.3s ease;
    }

    .class-logo-section:hover .class-logo svg {
      transform: scale(1.1) rotate(5deg);
      filter: drop-shadow(0 0 20px var(--glow));
    }

    .class-info {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
      animation: slideInFromLeft 1.3s cubic-bezier(0.23, 1, 0.32, 1) 1.2s both;
    }

    .class-name {
      color: var(--accent);
      font-size: 0.8rem;
      font-weight: 700;
      margin: 0;
      text-shadow: 0 0 10px var(--glow);
      letter-spacing: 0.5px;
    }

    /* Theme buttons — size set inline in navbar HTML */
    .theme-btn {
      border-radius: 50%;
      cursor: pointer;
      position: relative;
      border: 2px solid transparent;
    }

    .theme-btn.active {
      border-color: white;
      box-shadow: 0 0 15px var(--accent),
                  inset 0 2px 5px rgba(255,255,255,0.4);
    }


    /* Thêm một chấm sáng nhỏ dưới chân nút Active để đánh dấu */
    .theme-btn.active::after {
      content: '';
      position: absolute;
      bottom: -12px; /* Nằm dưới thanh */
      left: 50%;
      transform: translateX(-50%);
      width: 4px;
      height: 4px;
      background: var(--accent); /* Màu theo theme */
      border-radius: 50%;
      box-shadow: 0 0 5px var(--accent);
      opacity: 0;
      animation: fadeIn 0.3s forwards 0.2s; /* Hiện chậm */
    }

    /* Màu sắc các viên ngọc (Gradient tinh chỉnh lại cho bóng bẩy hơn) */
    .theme-deep { background: linear-gradient(135deg, #0f172a, #0ea5e9); }
    .theme-emerald-btn { background: linear-gradient(135deg, #064e3b, #34d399); }
    .theme-slate-btn { background: linear-gradient(135deg, #374151, #9ca3af); }
    .theme-rose-btn { background: linear-gradient(135deg, #831843, #f472b6); }
    .theme-brown-btn { background: linear-gradient(135deg, #451a03, #fbbf24); }

    /* Scroll Animations */
    .scroll-reveal {
      opacity: 0;
      transform: translateY(80px);
      transition: all 1.6s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .scroll-reveal.revealed {
      opacity: 1;
      transform: translateY(0);
    }

    .scroll-reveal-left {
      opacity: 0;
      transform: translateX(-80px) rotate(-5deg);
      transition: all 1.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .scroll-reveal-left.revealed {
      opacity: 1;
      transform: translateX(0) rotate(0deg);
    }

    .scroll-reveal-right {
      opacity: 0;
      transform: translateX(80px) rotate(5deg);
      transition: all 1.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .scroll-reveal-right.revealed {
      opacity: 1;
      transform: translateX(0) rotate(0deg);
    }

    .scroll-reveal-scale {
      opacity: 0;
      transform: scale(0.6) rotate(10deg);
      transition: all 1.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .scroll-reveal-scale.revealed {
      opacity: 1;
      transform: scale(1) rotate(0deg);
    }

    .scroll-reveal-fade {
      opacity: 0;
      transition: opacity 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .scroll-reveal-fade.revealed {
      opacity: 1;
    }

    /* Stagger animation delays */
    .scroll-reveal:nth-child(1) { transition-delay: 0.2s; }
    .scroll-reveal:nth-child(2) { transition-delay: 0.4s; }
    .scroll-reveal:nth-child(3) { transition-delay: 0.6s; }
    .scroll-reveal:nth-child(4) { transition-delay: 0.8s; }
    .scroll-reveal:nth-child(5) { transition-delay: 1.0s; }
    .scroll-reveal:nth-child(6) { transition-delay: 1.2s; }

    /* Animations */
    @keyframes fadeInUp {
      0% {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
      }
      50% {
        opacity: 0.7;
        transform: translateY(-10px) scale(1.02);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes slideInScale {
      0% {
        opacity: 0;
        transform: translateY(100px) scale(0.8);
      }
      60% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1.05);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes countdownBoxIn {
      0% {
        opacity: 0;
        transform: translateY(60px) scale(0.8) rotateX(45deg);
      }
      50% {
        opacity: 0.7;
        transform: translateY(-10px) scale(1.05) rotateX(-5deg);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
      }
    }

    @keyframes slideInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes floatIn {
      0% {
        opacity: 0;
        transform: translateY(50px) scale(0.85) rotate(8deg);
      }
      30% {
        opacity: 0.4;
        transform: translateY(20px) scale(0.95) rotate(-2deg);
      }
      70% {
        opacity: 0.8;
        transform: translateY(-8px) scale(1.03) rotate(1deg);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
      }
    }

    @keyframes gentleFloat {
      0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
      }
      25% {
        transform: translateY(-12px) rotate(0.8deg) scale(1.01);
      }
      50% {
        transform: translateY(-6px) rotate(0deg) scale(1.005);
      }
      75% {
        transform: translateY(-18px) rotate(-0.8deg) scale(1.01);
      }
    }

    @keyframes slideInFromLeft {
      from {
        opacity: 0;
        transform: translateX(-100px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes slideInFromRight {
      from {
        opacity: 0;
        transform: translateX(100px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes scaleIn {
      from {
        opacity: 0;
        transform: scale(0.5);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes numberFlip {
      0% { 
        transform: rotateX(0deg) scale(1);
        opacity: 1;
      }
      25% {
        transform: rotateX(-45deg) scale(0.95);
        opacity: 0.8;
      }
      50% { 
        transform: rotateX(-90deg) scale(0.9);
        opacity: 0.6;
      }
      75% {
        transform: rotateX(-45deg) scale(0.95);
        opacity: 0.8;
      }
      100% { 
        transform: rotateX(0deg) scale(1);
        opacity: 1;
      }
    }

    @keyframes numberGlow {
      0%, 100% {
        text-shadow: 0 0 20px var(--glow);
      }
      50% {
        text-shadow: 0 0 40px var(--glow), 0 0 60px var(--accent);
      }
    }

    @keyframes numberPulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.05);
      }
    }

    .number-flip {
      animation: numberFlip 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .number-glow {
      animation: numberGlow 2s ease-in-out infinite;
    }

    .number-pulse {
      animation: numberPulse 1.5s ease-in-out infinite;
    }

    /* Checkbox Styling */
    .checkbox-container {
      display: flex;
      align-items: center;
      cursor: pointer;
      user-select: none;
      margin-bottom: 0;
    }

    .checkbox-input {
      display: none;
    }

    .checkbox-custom {
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 6px;
      margin-right: 12px;
      position: relative;
      transition: all 0.3s ease;
      background: rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(10px);
    }

    .checkbox-custom::after {
      content: '✓';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0);
      color: white;
      font-size: 12px;
      font-weight: bold;
      transition: transform 0.2s ease;
    }

    .checkbox-input:checked + .checkbox-custom {
      border-color: var(--accent);
      background: var(--accent);
      box-shadow: 0 0 15px var(--glow);
    }

    .checkbox-input:checked + .checkbox-custom::after {
      transform: translate(-50%, -50%) scale(1);
    }

    .checkbox-label {
      color: var(--text);
      font-size: 0.95rem;
      font-weight: 500;
    }

    .checkbox-container:hover .checkbox-custom {
      border-color: var(--accent);
      transform: scale(1.05);
    }

    /* Form shake animation */
    @keyframes formShake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-5px); }
      75% { transform: translateX(5px); }
    }

    .form-shake {
      animation: formShake 0.5s ease-in-out;
    }

    /* Success message */
    .success-message {
      text-align: center;
      color: var(--secondary);
      font-size: 1.2rem;
      font-weight: 600;
      padding: 2rem;
      opacity: 0;
      transform: scale(0.8);
      transition: all 0.6s ease;
    }

    .success-message.show {
      opacity: 1;
      transform: scale(1);
    }

    /* Shine effect for button */
    .submit-btn::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.8s ease;
    }

    .submit-btn:hover::before {
      left: 100%;
    }

    /* Loading states */
    .loading {
      opacity: 0.6;
      pointer-events: none;
    }

    .spinner {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Admin Panel Styles */
    .admin-btn {
      padding: 0.6rem 1.2rem;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 10px;
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .admin-btn:hover {
      background: rgba(255, 255, 255, 0.15);
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: 0 8px 25px var(--glow);
    }

    .admin-btn.active {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }

    .export-btn {
      background: linear-gradient(135deg, var(--secondary), var(--accent));
      border: none;
      color: white;
      box-shadow: 0 0 15px var(--glow);
      transition: all 0.5s ease-in-out, transform 0.2s ease, box-shadow 0.2s ease;
    }

    .export-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px var(--glow);
    }

    .admin-panel {
      border: 1px solid rgba(255, 255, 255, 0.15);
      animation: slideDown 0.3s ease-out;
    }

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

    .admin-action-btn {
      padding: 0.5rem 1rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      color: var(--text);
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      backdrop-filter: blur(8px);
    }

    .admin-action-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: var(--accent);
      transform: translateY(-1px);
    }

    .admin-action-btn.delete-btn {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: #FCA5A5;
    }

    .admin-action-btn.delete-btn:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: #EF4444;
      color: #FEE2E2;
    }

    .admin-action-btn.export-btn {
      background: rgba(16, 185, 129, 0.1);
      border-color: rgba(16, 185, 129, 0.3);
      color: #6EE7B7;
    }
    /* Message Particles */
    .message-particles {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 1;
    }

    .message-particle {
      position: absolute;
      width: 4px;
      height: 4px;
      background: var(--accent);
      border-radius: 50%;
      opacity: 0.4;
      animation: messageFloat 15s linear infinite;
    }

    .message-particle.circle::before {
      content: '';
      position: absolute;
      top: -2px;
      left: -2px;
      width: 8px;
      height: 8px;
      background: var(--accent);
      border-radius: 50%;
      opacity: 0.8;
    }

    .message-particle.square::before {
      content: '';
      position: absolute;
      top: -1px;
      left: -1px;
      width: 6px;
      height: 6px;
      background: var(--secondary);
      border-radius: 2px;
      opacity: 0.6;
      transform: rotate(45deg);
    }

    .message-particle.diamond::before {
      content: '';
      position: absolute;
      top: -3px;
      left: -3px;
      width: 10px;
      height: 10px;
      background: linear-gradient(45deg, var(--accent), var(--secondary));
      border-radius: 2px;
      opacity: 0.7;
      transform: rotate(45deg);
    }

    @keyframes messageFloat {
      0% {
        transform: translateY(100%) translateX(0px) rotate(0deg);
        opacity: 0;
      }
      15% {
        opacity: 0.8;
      }
      85% {
        opacity: 0.8;
      }
      100% {
        transform: translateY(-300px) translateX(80px) rotate(720deg);
        opacity: 0;
      }
    }

    /* ==== PEEK-A-BOO ROBOT ANIMATIONS ==== */
    @keyframes robotPeek {
      0% { transform: translateY(100%); opacity: 0; }
      10% { transform: translateY(0); opacity: 1; }
      90% { transform: translateY(0); opacity: 1; }
      100% { transform: translateY(100%); opacity: 0; }
    }

    @keyframes robotWave {
      0%, 100% { transform: rotate(0deg); }
      25% { transform: rotate(-30deg); }
      75% { transform: rotate(30deg); }
    }

    @keyframes bubbleFadeIn {
      0%, 15% { opacity: 0; transform: translateY(5px); }
      25%, 85% { opacity: 1; transform: translateY(0); }
      95%, 100% { opacity: 0; transform: translateY(5px); }
    }

    .robot-active {
      animation: robotPeek 8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    /* .robot-active #robot-arm {
      animation: robotWave 0.8s ease-in-out infinite;
    } */

    .robot-active .robot-bubble {
      animation: bubbleFadeIn 8s ease-in-out forwards;
    }

    .admin-action-btn.export-btn:hover {
      background: rgba(16, 185, 129, 0.2);
      border-color: #10B981;
      color: #D1FAE5;
    }

    /* Message Card Admin Mode */
    .message-card.admin-mode {
      position: relative;
      cursor: pointer;
      user-select: none;
    }

    .message-card.admin-mode::before {
      content: '';
      position: absolute;
      top: 0.5rem;
      left: 0.5rem;
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.05);
      transition: all 0.3s ease;
      z-index: 10;
    }

    .message-card.admin-mode.selected::before {
      background: var(--accent);
      border-color: var(--accent);
    }

    .message-card.admin-mode.selected::after {
      content: '✓';
      position: absolute;
      top: 0.7rem;
      left: 0.7rem;
      color: white;
      font-size: 12px;
      font-weight: bold;
      z-index: 11;
    }

    .message-card.admin-mode.selected {
      border-color: var(--accent);
      box-shadow: 0 0 20px var(--glow);
      background: rgba(255, 255, 255, 0.08);
    }

    .message-card.admin-mode:hover::before {
      border-color: var(--accent);
      transform: scale(1.1);
    }

    /* Delete confirmation */
    .delete-confirmation {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 10000;
      backdrop-filter: blur(10px);
    }

    .delete-modal {
      background: var(--bg-end);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 16px;
      padding: 2rem;
      max-width: 450px;
      width: 90%;
      text-align: center;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    .delete-modal h3 {
      color: #EF4444;
      margin-bottom: 1rem;
      font-size: 1.3rem;
    }

    .delete-modal p {
      color: var(--text);
      margin-bottom: 1.5rem;
      line-height: 1.6;
    }

    .password-input-group {
      margin-bottom: 2rem;
      text-align: left;
    }

    .password-input-group label {
      display: block;
      color: var(--text);
      font-weight: 500;
      margin-bottom: 0.5rem;
      font-size: 0.95rem;
    }

    .password-input {
      width: 100%;
      padding: 0.8rem 1rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      color: var(--text);
      font-size: 1rem;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
      box-sizing: border-box;
    }

    .password-input:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 15px var(--glow);
      background: rgba(255, 255, 255, 0.08);
    }

    .password-input::placeholder {
      color: var(--text-dim);
    }

    .password-error {
      color: #EF4444;
      font-size: 0.85rem;
      margin-top: 0.5rem;
      display: none;
    }

    .password-hint {
      color: var(--text-dim);
      font-size: 0.8rem;
      margin-top: 0.5rem;
      font-style: italic;
    }

    .delete-modal-buttons {
      display: flex;
      gap: 1rem;
      justify-content: center;
    }

    .delete-modal-btn {
      padding: 0.8rem 1.5rem;
      border: none;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .delete-modal-btn.confirm {
      background: #EF4444;
      color: white;
    }

    .delete-modal-btn.confirm:hover:not(:disabled) {
      background: #DC2626;
      transform: translateY(-2px);
    }

    .delete-modal-btn.confirm:disabled {
      background: #6B7280;
      cursor: not-allowed;
      transform: none;
    }

    .delete-modal-btn.cancel {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text);
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .delete-modal-btn.cancel:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: translateY(-2px);
    }

    /* Password shake animation */
    @keyframes passwordShake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-8px); }
      75% { transform: translateX(8px); }
    }

    .password-shake {
      animation: passwordShake 0.5s ease-in-out;
    }

    /* Search highlight */
    .highlight {
      background: rgba(255, 255, 0, 0.3);
      padding: 0.1rem 0.2rem;
      border-radius: 3px;
    }

    /* Export Modal Styles */
    .export-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 10000;
      backdrop-filter: blur(10px);
      animation: fadeIn 0.3s ease-out;
    }

    .export-modal {
      background: var(--bg-end);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 20px;
      padding: 2rem;
      max-width: 900px;
      width: 95%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
      animation: slideInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .export-modal-header {
      text-align: center;
      margin-bottom: 2rem;
    }

    .export-modal-header h2 {
      color: var(--accent);
      font-size: 1.8rem;
      margin-bottom: 0.5rem;
      text-shadow: 0 0 20px var(--glow);
    }

    .export-modal-header p {
      color: var(--text-dim);
      font-size: 1rem;
      line-height: 1.6;
    }

    .export-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 1.5rem;
      margin-bottom: 2rem;
    }

    .export-option {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 15px;
      padding: 2rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
      position: relative;
      overflow: hidden;
    }

    .export-option:hover {
      transform: translateY(-8px);
      border-color: var(--accent);
      box-shadow: 0 20px 60px var(--glow);
      background: rgba(255, 255, 255, 0.08);
    }

    .export-option::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      transition: left 0.6s ease;
    }

    .export-option:hover::before {
      left: 100%;
    }

    .export-icon {
      font-size: 3rem;
      margin-bottom: 1rem;
      filter: drop-shadow(0 0 10px var(--glow));
    }

    .export-option h3 {
      color: var(--text);
      font-size: 1.3rem;
      margin-bottom: 1rem;
      font-weight: 600;
    }

    .export-option p {
      color: var(--text-dim);
      font-size: 0.95rem;
      line-height: 1.5;
      margin-bottom: 1.5rem;
    }

    .export-features {
      color: var(--accent);
      font-size: 0.85rem;
      line-height: 1.6;
      background: rgba(255, 255, 255, 0.03);
      padding: 1rem;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .export-stats {
      display: flex;
      justify-content: center;
      gap: 2rem;
      margin-bottom: 2rem;
      padding: 1.5rem;
      background: rgba(255, 255, 255, 0.03);
      border-radius: 15px;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .stat-number {
      display: block;
      font-size: 2rem;
      font-weight: bold;
      color: var(--accent);
      text-shadow: 0 0 15px var(--glow);
    }

    .stat-label {
      color: var(--text-dim);
      font-size: 0.85rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-top: 0.5rem;
    }

    .export-modal-footer {
      text-align: center;
    }

    .export-close-btn {
      padding: 0.8rem 2rem;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 10px;
      color: var(--text);
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
    }

    .export-close-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: 0 8px 25px var(--glow);
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes slideInScale {
      from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
      }
      to {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    /* Responsive */
    @media (max-width: 768px) {
      .countdown-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
      }
      
      .countdown-box {
        padding: 1.5rem 0.5rem;
      }
      
      .countdown-number {
        font-size: 2rem;
      }
      
      .class-logo-section {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.6rem 0.8rem;
        gap: 0.8rem;
      }

      .class-logo svg {
        width: 50px;
        height: 50px;
      }

      .class-name {
        font-size: 0.9rem;
      }
      
      .theme-switcher {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.2rem;
      }

      .messages-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 0.5rem;
      }

      .message-card {
        padding: 1.5rem;
      }

      .form-container {
        margin: 0 1rem;
      }

      .section {
        padding: 3rem 1rem;
      }

      .admin-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
      }

      .admin-btn {
        justify-content: center;
        padding: 0.8rem;
      }

      .admin-panel {
        padding: 1rem;
      }

      .admin-panel > div:first-child {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
      }

      .admin-panel > div:nth-child(2) {
        flex-direction: column;
        gap: 0.5rem;
      }

      .admin-panel > div:last-child {
        flex-direction: column;
        gap: 0.5rem;
      }

      #searchInput {
        min-width: auto;
      }

      .export-modal {
        width: 98%;
        padding: 1.5rem;
        max-height: 95vh;
      }

      .export-options {
        grid-template-columns: 1fr;
        gap: 1rem;
      }

      .export-option {
        padding: 1.5rem;
      }

      .export-stats {
        flex-direction: column;
        gap: 1rem;
      }

      .export-modal-header h2 {
        font-size: 1.5rem;
      }
    }

    @media (max-width: 480px) {
      .hero-title {
        font-size: 2rem;
        line-height: 1.3;
      }

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

      .countdown-number {
        font-size: 1.8rem;
      }

      .countdown-box {
        padding: 1rem 0.5rem;
      }

      .class-logo-section {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
        text-align: center;
      }

      .class-logo svg {
        width: 50px;
        height: 50px;
      }

      .class-name {
        font-size: 0.9rem;
      }

      .theme-switcher {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.2rem;
      }

      .theme-btn {
        width: 24px;
        height: 24px;
      }

      .messages-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
      }

      .message-text::before,
      .message-text::after {
        font-size: 1.5rem;
      }
      
    }

    

    /* --- TRÌNH PHÁT NHẠC (STYLE ĐĨA THAN BAY - BẢN FIX LỖI) --- */
    .music-widget {
      position: fixed;
      bottom: 30px;
      left: 20px;
      z-index: 1000;
      display: flex;
      align-items: center;
      /* gap: 15px;  <-- BỎ DÒNG NÀY, ta sẽ dùng margin để kiểm soát tốt hơn */
      
      /* --- TRẠNG THÁI THU GỌN --- */
      width: 60px;
      height: 60px;
      padding: 0px;
      background: transparent;
      border: none;
      box-shadow: none;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      overflow: visible;
    }

    /* --- KHI MỞ RỘNG (HOVER HOẶC ĐƯỢC KÍCH HOẠT QUA JS) --- */
    .music-widget:hover,
    .music-widget.music-widget-expanded {
      width: 460px; /* Rộng rãi hơn */
      height: 75px;
      
      /* 👇 BÍ KÍP ĐỔI MÀU THEO CHỦ ĐỀ 👇 */
      /* Kết hợp màu đen mờ + Màu nền của theme (var(--bg-end)) */
      background: linear-gradient(135deg, rgba(0,0,0,0.9), var(--bg-end));
      
      /* Viền và bóng phát sáng theo màu điểm nhấn (Accent) */
      border: 1px solid var(--accent);
      box-shadow: 0 10px 40px var(--glow);
      
      backdrop-filter: blur(20px); /* Kính mờ xịn xò */
      padding-right: 15px;
      border-radius: 60px;
    }

    /* --- ĐĨA THAN (VINYL) --- */
    .vinyl-wrapper {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: #111;
      background: radial-gradient(circle at 30% 30%, #333, #000);
      border: 1px solid rgba(255,255,255,0.1);
      position: relative;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 5px 15px rgba(0,0,0,0.5); 
      transition: transform 0.3s ease;
      animation: spin 5s linear infinite;
      animation-play-state: paused;
      margin-right: 15px; /* ✅ Thêm khoảng cách giữa Đĩa và Chữ */
       
     
    }

    .music-widget:hover .vinyl-wrapper,
    .music-widget.music-widget-expanded .vinyl-wrapper { transform: scale(1.1); }
    .music-widget.playing .vinyl-wrapper {
      animation-play-state: running;
      box-shadow: 0 0 25px var(--accent); /* Phát sáng màu theme */
    }

    /* ✅ NHÃN DÁN BÊN TRONG (Ảnh bìa) - TO HƠN */
    .vinyl-label {
      width: 40px;   /* Tăng từ 26px lên 34px */
      height: 40px;  /* Tăng từ 26px lên 34px */
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(20, 20, 20, 0.9);
    }

    .vinyl-hole {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 2px;
      height: 2px;
      background: #000;
      border-radius: 50%;
      border: 1px solid rgba(255,255,255,0.3);
      z-index: 5;
    }

    /* --- PHẦN THÔNG TIN CHỮ --- */
    .music-info {
      flex: 1; 
      min-width: 0;

      margin-right: 15px;
      display: flex;
      flex-direction: column;
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.2s ease;
      /* margin-left: 10px; <-- Bỏ dòng này vì đã margin ở đĩa rồi */
      
      /* ✅ Tăng chiều rộng cho chữ và xử lý khi chữ quá dài */
      width: 130px; 
      overflow: hidden;
      
      margin-right: 15px; /* ✅ TẠO KHOẢNG CÁCH AN TOÀN VỚI CÁC NÚT */
    }

    .music-widget:hover .music-info {
      opacity: 1;
      transition-delay: 0.1s;
    }

    .music-title { 
      font-size: 0.95rem; font-weight: 700; color: white;
      
    }
    .music-artist { font-size: 0.75rem; color: #bbb; }

    /* --- CÁC NÚT ĐIỀU KHIỂN --- */
    .music-controls {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto; /* Đẩy về sát bên phải */
      opacity: 0;
      transition: opacity 0.2s ease;
      flex-shrink: 0; /* Đảm bảo nút không bị bóp méo */
    }

    .music-widget:hover .music-controls {
      opacity: 1;
      transition-delay: 0.1s;
    }
    
    /* ... (Các phần control-btn, svg, progress-bar bên dưới giữ nguyên) ... */
    .control-btn {
      background: none;
      border: none;
      color: white;
      cursor: pointer;
      padding: 5px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }

   .control-btn:hover {
      background: rgba(255,255,255,0.1);
      color: var(--accent); /* Đổi màu icon theo theme */
      transform: scale(1.1);
    }
    .control-btn svg { width: 24px; height: 24px; }
    .play-btn-large svg { width: 34px; height: 34px; }
    
    .progress-bar {
      margin-right: 75px;
      position: absolute;
      bottom: 0;
      left: 60px;
      height: 3px;
      background: var(--accent);
      width: 0%;
      transition: width 0.05s linear;
      border-radius: 10px;
      opacity: 0;
    }
    
    .music-widget:hover .progress-bar { opacity: 1; }
   
  

   
    /* --- STYLE ẢNH --- */
    .sticker-container {
      position: absolute; /* Bay lơ lửng, không chiếm chỗ */
      top: 10px;          /* Cách mép trên 10px */
      right: 10px;        /* Cách mép phải 10px */
      width: 75px;        /* Kích thước nhỏ gọn như con tem */
      height: 75px;
      padding: 3px;       /* Viền trắng nhỏ */
      background: white;  
      box-shadow: 2px 2px 5px rgba(0,0,0,0.2); /* Bóng nhẹ */
      transform: rotate(5deg); /* Nghiêng nhẹ */
      z-index: 10;        /* Luôn nổi lên trên chữ */
      border-radius: 4px;
      transition: all 0.3s ease;
      cursor: pointer;
    }

    /* Hiệu ứng khi di chuột vào: Phóng to để xem rõ */
    .sticker-container:hover {
      transform: scale(1.5) rotate(0deg) translate(-20px, 20px); 
      z-index: 100;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .sticker-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 2px;
    }

    /* --- QUAN TRỌNG: CHỈNH LẠI PHẦN CHỮ --- */
    .message-text {
      padding-right: 0; /* Không cần lùi vào nữa vì ảnh nhỏ */
      width: 100%;      /* Chữ cứ tràn hết chiều ngang */
      min-height: 80px;
      word-break: break-word;
      
      /* Giữ chữ căn giữa dọc, nhưng căn trái ngang cho dễ đọc */
      display: flex;
      align-items: center; 
      padding-right: 0; /* Mặc định không lùi */
      
    }
    
    /* Nếu có ảnh thì dòng đầu tiên của chữ sẽ ngắn lại xíu để tránh ảnh (Optional) */
    .message-text.has-sticker {
       /* Tạo khoảng trống ảo ở góc phải cho ảnh */
       padding-right: 80px;
       shape-outside: margin-box;
       float: left; /* Kỹ thuật wrap text quanh ảnh */
    }

    .message-card.admin-mode::before {
      display: block !important; /* Quan trọng: Ghi đè lệnh ẩn */
      content: '' !important;    /* Quan trọng: Đảm bảo nó là ô vuông, không phải dấu ngoặc kép */
      z-index: 200; /* Đảm bảo nổi lên trên cùng, cao hơn cả ảnh sticker */
    }

    /* --- PHÂN TRANG HIỆN ĐẠI --- */
    .pagination-container {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0.5rem;
      margin-top: 3rem;
      flex-wrap: wrap;
    }

    .page-btn {
      width: 40px;
      height: 40px;
      border-radius: 12px; /* Bo góc mềm mại */
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-dim);
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(5px);
    }

    .page-btn:hover:not(:disabled) {
      transform: translateY(-3px) scale(1.1);
      background: rgba(255, 255, 255, 0.15);
      color: var(--text);
      box-shadow: 0 5px 15px var(--glow);
      border-color: var(--accent);
    }

    .page-btn.active {
      background: var(--accent); /* Màu chủ đạo của theme */
      color: var(--bg-start);   /* Chữ màu tối cho dễ đọc */
      border-color: var(--accent);
      box-shadow: 0 0 20px var(--glow);
      transform: scale(1.1);
    }

    .page-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
      transform: none;
    }

    /* Hiệu ứng bay vào lần lượt (Stagger) cho các thẻ card */
    @keyframes cardEntrance {
      from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* --- ADMIN HUB (NÚT GÓC PHẢI) --- */
    .admin-hub {
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 999;
      display: flex;
      align-items: center;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 50px;
      padding: 5px;
      transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      width: 45px; /* Thu gọn */
      height: 45px;
      overflow: hidden;
      box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }

    .admin-hub:hover {
      width: 280px; /* Mở rộng */
      background: rgba(0, 0, 0, 0.8);
      border-color: var(--accent);
    }

    .hub-icon {
      width: 35px;
      height: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.1);
      border-radius: 50%;
      color: var(--accent);
      flex-shrink: 0;
    }

    .hub-menu {
      display: flex;
      align-items: center;
      margin-left: 10px;
      opacity: 0;
      transition: opacity 0.2s ease 0.1s;
      white-space: nowrap;
    }

    .admin-hub:hover .hub-menu { opacity: 1; }

    .hub-btn {
      background: none; border: none; color: white;
      font-size: 0.85rem; cursor: pointer; padding: 0 5px;
      transition: color 0.2s; font-weight: 500;
    }
    .hub-btn:hover { color: var(--accent); }

    .hub-divider {
      width: 1px; height: 15px; background: rgba(255,255,255,0.2); margin: 0 8px;
    }

    /* --- MODAL GÓP Ý --- */
    .feedback-modal-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.8); z-index: 2000;
      display: flex; justify-content: center; align-items: center;
      opacity: 0; pointer-events: none; transition: opacity 0.3s;
      backdrop-filter: blur(5px);
    }

    .feedback-modal-overlay.active {
      opacity: 1; pointer-events: all;
    }

    .feedback-box {
      width: 90%; max-width: 400px; padding: 2rem;
      background: #1a1a1a; border-radius: 20px;
      border: 1px solid var(--accent);
      box-shadow: 0 20px 50px rgba(0,0,0,0.5);
      transform: translateY(20px); transition: transform 0.3s;
    }

    .feedback-modal-overlay.active .feedback-box { transform: translateY(0); }

    .feedback-header {
      display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
    }
    .feedback-header h3 { margin: 0; color: var(--accent); font-size: 1.3rem; }
    
    .close-btn {
      background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer;
    }
    .close-btn:hover { color: white; }

    /* Nút đang kích hoạt thì sáng màu lên */
    .control-btn.active {
      color: var(--accent);
      text-shadow: 0 0 10px var(--accent); /* Phát sáng */
    }

@view-transition { navigation: auto; }

/* ===== SUBSCRIBE BUTTON ===== */
@keyframes shimmerMove {
  0%   { left: -100%; }
  100% { left: 125%; }
}
.sub-trigger-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  padding: 16px 44px;
  margin: 0 auto;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease, background 0.5s ease;
  animation: ctaPulse 2.5s ease-in-out infinite,
             fadeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  white-space: nowrap;
  justify-content: center;
}
/* Shimmer sweep overlay */
.sub-trigger-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 35%; height: 100%;
  background: linear-gradient(90deg, transparent,
    rgba(255,255,255,0.28), transparent);
  animation: shimmerSweep 2.8s 0.5s ease-in-out infinite;
  pointer-events: none;
}
.sub-trigger-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px var(--glow),
              0 4px 12px var(--glow);
}
.sub-trigger-btn:active { transform: scale(0.98); }
@media (max-width: 768px) {
  .sub-trigger-btn { min-width: 240px; padding: 14px 32px; font-size: 0.9rem; }
}
.sub-trigger-btn svg { flex-shrink: 0; opacity: 1; }


/* ===== SUBSCRIBE MODAL ===== */
#subscribeModal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: smOverlayIn 0.2s ease forwards;
}
@keyframes smOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.sm-card {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 2rem 2rem 1.75rem;
  animation: smCardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes smCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.sm-close-btn {
  position: absolute; top: 1rem; right: 1rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  color: #64748b;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  padding: 0;
}
.sm-close-btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.sm-icon-wrap {
  width: 48px; height: 48px;
  margin: 0 auto 1.25rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(99,102,241,0.15);
}
.sm-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #f8fafc;
  text-align: center;
  letter-spacing: -0.2px;
}
.sm-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #94a3b8;
  text-align: center;
}
.sm-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.9375rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sm-input::placeholder { color: #475569; }
.sm-input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.sm-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #f87171;
}
.submit-btn {
  width: 100%;
  padding: 0.9rem 2rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}
.submit-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent,
              rgba(255,255,255,0.08), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.submit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
.submit-btn:hover::after { left: 120%; }
/* Override scroll-reveal riêng cho nút submit — animation nhẹ & nhanh hơn */
.submit-btn.scroll-reveal {
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.submit-btn.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.sm-submit-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  letter-spacing: 0.1px;
}
.sm-submit-btn:hover:not(:disabled) {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.sm-submit-btn:active:not(:disabled) { transform: translateY(0); }
.sm-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.sm-skip-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: #475569;
  font-size: 0.8125rem;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s;
  padding: 0.25rem;
}
.sm-skip-btn:hover { color: #94a3b8; }
 .robot-companion-wrapper {
            transform: translateY(150%);
            opacity: 0;
            transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s ease-in-out;
        }
        .robot-companion-wrapper.robot-active {
            transform: translateY(0);
            opacity: 1;
        }
        .glass-bubble {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

    /* ======================================================
       FOOTER — theme-aware seamless background
       ====================================================== */
    .site-footer {
      background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
      transition: background 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .footer-logo-text {
      font-size: 1.875rem;        /* text-3xl */
      font-weight: 800;           /* font-extrabold */
      letter-spacing: -0.025em;  /* tracking-tight */
      background: linear-gradient(to right, #34d399, #2dd4bf, #22d3ee);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.5));
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }