/* ============================================
   QUILTT GAMES - Universal Scheduler Styles
   ============================================ */

/* CSS Variables */
:root {
    /* Brand Colors */
    --quiltt-teal: #00A5A8;
    --quiltt-teal-dark: #008587;
    --quiltt-teal-light: #E0F7F7;
    
    /* Pastels */
    --pastel-mint: #D1FAE5;
    --pastel-blue: #DBEAFE;
    --pastel-peach: #FED7AA;
    --pastel-yellow: #FEF3C7;
    --pastel-pink: #FCE7F3;
    --pastel-purple: #EDE9FE;
    
    /* Neutrals */
    --text-dark: #1F2937;
    --text-medium: #4B5563;
    --text-muted: #9CA3AF;
    --text-light: #D1D5DB;
    
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    
    --card-bg: #FFFFFF;
    --card-border: #E5E7EB;
    
    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Fonts */
    --font-display: 'Fredoka', 'Comic Sans MS', sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

p {
    margin: 0 0 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--quiltt-teal) 0%, var(--quiltt-teal-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo svg {
    width: 44px;
    height: 44px;
}

.header-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.header-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

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

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

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

.btn-secondary {
    background: white;
    color: var(--quiltt-teal);
    border: 2px solid var(--quiltt-teal);
}

.btn-secondary:hover {
    background: var(--quiltt-teal-light);
}

.btn-ghost {
    background: transparent;
    color: var(--quiltt-teal);
}

.btn-ghost:hover {
    background: var(--quiltt-teal-light);
}

.btn-danger {
    background: #FEE2E2;
    color: var(--error);
}

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

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1.125rem;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--quiltt-teal);
    box-shadow: 0 0 0 3px var(--quiltt-teal-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-teal {
    background: var(--pastel-mint);
    color: var(--quiltt-teal-dark);
}

.badge-blue {
    background: var(--pastel-blue);
    color: #2563EB;
}

.badge-yellow {
    background: var(--pastel-yellow);
    color: #B45309;
}

.badge-red {
    background: #FEE2E2;
    color: var(--error);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--quiltt-teal);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-top: 0.5rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-medium);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--card-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.875rem 1.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-medium);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.tab:hover {
    color: var(--quiltt-teal);
}

.tab.active {
    color: var(--quiltt-teal);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--quiltt-teal);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--quiltt-teal);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Login Screens */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--quiltt-teal) 0%, var(--quiltt-teal-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-screen.hidden {
    display: none;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-medium);
    margin-bottom: 2rem;
}

/* Game Cards */
.game-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-card:hover {
    border-color: var(--quiltt-teal);
    background: var(--quiltt-teal-light);
}

.game-card.selected {
    border-color: var(--quiltt-teal);
    background: var(--quiltt-teal-light);
}

.game-card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.game-card-info h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
}

.game-card-info p {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin: 0;
}

/* Link Boxes */
.link-group {
    margin-bottom: 1.25rem;
}

.link-group-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-group-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: normal;
}

.link-box {
    display: flex;
    gap: 0.5rem;
}

.link-box input {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.link-box .btn {
    flex-shrink: 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-teal {
    color: var(--quiltt-teal);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Checkbox toggles */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-item:hover {
    background: var(--quiltt-teal-light);
}

.toggle-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--quiltt-teal);
}

.toggle-item-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.875rem 1rem;
    }
    
    .header-title {
        font-size: 1.1rem;
    }
    
    .header-subtitle {
        font-size: 0.8rem;
    }
    
    .card {
        padding: 1.25rem;
    }
}
