/* MarkJr Command Center - Web App Styles */
/* Matches the desktop app design: dark theme, pink/blue/purple accents */

:root {
    --bg-main: #1A1A1A;
    --bg-sidebar: #202020;
    --bg-card: #222222;
    --bg-nested: #262626;
    --bg-hover: #2E2E2E;
    --bg-input: #282828;
    --pink: #F472B6;
    --pink-dark: #EC4899;
    --blue: #60A5FA;
    --blue-dark: #3B82F6;
    --purple: #A78BFA;
    --purple-dark: #8B5CF6;
    --green: #4ADE80;
    --red: #F87171;
    --yellow: #FBBF24;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --text-muted: #888888;
    --text-dim: #666666;
    --border: #2A2A2A;
    --border-light: #333333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.app {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar (Desktop) === */
.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.15s;
}

.nav-item:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: rgba(167, 139, 250, 0.15);
    color: var(--text-primary);
    border-left: 3px solid var(--purple);
    padding-left: 17px;
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Sidebar widgets */
.sidebar-widgets {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.twst-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.twst-widget .twst-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.twst-widget .twst-days {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0;
}

.twst-widget .twst-date {
    font-size: 12px;
    color: var(--text-muted);
}

.stats-row {
    display: flex;
    gap: 8px;
}

.stat-mini {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.stat-mini .stat-value {
    font-size: 18px;
    font-weight: 700;
}

.stat-mini .stat-value.pink { color: var(--pink); }
.stat-mini .stat-value.blue { color: var(--blue); }

.stat-mini .stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* === Main content === */
.main {
    flex: 1;
    margin-left: 250px;
    padding: 24px;
    max-width: 1200px;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 700;
}

/* === Pill labels === */
.pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.pill-pink { background-color: var(--pink); }
.pill-blue { background-color: var(--blue); }
.pill-purple { background-color: var(--purple); }

/* === Cards === */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.card-row .card {
    flex: 1;
    min-width: 280px;
}

/* === Recording cards === */
.recording-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--pink);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.recording-card.lane-patreon { border-left-color: var(--blue); }
.recording-card.lane-community { border-left-color: var(--purple); }
.recording-card.lane-twst { border-left-color: var(--green); }

.recording-info h3 {
    font-size: 16px;
    font-weight: 600;
}

.recording-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.lane-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lane-badge.youtube { background-color: rgba(244, 114, 182, 0.2); color: var(--pink); }
.lane-badge.patreon { background-color: rgba(96, 165, 250, 0.2); color: var(--blue); }
.lane-badge.community { background-color: rgba(167, 139, 250, 0.2); color: var(--purple); }
.lane-badge.twst { background-color: rgba(74, 222, 128, 0.2); color: var(--green); }

/* === Checkboxes === */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-input);
    transition: all 0.15s;
    white-space: nowrap;
}

.status-toggle:hover {
    border-color: var(--pink);
}

.status-toggle.done {
    background-color: rgba(74, 222, 128, 0.15);
    border-color: var(--green);
    color: var(--green);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--blue));
    color: white;
}

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

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

/* === Schedule grid === */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.day-column {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    min-height: 200px;
}

.day-column.today {
    border-color: var(--pink);
}

.day-column h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.day-column .day-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.day-show {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid var(--pink);
    background-color: var(--bg-nested);
}

.day-show.lane-patreon { border-left-color: var(--blue); }
.day-show.lane-community { border-left-color: var(--purple); }
.day-show.lane-twst { border-left-color: var(--green); }

.day-show .show-ep {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* === Planner === */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--pink);
}

.show-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.show-card img {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.show-card-content {
    flex: 1;
    min-width: 0;
}

.show-card-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.show-card-content .show-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.show-card-content .show-genres {
    font-size: 12px;
    color: var(--text-muted);
}

.viability-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.viability-badge.high {
    background-color: rgba(74, 222, 128, 0.15);
    color: var(--green);
    border: 2px solid var(--green);
}

.viability-badge.medium {
    background-color: rgba(251, 191, 36, 0.15);
    color: var(--yellow);
    border: 2px solid var(--yellow);
}

.viability-badge.low {
    background-color: rgba(248, 113, 113, 0.15);
    color: var(--red);
    border: 2px solid var(--red);
}

/* === Progress bar === */
.progress-bar {
    height: 8px;
    background-color: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 4px;
    transition: width 0.3s ease;
}

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

.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--pink);
}

.form-group .form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Setup guide === */
.setup-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.setup-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--pink);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.setup-step-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.setup-step-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.setup-step-content code {
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* === Chart === */
.chart-container {
    position: relative;
    height: 200px;
    margin-top: 8px;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
}

/* === Mobile top bar === */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    z-index: 100;
}

.mobile-topbar h1 {
    font-size: 18px;
    font-weight: 700;
}

/* === Mobile bottom nav === */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
}

.mobile-nav-item.active {
    color: var(--pink);
}

.mobile-nav-item .nav-icon {
    font-size: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-topbar {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 70px 16px 90px;
    }

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

    .day-column {
        min-height: auto;
    }

    .view-header h2 {
        font-size: 22px;
    }

    .show-card {
        flex-direction: column;
    }

    .show-card img {
        width: 100%;
        height: 120px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .schedule-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
