/* My Yarn Stash - Base CSS (Shared across all pages) */

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

:root {
    --color-bg: #f6f6f8;
    --color-surface: #ffffff;
    --color-primary: #6565f1;
    --color-primary-hover: #4f46e5;
    --color-text: #0e0e1b;
    --color-text-muted: #4d4d99;
    --color-text-light: #8d8dbd;
    --color-border: #e7e7f3;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-coral: #ff7e67;
    --color-lavender: #a78bfa;
    --radius: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 10px 15px -3px rgba(101, 101, 241, 0.2);
}

/* === Dark Mode Variables === */
html.dark {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #a8b5c7;
    --color-text-light: #cbd5e1;
    --color-border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    margin: 0;
}

/* === Material Symbols === */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    -webkit-font-smoothing: antialiased;
    /* Scale with font-size for proper alignment */
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    overflow: hidden;
}

/* === Logo Gradient === */
.logo-gradient {
    background: linear-gradient(180deg, var(--color-coral) 0%, var(--color-lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Cursive Font === */
.font-cursive {
    font-family: 'Pacifico', cursive;
}

/* === Typography === */
h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin-bottom: 0.5rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

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

.btn-link {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.15s ease;
    font-family: inherit;
}

.btn-link:hover {
    color: var(--color-text);
    background: none;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-pill {
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.5rem;
}

/* Standalone pill button (no color class) - uses secondary style */
.btn-pill:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-white) {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-pill:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-white):hover {
    background: var(--color-bg);
}

.btn-white {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-white:hover {
    background: var(--color-bg);
}

.btn:disabled,
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* === Loading & Empty States === */
.loading, .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

/* === Animations === */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Error Page === */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    width: 100%;
}

/* When inside landing-main, fill the available space */
.landing-main .error-page {
    min-height: 100%;
    flex: 1;
}

/* Make landing-main a flex container when it has error-page */
.landing-main:has(.error-page) {
    display: flex;
    flex-direction: column;
}

.error-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.error-icon-large {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.error-code {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.error-description {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error content wrapper (for partials/cards) */
.error-content-wrapper {
    text-align: center;
    padding: 1.5rem;
}

.error-content-wrapper .error-icon-large {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-content-wrapper .error-title {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.error-content-wrapper .error-description {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.error-content-wrapper .error-actions {
    gap: 0.5rem;
}

/* === Footer === */
footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
