/**
 * LaravelKit Admin - Base Styles
 * Reset, typography, and foundational styles
 */

/* ===== Alpine.js FOUC Prevention ===== */
/* Must be defined before Alpine initializes to hide [x-cloak] elements */
[x-cloak] { display: none !important; }

/* ===== CSS Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); font-weight: var(--font-bold); }
h4 { font-size: var(--text-base); font-weight: var(--font-semibold); }
h5 { font-size: var(--text-sm); font-weight: var(--font-semibold); }
h6 { font-size: var(--text-sm); font-weight: var(--font-medium); }

p {
    margin: 0 0 var(--space-3) 0;
}

p:last-child {
    margin-bottom: 0;
}

/* ===== Links ===== */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

a:focus {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 2px;
}

/* ===== Lists ===== */
ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ===== Images ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Tables ===== */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ===== Buttons & Inputs Reset ===== */
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ===== Focus Styles ===== */
:focus {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 2px;
}

/* ===== Selection ===== */
::selection {
    background-color: var(--primary-light);
    color: var(--text-primary);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* ===== Text Utilities ===== */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

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

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

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

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
