/* ============================================
   StudyHub - Base Styles
   Clean, Professional Design
   ============================================ */

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

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

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-body);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

[data-theme="dark"] body::before {
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* === Links === */
a {
    color: inherit;
    text-decoration: none;
}

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

/* === Inputs === */
input,
textarea {
    font-family: inherit;
    font-size: inherit;
}

input:focus,
textarea:focus,
button:focus {
    outline: none;
}

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

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

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

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

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

/* === Selection === */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}

/* === Utility Classes === */
.text-brand {
    color: var(--color-brand);
}

.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;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}