/**
 * Marker Music - Base CSS
 *
 * Struktur, Layout, Komponenten (ohne Farben)
 * Farben kommen aus themes/*.css
 *
 * Mobile-First: Base = Mobile, dann @media fuer groessere Screens
 */

/* ==========================================================================
   Reset & Box Model
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.5;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   Design Tokens (Strukturell)
   ========================================================================== */

:root {
    /* Spacing Scale (8px-basiert) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Typography Scale */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.5rem;     /* 24px */
    --text-2xl: 2rem;      /* 32px */
    --text-3xl: 2.5rem;    /* 40px - Mobile-friendly */

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Touch Target (Apple HIG) */
    --touch-target: 44px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-Index Scale */
    --z-base: 1;
    --z-overlay: 10;
    --z-modal: 100;
    --z-toast: 200;

    /* Container */
    --container-sm: 480px;
    --container-md: 640px;
    --container-lg: 800px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p {
    margin-bottom: var(--space-4);
}

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

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

/* ==========================================================================
   Buttons
   ========================================================================== */

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target);
    padding: var(--space-3) var(--space-5);
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                background var(--transition-fast);
    -webkit-user-select: none;
    user-select: none;
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-text);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-hover);
}

/* Secondary Button */
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

/* Tertiary Button */
.btn-tertiary {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
}

.btn-tertiary:hover {
    background: var(--color-surface);
    color: var(--color-text);
    border-style: solid;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text);
}

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

/* ==========================================================================
   Form Elements
   ========================================================================== */

input, select, textarea {
    min-height: var(--touch-target);
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-height: auto;
    accent-color: var(--color-primary);
    cursor: pointer;
}

input[type="number"] {
    text-align: center;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-md);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

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

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* ==========================================================================
   Card / Surface
   ========================================================================== */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

/* ==========================================================================
   Section Labels
   ========================================================================== */

.section-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* ==========================================================================
   Hidden Utility
   ========================================================================== */

.hidden {
    display: none !important;
}

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

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Tablet+ (min-width: 768px)
   ========================================================================== */

@media (min-width: 768px) {
    :root {
        --text-3xl: 3rem; /* 48px on larger screens */
    }

    .container {
        padding: 0 var(--space-6);
    }
}
