/**
 * Base Styles - Reset & Global Styles
 * Author: datvd
 * Created: 2026-01-23
 * Description: CSS reset và các styles cơ bản cho ứng dụng
 */

/* ==================== CSS Reset ==================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== Typography ==================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

strong,
b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ==================== Lists ==================== */

ul,
ol {
    list-style: none;
}

/* ==================== Media ==================== */

img,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    object-fit: cover;
}

/* ==================== Forms ==================== */

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* Remove autofill styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-surface) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==================== Tables ==================== */

table {
    width: 100%;
    border-collapse: collapse;
}

/* ==================== Selection ==================== */

::selection {
    background-color: rgba(var(--primary-rgb), 0.3);
    color: var(--text-primary);
}

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) var(--bg-dark);
}

/* ==================== Focus States ==================== */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==================== Screen Reader Only ==================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== Container ==================== */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 0 var(--space-8);
    }
}

/* ==================== Main Content Area ==================== */

.main-content {
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + var(--space-4));
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: var(--space-8);
    }
}

/* ==================== Page Sections ==================== */

.section {
    padding: var(--space-2) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-1) 0;
    }
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .section-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-6);
    }
}

/* ==================== Hidden Utilities ==================== */

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* Hide on specific breakpoints */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .show-desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .show-mobile-only {
        display: none !important;
    }
}