/**
 * Playlist - Base Styles
 * Shared CSS variables, reset, and common component styles for all pages
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-hover: #f1f5f9;
    --text: #1e293b;
    --text-dim: #64748b;
    --accent: #0284c7;
    --accent-light: #e0f2fe;
    --accent-dark: #0369a1;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

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

/* ============================================
   Base body styles
   ============================================ */
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============================================
   Card
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
}

/* ============================================
   Back Link
   ============================================ */
.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 24px;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
}

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

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

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dim);
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.available {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.full {
    background: #fee2e2;
    color: var(--error);
}

.status-badge.cancelled {
    background: #e2e8f0;
    color: #64748b;
}

.status-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ============================================
   Messages
   ============================================ */
.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
}

.error-message {
    background: var(--error-light);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ============================================
   Loading Spinner on Buttons
   ============================================ */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
