/* Admin Dashboard - Digest Dark Theme Aesthetic (Compact & Organized 2-Column) */

:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Warm Charcoal & Violet Dark Theme Colors (matching Digest UI) */
    --bg-app: #161412;         /* Deep warm charcoal */
    --bg-sidebar: #1f1c18;     /* Warm dark beige-gray header/sidebar */
    --bg-surface: #211e19;     /* Card background */
    --bg-subtle: #29241f;      /* Input & hover background */
    --border-color: rgba(235, 222, 200, 0.12); /* Warm neutral border */
    
    --text-primary: #f3efe7;   /* Warm off-white */
    --text-secondary: #cabfac; /* Warm light beige */
    --text-muted: #988c78;     /* Muted warm gray */
    
    --accent-violet: #8b5cf6;
    --accent-violet-deep: #7c3aed;
    --accent-pink: #db2777;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --radius-lg: 14px;
    --radius-md: 8px;
    --radius-sm: 5px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 5.5rem;
}

/* Headings */
h1, h2, h3, h4, .brand-title, .hero-card h2, .card-header-bar h3 {
    font-family: var(--font-heading);
}

/* Floating Top Header */
header.floating-header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 1240px;
    min-height: 60px;
    height: auto;
    background: rgba(33, 30, 25, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    gap: 1rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-violet-deep), var(--accent-pink));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Navigation Tabs */
.module-tabs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(26, 24, 21, 0.7);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    justify-content: center;
    max-width: none;
}

.module-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.45rem 0.85rem;
    border-radius: calc(var(--radius-md) - 2px);
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 250, 240, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-violet-deep), #6d28d9);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4);
}

/* Right Nav Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.guild-select {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.42rem 0.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.guild-select:hover, .guild-select:focus {
    border-color: var(--accent-violet);
}

.btn {
    background: linear-gradient(135deg, var(--accent-violet-deep), #6d28d9);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
    background: rgba(255, 250, 240, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 250, 240, 0.12);
}

.btn-danger {
    background: var(--accent-red);
}

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

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-violet);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-text:hover {
    color: #a5b4fc;
}

/* Icon Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 240, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255, 250, 240, 0.12);
    border-color: rgba(235, 222, 200, 0.25);
}

.btn-icon-danger {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Main Container */
main {
    max-width: 1200px;
    width: 100%;
    margin: 1.25rem auto 3rem auto;
    padding: 0 1.25rem;
    flex: 1;
}

.hidden {
    display: none !important;
}

/* 2-Column Module Layout */
.module-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 860px) {
    .module-grid-2 {
        grid-template-columns: 1fr 1.2fr;
    }
}

.module-col {
    display: flex;
    flex-direction: column;
}

/* Panel Cards & Forms */
.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.65rem;
}

.header-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

.compact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

.hint {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

/* Custom Combobox Dropdown Widget */
.combobox-container {
    position: relative;
    width: 100%;
    min-width: 0;
}

.combobox-trigger {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.8rem;
    color: var(--text-primary);
    font-size: 0.86rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    transition: border-color 0.2s ease;
    min-width: 0;
    height: 38px;
}

.combobox-trigger:hover {
    border-color: var(--accent-violet);
}

.combobox-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.combobox-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1f1c18;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 1050;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.combobox-search-input {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    color: var(--text-primary);
    font-size: 0.84rem;
    outline: none;
    width: 100%;
}

.combobox-search-input:focus {
    border-color: var(--accent-violet);
}

.combobox-options-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.combobox-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.84rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
    min-width: 0;
}

.combobox-option img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.combobox-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.combobox-option:hover, .combobox-option.active {
    background: rgba(139, 92, 246, 0.2);
    color: #ffffff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    height: 38px;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-violet);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Compact Streamers / Items List */
.streamers-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.streamer-row-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s ease;
}

.streamer-row-card:hover {
    border-color: rgba(235, 222, 200, 0.22);
}

.streamer-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.streamer-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.streamer-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.streamer-title-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.streamer-title-box h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.streamer-link-sm {
    color: var(--accent-violet);
    font-size: 0.76rem;
    text-decoration: none;
}

.streamer-link-sm:hover {
    text-decoration: underline;
}

.badge-sm {
    padding: 0.18rem 0.45rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-live {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-offline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.streamer-row-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.streamer-role-select {
    max-width: 140px;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

/* Mini Inline Edit Panel */
.mini-edit-panel {
    background: rgba(22, 20, 17, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    animation: fadeIn 0.2s ease-in-out;
}

.mini-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.mini-edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.empty-box {
    text-align: center;
    padding: 2.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    animation: slideUp 0.2s ease;
}

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