/* ==========================================================================
   BASE STYLES - public/css/base.css
   Base styles and variables for the entire application
   ========================================================================== */

:root {
    /* Color Variables */
    --primary-color: #fae635;
    --secondary-color: #3a86ff;
    --primary-rgb: 250, 230, 53;
    --secondary-rgb: 107, 208, 250;

    /* Background Colors */
    --bg-dark: #0a0a0a;
    --bg-dark-secondary: #1a1a2e;
    --bg-dark-tertiary: #16213e;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #dddddd;
    --text-muted: #888888;
    --text-dark: #000000;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 15px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-round: 50%;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    --shadow-secondary: 0 4px 12px rgba(var(--secondary-rgb), 0.3);

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-tooltip: 500;
}

/* Fixed universal selector - removed max-width: 100% that breaks fixed elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.main-container,
.horizontal-container,
.news-section,
.main-card,
.cards-grid {
    box-sizing: border-box !important;
}

/* Replaced 100vw with 100% to avoid scrollbar width issues */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'system-ui';
    background: linear-gradient(
        135deg,
        var(--bg-dark) 0%,
        var(--bg-dark-secondary) 50%,
        var(--bg-dark-tertiary) 100%
    );
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    position: relative;
    min-height: 100vh;
}

/* Per-page white background helper */
body.page-white {
    background: #ffffff !important;
    color: #000000;
}
body.page-white .bg-grid { display: none; }

/* Simplified home page styles - removed conflicting overflow rules */
body.home-page {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Scrollbar Style - subtle transparent look */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); /* Màu trắng mờ nhẹ */
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); /* Sáng hơn khi hover */
}

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

html,
body {
    overflow-y: auto; /* vẫn cuộn được */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE, Edge cũ */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}
h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}
h3 {
    font-size: clamp(1.25rem, 3vw, 2rem);
}
h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}
h5 {
    font-size: clamp(1rem, 2vw, 1.25rem);
}
h6 {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

p {
    margin-bottom: 1em;
}

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

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

/* Utility Classes */
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

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

.bg-primary {
    background-color: var(--primary-color);
}
.bg-secondary {
    background-color: var(--secondary-color);
}

.gradient-primary {
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--secondary-color)
    );
}

.gradient-primary-text {
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--secondary-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Utilities */
.hide-mobile {
    display: block;
}
.show-mobile {
    display: none;
}
.hide-tablet {
    display: block;
}
.show-tablet {
    display: none;
}
.hide-desktop {
    display: block;
}
.show-desktop {
    display: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    min-height: 44px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-dark);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-dark);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
    min-height: 44px;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --primary-color: #fff000;
        --secondary-color: #00bfff;
    }

    .card {
        border-width: 2px;
        border-color: var(--primary-color);
    }
}

/* Media Queries */
@media (max-width: 480px) {
    .hide-mobile {
        display: none;
    }
    .show-mobile {
        display: block;
    }

    body {
        font-size: 14px;
    }

    .container,
    .container-fluid {
        padding: 0 var(--spacing-sm);
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .hide-tablet {
        display: none;
    }
    .show-tablet {
        display: block;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
    .show-desktop {
        display: block;
    }
}
