/* =========================================
   1. VARIABLES & RESET
   ========================================= */
   :root {
    /* Color Palette - Modern Deep Space */
    --bg-body: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    
    --primary: #38bdf8; /* Cyan Glow */
    --secondary: #818cf8; /* Indigo Glow */
    --accent: #f472b6; /* Pink Glow */

    /* Backwards-compatible aliases used across individual pages */
    --brand-1: var(--primary);
    --brand-2: var(--secondary);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-secondary: var(--text-muted);
    --surface-1: rgba(255,255,255,0.06);
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: 1px solid rgba(148, 163, 184, 0.1);
    --glass-highlight: 1px solid rgba(255, 255, 255, 0.1);
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.16);
    --glow-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-body);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(129, 140, 248, 0.15) 0px, transparent 50%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.header {
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: var(--glass-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 1.8rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 99px; /* Pill shape */
    border: var(--glass-border);
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.main {
    padding: 6rem 0;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    min-height: 60vh;
    margin-bottom: 6rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

/* Text Gradient Effect */
.hero-title span, 
.hero-title {
    background: linear-gradient(to right, #fff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modern Buttons */
.btn {
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-body);
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-github {
    background: #24292e;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Floating Visual */
.floating-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: var(--glass-highlight);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    position: relative;
    box-shadow: var(--glow-shadow);
    animation: float 6s ease-in-out infinite;
}

/* Glowing decoration behind card */
.floating-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), transparent);
    z-index: -1;
    border-radius: 26px;
    opacity: 0.3;
    filter: blur(10px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.4));
}

/* =========================================
   4. FEATURES SECTION (Bento Grid Style)
   ========================================= */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   5. HISTORY / TIMELINE
   ========================================= */
.history-section {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 4rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.timeline-item:nth-child(odd) { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }

.timeline-date {
    background: rgba(15, 23, 42, 1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.9rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.timeline-content {
    width: 45%;
    background: rgba(30, 41, 59, 0.6);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: 0.3s;
}

.timeline-content:hover {
    border-color: var(--secondary);
    background: rgba(30, 41, 59, 0.9);
}

.timeline-item:nth-child(odd) .timeline-content { margin-right: auto; text-align: right; }
.timeline-item:nth-child(even) .timeline-content { margin-left: auto; text-align: left; }

/* =========================================
   6. FOOTER
   ========================================= */
.footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .nav-menu { display: none; } /* Cần JS để toggle menu */
    
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-title { font-size: 2.8rem; }
    
    .hero-buttons { justify-content: center; }
    
    /* Timeline Mobile */
    .timeline::before { left: 20px; }
    
    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 50px;
    }
    
    .timeline-date {
        position: relative;
        left: 0;
        transform: none;
        margin-bottom: 1rem;
        display: inline-block;
    }
    
    .timeline-content {
        width: 100%;
        text-align: left !important;
        margin: 0 !important;
    }
}

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

.hero-content, .feature-card {
    animation: fadeInUp 0.8s ease-out;
} 

/* =========================================
   GALLERY SLIDER - REMAKE STYLE
   ========================================= */

   .gallery-section {
    padding: 2rem 0 5rem 0;
    position: relative;
    /* Xóa background cũ, để lộ nền vũ trụ của body */
    background: transparent; 
  }
  
  .gallery-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    
    /* Hiệu ứng khung kính công nghệ cao */
    background: rgba(15, 23, 42, 0.6); /* Nền tối mờ */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.2); /* Viền xanh Cyan mờ */
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.1); /* Glow nhẹ */
  }
  
  .gallery-slider {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); /* Hiệu ứng trượt mượt kiểu iOS */
  }
  
  .gallery-slide {
    min-width: 100%;
    position: relative;
  }
  
  .gallery-image {
    width: 100%;
    height: 480px; /* Tăng chiều cao để nhìn rõ ảnh OS */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617; /* Nền đen sâu để tôn ảnh */
    overflow: hidden;
  }
  
.gallery-image img {
  width: 100%;
  height: 100%;
    object-fit: contain; /* Giữ nguyên tỉ lệ ảnh, không bị cắt */
    transition: transform 0.7s ease;
  }
  
  /* Hiệu ứng zoom nhẹ khi di chuột vào ảnh */
  .gallery-container:hover .gallery-image img {
    transform: scale(1.03);
  }
  
  .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* Gradient đen mờ dần lên để dễ đọc chữ */
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.6) 60%, transparent 100%);
    padding: 3rem 2rem 1.5rem;
    color: var(--text-main);
    text-align: left;
    z-index: 5;
  }
  
  .gallery-caption h3 {
    margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary); /* Màu Cyan */
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  }
  
  .gallery-caption p {
    margin: 0;
    opacity: 0.8;
    font-size: 1rem;
    color: var(--text-muted);
  }
  
  /* Nút điều hướng (Mũi tên) */
  .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    width: 48px;
    height: 48px;
    border-radius: 50%; /* Hình tròn */
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }
  
  .gallery-nav:hover {
    background: var(--primary);
    color: #0f172a; /* Chữ đen trên nền sáng */
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6); /* Glow mạnh khi hover */
    border-color: var(--primary);
  }
  
  .gallery-nav.prev { left: 20px; }
  .gallery-nav.next { right: 20px; }
  
  /* Dấu chấm điều hướng */
  .gallery-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
  }
  
  .gallery-dot {
    width: 40px; /* Dạng thanh dài thay vì chấm tròn */
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .gallery-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    width: 60px; /* Dài hơn khi active */
  }
  
  .gallery-note {
    text-align: center;
    padding: 1rem;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.6;
  }
  
  /* Mobile Responsive */
  @media (max-width: 768px) {
    .gallery-image {
      height: 280px; /* Thấp hơn trên điện thoại */
    }
    
  .gallery-nav {
    width: 36px;
    height: 36px;
    font-size: 1rem;
      background: rgba(0,0,0,0.6); /* Đậm hơn để dễ nhìn */
    }
    
    .gallery-caption {
      padding: 2rem 1rem 1rem;
      text-align: center;
    }
  
    .gallery-caption h3 { font-size: 1.2rem; }
    .gallery-caption p { font-size: 0.9rem; }
  }
/* === GLOBAL HELPERS: glassmorphism, animations, theme helpers === */
.remake-badge { position: fixed; bottom: 20px; right: 20px; background: linear-gradient(90deg,var(--brand-1),var(--brand-2)); color: #032; padding: 0.45rem 0.9rem; border-radius: 999px; font-weight:700; box-shadow: 0 8px 30px rgba(40,120,255,0.16); z-index:2000; }
.toast { position: fixed; top: 18px; right: 18px; z-index:2001; }
.fade { transition: opacity .28s ease, transform .28s ease; }
.show { opacity:1 !important; transform: none !important; }
.hidden { opacity:0; transform: translateY(10px); pointer-events:none; }

/* Theme helpers for light readability */
body.light-mode { background: linear-gradient(180deg,#f6fbff 0%, #eef6ff 100%); color: #111; }
body.light-mode .header { background: rgba(255,255,255,0.8); border-bottom: 1px solid rgba(0,0,0,0.06); color: #111; }
body.light-mode .nav-menu { background: rgba(0,0,0,0.03); }
body.light-mode .nav-link { color: #334155; }
body.light-mode .btn-primary { background: #0b69d3; color: #fff; }
body.light-mode .floating-card { background: rgba(255,255,255,0.85); color: #0b1220; box-shadow: 0 10px 40px rgba(10,25,40,0.06); border: 1px solid rgba(0,0,0,0.06); }

/* Utility spacing helpers */
.u-center { display:flex; align-items:center; justify-content:center; }
.u-gap { gap:1rem; }

@keyframes accentPulse { 0% { box-shadow: 0 0 0 rgba(56,189,248,0.12);} 50% { box-shadow: 0 0 24px rgba(56,189,248,0.18);} 100% { box-shadow: 0 0 0 rgba(56,189,248,0.12);} }

/* Ensure standard background-clip property for broader compatibility */
.logo-icon,
.hero-title,
.hero-title span,
.section-title {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Light-mode readable overrides */
body.light-mode .hero-title,
body.light-mode .section-title {
  background: none !important;
  -webkit-text-fill-color: initial !important;
  color: #0b1220 !important;
  text-shadow: none !important;
}
