/* FlashDeckoo main styles */

:root {
    --primary: #6366f1;
    --primary-focus: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --neutral: #1f2937;
    --base-100: #ffffff;
    --base-200: #f3f4f6;
    --base-300: #e5e7eb;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--base-200);
    color: var(--neutral);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    list-style: none;
}

.navbar-nav a {
    color: var(--neutral);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.2s;
    font-size: 0.95rem;
}

.navbar-nav a:hover {
    background: var(--base-200);
    color: var(--primary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    overflow: visible;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Cards (UI cards, not flashcards) */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Deck grid */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.deck-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.deck-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.deck-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.deck-card p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.deck-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Tags */
.tag {
    display: inline-block;
    background: var(--base-200);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.78rem;
    font-weight: 500;
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
}

.tag-group {
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.4rem;
    line-height: 1.4;
}

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

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

.btn-secondary {
    background: var(--base-300);
    color: var(--neutral);
}

.btn-secondary:hover {
    background: #d1d5db;
}

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

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

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

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

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

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

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--base-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: white;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: auto;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--base-300);
}

th {
    font-weight: 600;
    background: var(--base-200);
}

tr:hover {
    background: #f9fafb;
}

/* Hero / Landing */
.hero {
    text-align: center;
    padding: 3rem 1.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.15rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* Category sections */
.category-section {
    margin-bottom: 2rem;
}

.category-section h2 {
    font-size: 1.35rem;
    color: var(--neutral);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--base-300);
}

/* Progress bar */
.progress-bar {
    background: var(--base-300);
    border-radius: 1rem;
    height: 0.5rem;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 1rem;
    transition: width 0.3s ease;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Badge display */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge-item {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 120px;
}

.badge-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.35rem;
}

.badge-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-rank {
    font-weight: 700;
    color: var(--primary);
    min-width: 2rem;
}

.leaderboard-rank.gold { color: #f59e0b; }
.leaderboard-rank.silver { color: #9ca3af; }
.leaderboard-rank.bronze { color: #d97706; }

/* PIN display */
.pin-display {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    background: var(--base-200);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    display: inline-block;
    color: var(--primary);
}

/* Join page */
.join-card {
    max-width: 450px;
    margin: 3rem auto;
    text-align: center;
}

.join-card .form-control {
    text-align: center;
    font-size: 1.15rem;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #9ca3af; }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }

/* Mobile responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .deck-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }
}
