/* Zodiac Content Engine — Main Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #1a1a2e;
    border-right: 1px solid #2a2a4a;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2a4a;
}

.sidebar-header h2 {
    color: #a78bfa;
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
}

.nav-links li a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: #b0b0c0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover {
    background: #2a2a4a;
    color: #fff;
}

.nav-links li a.active {
    background: #2a2a4a;
    color: #a78bfa;
    border-left: 3px solid #a78bfa;
}

.nav-links li a.disabled {
    color: #555;
    cursor: not-allowed;
}

/* Main content */
.content {
    margin-left: 220px;
    padding: 2rem;
    flex: 1;
    max-width: 1100px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #fff;
}

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

.stat-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #7c3aed; color: #fff; }
.btn-secondary { background: #374151; color: #e0e0e0; }
.btn-success { background: #059669; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

/* Actions bar */
.actions-bar {
    margin-bottom: 1rem;
}

/* Status banner */
.status-banner {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.status-banner.info { background: #1e3a5f; color: #93c5fd; }
.status-banner.success { background: #14532d; color: #86efac; }
.status-banner.error { background: #7f1d1d; color: #fca5a5; }
.status-banner.hidden { display: none; }

/* Sections */
.section {
    margin-top: 2rem;
}

.section h2 {
    font-size: 1.15rem;
    color: #d0d0e0;
    margin-bottom: 1rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #2a2a4a;
}

.filters-bar label {
    font-size: 0.85rem;
    color: #b0b0c0;
}

.filters-bar select {
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    margin-left: 0.35rem;
}

/* Event cards */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: border-color 0.15s;
}

.event-card:hover {
    border-color: #7c3aed;
}

.event-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.event-card h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.event-card p {
    font-size: 0.85rem;
    color: #b0b0c0;
    line-height: 1.4;
}

.event-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #777;
}

.event-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.event-score {
    font-size: 0.78rem;
    color: #a78bfa;
    font-weight: 600;
}

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

.badge-fight { background: #dc2626; color: #fff; }
.badge-breakup { background: #9333ea; color: #fff; }
.badge-hookup { background: #ec4899; color: #fff; }
.badge-reveal { background: #f59e0b; color: #000; }
.badge-elimination { background: #6b7280; color: #fff; }
.badge-wedding { background: #10b981; color: #fff; }
.badge-reunion { background: #3b82f6; color: #fff; }
.badge-drama { background: #ef4444; color: #fff; }

.badge-status-pending { background: #ca8a04; color: #000; }
.badge-status-approved { background: #059669; color: #fff; }
.badge-status-rejected { background: #dc2626; color: #fff; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 101;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: #fff; }

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.detail-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.detail-summary,
.detail-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #c0c0d0;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Placeholder text */
.placeholder {
    color: #666;
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

/* ---------- Post Creator ---------- */

/* Type tabs */
.post-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #2a2a4a;
}

.post-tab {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b0b0c0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.post-tab:hover { color: #fff; }
.post-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }

/* Panels */
.post-panel { margin-bottom: 2rem; }
.post-panel.hidden { display: none; }

.form-section {
    margin-bottom: 1rem;
}

.form-section label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.form-section select,
.form-section input,
.form-section textarea {
    width: 100%;
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
}

.form-section textarea { resize: vertical; }

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

/* Event preview */
.event-preview {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.event-preview.hidden { display: none; }

.event-preview h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.event-preview p {
    font-size: 0.82rem;
    color: #b0b0c0;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Preview panel */
.preview-panel {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.preview-panel.hidden { display: none; }

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

.preview-header h2 {
    font-size: 1.15rem;
    color: #fff;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.preview-hook {
    margin-bottom: 1rem;
}

.preview-hook label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.hook-input {
    width: 100%;
    background: #0f0f1a;
    color: #fff;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Platform tabs */
.platform-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #2a2a4a;
    margin-bottom: 1rem;
}

.platform-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b0b0c0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.platform-tab:hover { color: #fff; }
.platform-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }

/* Platform panes */
.platform-pane.hidden { display: none; }

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

.char-count {
    font-size: 0.78rem;
    color: #888;
}

.platform-textarea {
    width: 100%;
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

.hashtag-section {
    margin-top: 0.75rem;
}

.hashtag-section label {
    display: block;
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.hashtag-textarea {
    width: 100%;
    background: #0f0f1a;
    color: #a78bfa;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-family: inherit;
    resize: vertical;
}

/* Post cards (recent posts list) */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.post-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s;
}

.post-card:hover { border-color: #7c3aed; }

.post-card-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.post-card-show {
    font-size: 0.78rem;
    color: #888;
    margin-left: auto;
}

.post-card h4 {
    font-size: 0.92rem;
    color: #fff;
    margin-bottom: 0.2rem;
}

.post-card-meta {
    font-size: 0.78rem;
    color: #777;
}

.badge-status-draft { background: #6b7280; color: #fff; }
.badge-status-review { background: #ca8a04; color: #000; }
.badge-status-approved { background: #059669; color: #fff; }
.badge-status-queued { background: #3b82f6; color: #fff; }
.badge-status-posted { background: #7c3aed; color: #fff; }
.badge-status-failed { background: #dc2626; color: #fff; }

/* ---------- Image Preview ---------- */

.image-preview-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #141425;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-preview-header h3 {
    font-size: 1rem;
    color: #d0d0e0;
    margin: 0;
}

.image-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vibe-label {
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vibe-select {
    background: #0f0f1a;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
}

.image-preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: #0f0f1a;
    border-radius: 6px;
    overflow: hidden;
}

.composed-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 4px;
    display: block;
}

.image-preview-tabs {
    display: flex;
    gap: 0;
    border-top: 1px solid #2a2a4a;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
}

.image-preview-tabs.hidden { display: none; }

.img-tab {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b0b0c0;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.img-tab:hover { color: #fff; }
.img-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }

/* ---------- Dashboard ---------- */

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stat-accent { color: #a78bfa; }
.stat-warn { color: #f59e0b; }

.dash-columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
}

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

.section-header h2 {
    margin: 0;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
}

.post-card-actions {
    display: flex;
    gap: 0.35rem;
}

/* ---------- Queue ---------- */

.queue-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: border-color 0.15s;
}

.queue-card:hover { border-color: #7c3aed; }

.queue-card-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.queue-card h4 {
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.queue-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: #777;
    flex-wrap: wrap;
}

.queue-card-platforms {
    margin-left: auto;
    display: flex;
    gap: 0.3rem;
}

.queue-platform {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #2a2a4a;
    color: #b0b0c0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.queue-scheduled {
    color: #a78bfa;
    font-weight: 500;
}

.queue-card-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.4rem;
}

/* ---------- Settings ---------- */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.settings-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.25rem;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.settings-card-header h3 {
    font-size: 0.95rem;
    color: #fff;
}

.settings-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    background: #2a2a4a;
    color: #888;
}

.settings-icon.icon-ok {
    background: #059669;
    color: #fff;
}

.settings-icon.icon-warn {
    background: #f59e0b;
    color: #000;
}

.settings-desc {
    font-size: 0.82rem;
    color: #888;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.settings-status {
    font-size: 0.78rem;
    font-weight: 600;
}

.settings-status.status-ok { color: #86efac; }
.settings-status.status-warn { color: #fca5a5; }

.settings-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.profile-service {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #a78bfa;
    letter-spacing: 0.04em;
}

.profile-name {
    font-size: 0.85rem;
    color: #e0e0e0;
}

.settings-env {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1rem;
}

.env-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #222240;
}

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

.env-key {
    font-size: 0.82rem;
    color: #a78bfa;
    font-family: monospace;
}

.env-val {
    font-size: 0.82rem;
    color: #888;
}

/* ---------- Mobile Responsive ---------- */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 0.75rem 0;
        border-right: none;
        border-bottom: 1px solid #2a2a4a;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem 0.5rem;
        border-bottom: none;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 0.25rem 0.5rem;
    }

    .nav-links li a {
        padding: 0.4rem 0.75rem;
        font-size: 0.82rem;
    }

    .nav-links li a.active {
        border-left: none;
        border-bottom: 2px solid #a78bfa;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.85rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .dash-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .preview-header,
    .image-preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-actions,
    .image-controls {
        width: 100%;
    }

    .platform-tabs,
    .post-tabs,
    .image-preview-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        width: 95%;
        padding: 1.25rem;
        max-height: 90vh;
    }

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

    .queue-card-header {
        flex-wrap: wrap;
    }

    .queue-card-platforms {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

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

    .btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
    .btn-sm { font-size: 0.72rem; padding: 0.25rem 0.5rem; }

    .page-header h1 { font-size: 1.2rem; }
}
