﻿/* ============================================================
   BRAND VARIABLES (COLOURS ONLY)
   ============================================================ */

:root {
    --committee-primary: #0d6efd;
    --entries-primary: #0f766e;
    --judging-primary: #7f1d1d;
    --winery-primary: #c17f0a;
    --admin-primary: #343a40;
}

/* ============================================================
   BASE DASHBOARD STRUCTURE (MOBILE-FIRST)
   ============================================================ */

html,
body {
    height: 100%;
}

.dashboard-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Sidebar (mobile: hidden via d-none d-md-block) */
.dashboard-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content for legacy layouts using .dashboard-main > main */
.dashboard-main > main {
    flex: 1;
    min-height: 0;
}

/* ============================================================
   DESKTOP LAYOUT (FIXED SIDEBAR)
   ============================================================ */

@media (min-width: 768px) {

    .dashboard-shell {
        display: flex;
        flex-direction: row;
        min-height: 100vh;
        width: 100%;
    }

    .dashboard-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 250px;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden; /* avoid hover “poke out” */
        z-index: 1000;
    }

    .dashboard-content {
        margin-left: 250px !important; /* push content right of sidebar */
        width: calc(100% - 250px) !important;
        padding-bottom: 3rem;
        overflow-y: auto;
        display: block;
    }

    /* Center inner body content for all dashboards */
    .dashboard-inner {
        max-width: 1320px; /* same as container-xl */
        margin-left: auto;
        margin-right: auto;
    }
}

/* ============================================================
   DASHBOARD NAV (SHARED)
   ============================================================ */

.dashboard-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

    .dashboard-nav .nav-link:hover {
        transform: translateX(4px);
        background-color: rgba(255, 255, 255, 0.12);
    }

    /* Active link – highlighted but no slide */
    .dashboard-nav .nav-link.active {
        font-weight: 600;
        transform: none;
        background-color: rgba(255, 255, 255, 0.16);
    }

/* ============================================================
   DASHBOARD THEMES (COLOUR ONLY)
   ============================================================ */

/* Committee */
.committee-theme .dashboard-sidebar,
.committee-theme .brand-bar,
.committee-theme .dashboard-pill {
    background-color: var(--committee-primary);
    color: #fff;
}

/* Judging */
.judging-theme .dashboard-sidebar,
.judging-theme .brand-bar,
.judging-theme .dashboard-pill {
    background-color: var(--judging-primary);
    color: #fff;
}

/* Entries */
.entries-theme .dashboard-sidebar,
.entries-theme .brand-bar,
.entries-theme .dashboard-pill {
    background-color: var(--entries-primary);
    color: #fff;
}

/* Winery */
.winery-theme .dashboard-sidebar,
.winery-theme .brand-bar,
.winery-theme .dashboard-pill {
    background-color: var(--winery-primary);
    color: #fff;
}

/* Admin */
.admin-theme .dashboard-sidebar,
.admin-theme .brand-bar,
.admin-theme .dashboard-pill {
    background-color: var(--admin-primary);
    color: #fff;
}

/* Optional helper */
.bg-admin {
    background-color: #343a40 !important; /* dark admin charcoal */
}

/* Sidebar link text colour for all themes */
.committee-theme .dashboard-nav .nav-link,
.judging-theme .dashboard-nav .nav-link,
.entries-theme .dashboard-nav .nav-link,
.winery-theme .dashboard-nav .nav-link,
.admin-theme .dashboard-nav .nav-link {
    color: #fff;
}

/* ============================================================
   ASSIGN CLASSES – CORE LAYOUT
   ============================================================ */

/* Panels must grow naturally */
.panel-column {
    height: auto;
    min-height: 520px;
    max-height: none;
    overflow: visible;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

/* Cards must never trap height */
.card,
.card-body {
    height: auto;
    max-height: none;
    overflow: visible;
}

/* ============================================================
   ASSIGN CLASSES – CLASS CARDS
   ============================================================ */

.class-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .class-card:hover {
        box-shadow: 0 6px 14px rgba(0,0,0,0.12);
        transform: translateY(-1px);
    }

    .class-card:active {
        cursor: grabbing;
    }

/* Title + meta */
.class-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
    line-height: 1.3;
}

.class-card-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ============================================================
   ASSIGN CLASSES – DRAG FEEDBACK
   ============================================================ */

.class-ghost {
    background: repeating-linear-gradient( 45deg, #f8d7da, #f8d7da 8px, #f1b0b7 8px, #f1b0b7 16px );
    border-radius: 8px;
    height: 48px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.opacity-50 {
    opacity: 0.6;
}

/* ============================================================
   ASSIGN CLASSES – BREAK / DIVIDER / BRACKET
   ============================================================ */

.break-card {
    background: rgba(127, 29, 29, 0.08);
    border: 1px dashed rgba(127, 29, 29, 0.4);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: #7f1d1d;
    cursor: grab;
}

.bracket-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    padding: 6px 8px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

    .bracket-card::before,
    .bracket-card::after {
        content: "";
        flex: 1;
        border-top: 2px solid #d1d5db;
    }

    .bracket-card .chevron {
        font-size: 0.85rem;
        transition: transform 0.2s ease;
    }

    /* open/closed states */
    .bracket-card.open .chevron {
        transform: rotate(90deg);
    }

    .bracket-card.collapsed .chevron {
        transform: rotate(-90deg);
    }

.bracket-toggle {
    letter-spacing: 0;
    font-size: 0.85rem;
    opacity: .85;
}

/* optional: when collapsed, flip the toggle */
.bracket-card[data-collapsed="1"] .bracket-toggle {
    transform: rotate(-90deg);
    display: inline-block;
}

.divider-card {
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: grab;
}

/* Items hidden under collapsed bracket */
.panel-collapsed,
.panel-section-collapsed {
    display: none !important;
}

/* ============================================================
   ASSIGN CLASSES – PANEL SECTIONS
   ============================================================ */

.panel-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff;
}

.panel-section-header {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

    .panel-section-header:hover {
        background: #f9fafb;
    }

.panel-section .chevron {
    transition: transform 0.2s ease;
}

.panel-section.open .chevron {
    transform: rotate(90deg);
}

.panel-section-body {
    padding: 10px 12px;
}

    .panel-section-body.collapsed {
        display: none;
    }

.section-summary {
    margin-left: auto;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ============================================================
   IMPERSONATION BANNER (GLOBAL)
   ============================================================ */

.impersonation-banner {
    position: relative;
    z-index: 5000;
    background: #fff7da;
    border: 1px solid #f2e3a5;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #7a5800;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* ============================================================
   SIDEBAR LOGOUT BUTTON
   ============================================================ */

.sidebar-action {
    margin-left: 1rem; /* matches nav-link padding */
    margin-right: 1rem;
    max-width: 160px;
}

.btn-logout {
    background-color: #cccccc;
    border: 1px solid rgba(180, 140, 0, 0.8);
    color: #a80000;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    /* ICON */
    .btn-logout i {
        color: inherit;
    }

    /* HOVER / FOCUS */
    .btn-logout:hover,
    .btn-logout:focus {
        background-color: rgba(255, 215, 100, 0.25); /* visible on all themes */
        border-color: #d9a900;
        color: #343a40; /* darker, never invisible */
    }

/* ============================================================
   ROLE BADGES (JUDGING / COMMITTEE)
   ============================================================ */

.badge-judging {
    background-color: #f3e8ff;
    color: #5b21b6;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
}

.badge-committee {
    background-color: #e0f2fe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
}

/* ============================================================
   FEEDBACK BADGES
   ============================================================ */

.feedback-badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Type badges */
.feedback-type-bug {
    background-color: #fee2e2;
    color: #991b1b;
}

.feedback-type-improvement {
    background-color: #e0f2fe;
    color: #075985;
}

.feedback-type-newfeature {
    background-color: #ede9fe;
    color: #5b21b6;
}

.feedback-type-dataissue {
    background-color: #fff7ed;
    color: #9a3412;
}

.feedback-type-usability {
    background-color: #f0fdf4;
    color: #166534;
}

/* Status badges */
.feedback-status-new {
    background-color: #0d6efd;
    color: #ffffff;
}

.feedback-status-acknowledged {
    background-color: #6c757d;
    color: #ffffff;
}

.feedback-status-planned {
    background-color: #f59e0b;
    color: #1f2937;
}

.feedback-status-inprogress {
    background-color: #0ea5e9;
    color: #ffffff;
}

.feedback-status-deferred {
    background-color: #64748b;
    color: #ffffff;
}

.feedback-status-declined {
    background-color: #ef4444;
    color: #ffffff;
}

.feedback-status-completed {
    background-color: #16a34a;
    color: #ffffff;
}

/* ============================================================
   MOBILE NAV WRAPPER
   ============================================================ */

.mobile-nav {
    background: #fff;
    border-bottom: 1px solid #e3e3e3;
    width: 100%;
}

/* Header row with title + close button */
.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
}

.mobile-nav-title-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

/* Collapsed panel */
.mobile-nav-menu {
    padding: 0.5rem 0 2rem 0;
    background: #fff;
    text-align: center;
}

/* Section titles */
.mobile-nav-section-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #444;
}

/* Navigation items */
.mobile-nav-item {
    display: block;
    width: 90%;
    margin: 0.25rem auto;
    padding: 0.75rem 1rem;
    text-align: left;
    background: #ffffff;
    border-radius: 8px;
    font-size: 1.05rem;
    color: #222;
    text-decoration: none;
    transition: 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

    .mobile-nav-item:hover {
        background: #f4f4f4;
        transform: translateY(-1px);
    }

    /* danger logout */
    .mobile-nav-item.text-danger:hover {
        background: rgba(255,0,0,0.08);
    }

/* subtle shadow when open */
.mobile-nav-menu.show {
    box-shadow: inset 0 4px 14px rgba(0,0,0,0.06);
}
/* =========================================================
   Unassigned accordion (CRITICAL)
   ========================================================= */

.class-group-body {
    display: block;
}

    .class-group-body.collapsed {
        display: none !important;
    }

/* Make headers clearly clickable */
.class-group-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

    /* Chevron styling */
    .class-group-header .chevron {
        width: 12px;
        display: inline-block;
        font-size: 12px;
    }

    /* Optional hover feedback */
    .class-group-header:hover {
        background: rgba(0,0,0,0.03);
        border-radius: 4px;
    }

#layoutTools .break-remove,
#layoutTools .bracket-remove {
    display: none;
}
/* AssignClasses: make Unassigned / Tools sticky on desktop */
@media (min-width: 992px) {
    .assign-classes-sticky {
        top: 5.5rem; /* tweak this up/down to clear your top nav / banner */
        z-index: 10;
    }
}
.border-danger:hover {
    box-shadow: 0 0 0 2px rgba(220,53,69,0.35);
}
/* CJ/Judging: keep impersonation banner stuck at top */
.impersonation-bar,
.impersonation-banner,
.admin-impersonation,
#impersonationBar {
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important; /* above sidebar/overlays */
    background: #fff;
}
.bg-bronze {
    background-color: #8b5a2b !important;
    color: #fff !important;
}

.bg-silver {
    background-color: #7b8794 !important;
    color: #fff !important;
}

.bg-gold {
    background-color: #b8860b !important;
    color: #fff !important;
}

/* Hamburger vs X based on Bootstrap's "collapsed" class */
.mobile-nav-toggle {
    border: 0;
    background: transparent;
    padding: .25rem .5rem;
    line-height: 1;
    color: inherit;
}

    /* icon sizing */
    .mobile-nav-toggle i {
        font-size: 1.4rem;
    }

    /* Default state = collapsed => show hamburger */
    .mobile-nav-toggle .mobile-nav-icon-close {
        display: none;
    }

    .mobile-nav-toggle.collapsed .mobile-nav-icon-open {
        display: inline-block;
    }

    /* Expanded state => show X */
    .mobile-nav-toggle:not(.collapsed) .mobile-nav-icon-open {
        display: none;
    }

    .mobile-nav-toggle:not(.collapsed) .mobile-nav-icon-close {
        display: inline-block;
    }
.bg-committee {
    background-color: #0d6efd !important; /* blue like your announcements header */
}

.bg-entries {
    background-color: #0f766e !important
}

/* Entries dashboard theme – make Filter button match sidebar */
.entries-theme .btn-filter {
    background-color: var(--sidebar-bg, #39756e); /* fallback if variable not set */
    border-color: var(--sidebar-bg, #39756e);
    color: #fff;
}

    .entries-theme .btn-filter:hover,
    .entries-theme .btn-filter:focus {
        filter: brightness(0.92);
        color: #fff;
    }

    /* Make sortable column headings green */
    .entries-headings a {
        color: #39756e !important;
    }

        .entries-headings a:hover,
        .entries-headings a:focus {
            color: #2f5f59 !important; /* slightly darker on hover */
            text-decoration: underline;
        }
