/* =============================================
   KidsDreamEvery - Base Styles & Reset
   ============================================= */

@import url('./variables.css');

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 50%, var(--sky-bottom) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography Base ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: 1.3;
    color: var(--text-dark);
}

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: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--rainbow-blue);
}

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

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

/* ===== Buttons ===== */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

button:focus-visible {
    outline: 3px solid var(--rainbow-blue);
    outline-offset: 2px;
}

/* ===== Form Elements ===== */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Selection ===== */
::selection {
    background: var(--cat-songs);
    color: var(--text-dark);
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--rainbow-blue), var(--rainbow-purple));
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--rainbow-purple), var(--rainbow-pink));
}

/* ===== Focus States (Accessibility) ===== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--rainbow-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: var(--text-white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    z-index: var(--z-toast);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* ===== 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(--max-width-xl);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.container-sm { max-width: var(--max-width-sm); }
.container-md { max-width: var(--max-width-md); }
.container-lg { max-width: var(--max-width-lg); }

/* ===== Section Spacing ===== */
.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-8) 0;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.hidden { display: none; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ===== Responsive Visibility ===== */
@media (max-width: 639px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hide-tablet { display: none !important; }
}

@media (min-width: 1024px) {
    .hide-desktop { display: none !important; }
}

@media (max-width: 1023px) {
    .show-desktop-only { display: none !important; }
}

@media (min-width: 640px) {
    .show-mobile-only { display: none !important; }
}
