/* MyPod — Custom styles (supplements PicoCSS) */

:root {
    --mypod-primary: #6366f1;
    --mypod-primary-hover: #4f46e5;
    --mypod-success: #22c55e;
    --mypod-warning: #f59e0b;
    --mypod-danger: #ef4444;
    --mypod-info: #3b82f6;
    --mypod-bg: #fafafa;
    --mypod-surface: #ffffff;
    --mypod-text: #1e293b;
    --mypod-text-muted: #64748b;
}

/* Override Pico primary color */
[data-theme="light"],
:root:not([data-theme="dark"]) {
    --pico-primary: var(--mypod-primary);
    --pico-primary-hover: var(--mypod-primary-hover);
}

/* ── Layout ──────────────────────────────────────────────────────── */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* ── Navigation ──────────────────────────────────────────────────── */
.site-header {
    background: var(--mypod-surface);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--mypod-text);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.nav-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mypod-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.nav-user-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.nav-user-menu[open] ul {
    position: absolute;
    right: 0;
    background: var(--mypod-surface);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-user-menu {
    position: relative;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--mypod-primary);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

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

.btn-large {
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
}

.btn-signin {
    background: var(--mypod-surface);
    color: var(--mypod-text);
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: border-color 0.15s;
}

.btn-signin:hover {
    border-color: var(--mypod-primary);
    color: var(--mypod-primary);
}

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

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

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

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: #f1f5f9; color: #475569; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
    background: var(--mypod-surface);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--mypod-text);
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
    border-color: var(--mypod-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.create-group-card {
    border-style: dashed;
    border-color: #cbd5e1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-group-card:hover {
    border-color: var(--mypod-primary);
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 6rem 1rem 4rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--mypod-text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Steps ───────────────────────────────────────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0 4rem;
    text-align: center;
}

.step-card h3 {
    margin-bottom: 0.5rem;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-message {
    color: var(--mypod-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ── Audio player ────────────────────────────────────────────────── */
.audio-player-wrapper {
    margin: 1rem 0;
}

.audio-player-wrapper audio {
    width: 100%;
}

.audio-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* ── Misc ────────────────────────────────────────────────────────── */
.text-muted {
    color: var(--mypod-text-muted);
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--mypod-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

/* ── Invite rows ────────────────────────────────────────────────── */
.invite-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.invite-row:last-child {
    border-bottom: none;
}

.invite-row-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.add-another-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

/* ── Role select ────────────────────────────────────────────────── */
.role-select {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: var(--mypod-surface);
    min-width: 90px;
    margin: 0;
}

/* ── Small buttons ──────────────────────────────────────────────── */
.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-weight: 600;
    background: var(--mypod-surface);
    color: var(--mypod-text);
    display: inline-block;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-small:hover {
    background: #f1f5f9;
}

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

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

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

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

/* ── Danger zone ────────────────────────────────────────────────── */
.danger-zone-content {
    border: 1px solid var(--mypod-danger);
    border-radius: 8px;
    padding: 1.25rem;
    background: #fef2f2;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .invite-row-fields {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    .role-select {
        min-width: auto;
    }
}
