/* Vegemite - Dark Theme with Yellow Accents */

:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d2d;
    --tertiary-bg: #3d3d3d;
    --primary-yellow: #ffd700;
    --secondary-yellow: #ffed4e;
    --accent-yellow: #fff59d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #404040;
    --error-color: #ff6b6b;
    --success-color: #51cf66;
    --warning-color: #ffa726;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
    /* Single source of truth for the fixed navbar height. The sidebar and
       main content offset themselves with this, so a taller mobile navbar
       (two rows: brand + search) stays in sync everywhere. */
    --navbar-height: 60px;
    --sidebar-width: 250px;
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 104px;
    }
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-yellow);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.5rem;
}
h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Group Stats Styling */
.group-stats-card {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.group-stats-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.group-stats-card .card-header {
    background: linear-gradient(
        135deg,
        var(--secondary-bg) 0%,
        var(--tertiary-bg) 100%
    );
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.mini-stat-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mini-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--primary-yellow),
        var(--secondary-yellow)
    );
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mini-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.15);
    border-color: var(--primary-yellow);
}

.mini-stat-card[onclick] {
    cursor: pointer;
    transition: all 0.3s ease;
}

.mini-stat-card[onclick]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.25);
    border-color: var(--secondary-yellow);
    background: linear-gradient(
        135deg,
        var(--secondary-bg) 0%,
        var(--tertiary-bg) 100%
    );
}

.mini-stat-card[onclick]:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.mini-stat-card:hover::before {
    transform: scaleX(1);
}

/* Dashboard Cards Grid Layout */
.group-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Dashboard card wrappers - default half width */
.group-stats-grid .dashboard-card-wrapper {
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Recent Releases Card Wrapper - Full Width */
.group-stats-grid .dashboard-card-wrapper[data-card-type="recent_releases"] {
    grid-column: 1 / -1;
}

/* Group Stats Card Wrapper - Half Width (default behavior) */
.group-stats-grid .dashboard-card-wrapper[data-card-type="group_stats"] {
    /* Uses default grid column behavior (half width) */
}

/* Override card margins for all card types within grid */
.group-stats-grid .group-stats-card,
.group-stats-grid .recent-releases-card {
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Handle single group stats card layout */
.group-stats-grid
    .dashboard-card-wrapper[data-card-type="group_stats"]:only-of-type {
    max-width: 700px;
    justify-self: center;
}

@media (max-width: 1000px) {
    .group-stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Reset all cards to single column on mobile */
    .group-stats-grid .dashboard-card-wrapper[data-card-type="recent_releases"],
    .group-stats-grid .dashboard-card-wrapper[data-card-type="group_stats"] {
        grid-column: 1;
    }

    .group-stats-grid
        .dashboard-card-wrapper[data-card-type="group_stats"]:only-of-type {
        max-width: none;
        justify-self: stretch;
    }
}

@media (max-width: 768px) {
    .group-stats-grid {
        gap: 1rem;
    }

    .group-stats-card .mini-stat-card {
        padding: 0.4rem;
    }

    .group-stats-card .mini-stat-card .stat-number {
        font-size: 1.1rem !important;
    }

    /* Ensure group stats 3-column layout works on mobile */
    .group-stats-three-col {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.25rem !important;
    }

    .group-stats-three-col .mini-stat-card {
        padding: 0.4rem 0.2rem !important;
    }

    .group-stats-three-col .mini-stat-card .text-muted {
        font-size: 0.75rem !important;
    }
}

/* Group Stats 3-Column Layout */
.group-stats-three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

/* Chart Card Horizontal Bar Styles */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-item {
    display: block;
    text-decoration: none;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-bar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
    border-color: var(--primary-yellow);
}

/* Chart Bar Responsive Layout */
@media (max-width: 768px) {
    .chart-bar-item {
        padding: 0.6rem;
    }

    .chart-container {
        gap: 0.6rem;
    }
}

@media (max-width: 480px) {
    .chart-container {
        gap: 0.5rem;
    }

    .chart-bar-item {
        padding: 0.5rem;
    }
}

/* Chart Summary Stats Responsive - No longer needed with single centered item */

/* Chart Bar Animation */
@keyframes slideInChart {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chart-bar-item:nth-child(1) {
    animation: slideInChart 0.6s ease-out 0.1s both;
}
.chart-bar-item:nth-child(2) {
    animation: slideInChart 0.6s ease-out 0.2s both;
}
.chart-bar-item:nth-child(3) {
    animation: slideInChart 0.6s ease-out 0.3s both;
}
.chart-bar-item:nth-child(4) {
    animation: slideInChart 0.6s ease-out 0.4s both;
}
.chart-bar-item:nth-child(5) {
    animation: slideInChart 0.6s ease-out 0.5s both;
}
.chart-bar-item:nth-child(6) {
    animation: slideInChart 0.6s ease-out 0.6s both;
}
.chart-bar-item:nth-child(7) {
    animation: slideInChart 0.6s ease-out 0.7s both;
}
.chart-bar-item:nth-child(8) {
    animation: slideInChart 0.6s ease-out 0.8s both;
}
.chart-bar-item:nth-child(9) {
    animation: slideInChart 0.6s ease-out 0.9s both;
}
.chart-bar-item:nth-child(10) {
    animation: slideInChart 0.6s ease-out 1s both;
}
.chart-bar-item:nth-child(11) {
    animation: slideInChart 0.6s ease-out 1.1s both;
}
.chart-bar-item:nth-child(12) {
    animation: slideInChart 0.6s ease-out 1.2s both;
}
.chart-bar-item:nth-child(13) {
    animation: slideInChart 0.6s ease-out 1.3s both;
}
.chart-bar-item:nth-child(14) {
    animation: slideInChart 0.6s ease-out 1.4s both;
}
.chart-bar-item:nth-child(15) {
    animation: slideInChart 0.6s ease-out 1.5s both;
}
.chart-bar-item:nth-child(16) {
    animation: slideInChart 0.6s ease-out 1.6s both;
}
.chart-bar-item:nth-child(17) {
    animation: slideInChart 0.6s ease-out 1.7s both;
}
.chart-bar-item:nth-child(18) {
    animation: slideInChart 0.6s ease-out 1.8s both;
}
.chart-bar-item:nth-child(19) {
    animation: slideInChart 0.6s ease-out 1.9s both;
}
.chart-bar-item:nth-child(20) {
    animation: slideInChart 0.6s ease-out 2s both;
}

.stats-section {
    border-left: 3px solid var(--primary-yellow);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

.stats-section::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--secondary-yellow);
    opacity: 0.6;
}

.section-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.section-tag {
    background: var(--secondary-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.section-tag::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.section-tag:hover {
    border-color: var(--primary-yellow);
    background: var(--tertiary-bg);
    transform: scale(1.05);
}

.section-tag:hover::before {
    left: 100%;
}

/* Inline section layout for better space utilization */
.section-header-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.section-header-inline h5 {
    margin: 0;
    flex-shrink: 0;
}

.section-header-inline .section-tags {
    flex: 1;
    min-width: 0;
}

/* Dashboard Card Controls */
.dashboard-card-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

.dashboard-card-wrapper:hover {
    transform: translateY(-2px);
}

.dashboard-card-wrapper.dragging {
    opacity: 0.9 !important;
    transform: rotate(3deg) scale(1.08) !important;
    z-index: 1000 !important;
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.4) !important;
    border: 2px solid var(--primary-yellow) !important;
    background: rgba(255, 215, 0, 0.05) !important;
    transition: none !important;
    position: relative !important;
}

.dashboard-card-wrapper[draggable="true"] {
    cursor: move;
}

.dashboard-card-wrapper[draggable="true"]:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

/* Mobile drag and drop enhancements */
@media (max-width: 768px) {
    .dashboard-card-wrapper.dragging {
        transform: rotate(2deg) scale(1.1);
        z-index: 1000;
        box-shadow: 0 20px 40px rgba(255, 215, 0, 0.4);
    }

    .drop-zone-indicator {
        height: 6px;
        margin: 12px 0;
    }

    .dashboard-cards-container.drag-active::before {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }

    .dashboard-card-wrapper:not(.dragging).drag-session-active:hover::after {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
}

/* Touch device improvements */
@media (hover: none) {
    .dashboard-card-wrapper[draggable="true"] {
        transform: none;
        transition: all 0.2s ease;
    }

    .dashboard-card-wrapper.drag-target {
        border: 3px solid var(--primary-yellow);
        background: rgba(255, 215, 0, 0.15);
    }
}

.dashboard-card-wrapper[data-loading="true"] {
    opacity: 0.8;
    pointer-events: none;
}

.dashboard-card-wrapper.success-feedback {
    animation: successPulse 1s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        background: transparent;
    }
    30% {
        transform: scale(1.05);
        background: rgba(40, 167, 69, 0.1);
        border: 2px solid var(--success-color);
    }
    100% {
        transform: scale(1);
        background: transparent;
        border: 2px solid transparent;
    }
}

/* Drag and Drop Enhancements */
.dashboard-card-wrapper.drag-over {
    border: 3px solid var(--primary-yellow) !important;
    background: rgba(255, 215, 0, 0.1) !important;
    transform: scale(1.03) !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3) !important;
}

.dashboard-card-wrapper.drag-target {
    border: 3px solid var(--primary-yellow) !important;
    background: rgba(255, 215, 0, 0.15) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3) !important;
}

.drop-zone-indicator {
    height: 6px;
    background: linear-gradient(
        90deg,
        var(--primary-yellow),
        #ffd700aa,
        var(--primary-yellow)
    );
    border-radius: 3px;
    margin: 12px 0;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    position: relative;
}

.drop-zone-indicator.active {
    opacity: 1;
    transform: scaleX(1);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

.drop-zone-placeholder {
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed var(--primary-yellow);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--primary-yellow);
    font-weight: 600;
    margin: 1rem 0;
    opacity: 0;
    transform: scaleY(0);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone-placeholder.active {
    opacity: 1;
    transform: scaleY(1);
    animation: pulseGlow 2s ease-in-out infinite;
}

.drop-zone-placeholder::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.drop-zone-placeholder.active::before {
    left: 100%;
}

.dashboard-cards-container {
    position: relative;
}

/* Edit mode list styling */
.edit-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.edit-list-item:hover {
    background: var(--tertiary-bg);
    border-color: var(--primary-yellow);
}

.edit-list-item button {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s ease;
}

.edit-list-item button:hover:not(:disabled) {
    transform: scale(1.1);
}

.edit-list-item button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Movement controls overlay */
.movement-controls {
    background: rgba(0, 0, 0, 0.85) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(5px);
    border: 2px solid var(--primary-yellow);
}

.movement-controls .move-btn {
    background: var(--primary-yellow) !important;
    color: var(--primary-bg) !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    font-size: 16px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.movement-controls .move-btn:hover:not(:disabled) {
    background: var(--secondary-yellow) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4) !important;
}

.movement-controls .move-btn:disabled {
    background: rgba(255, 215, 0, 0.3) !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.movement-controls .move-btn:active:not(:disabled) {
    transform: scale(0.95) !important;
}

/* Enhanced card hover in edit mode */
.dashboard-card-wrapper:has(.movement-controls[style*="block"]) {
    transition: all 0.2s ease;
}

.dashboard-card-wrapper:has(.movement-controls[style*="block"]):hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.dashboard-card-wrapper:has(.movement-controls[style*="block"]):hover
    .movement-controls {
    transform: translate(-50%, -50%) scale(1.05);
}

.dashboard-cards-container.drag-active {
    background: rgba(255, 215, 0, 0.02);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

/* Switch to flexbox during drag operations to avoid grid conflicts */
.group-stats-grid.drag-mode {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    grid-template-columns: none !important;
}

.group-stats-grid.drag-mode .dashboard-card-wrapper {
    width: 100% !important;
    grid-column: unset !important;
    flex: none !important;
    min-width: unset !important;
    max-width: none !important;
    justify-self: unset !important;
}

.group-stats-grid.drag-mode
    .dashboard-card-wrapper[data-card-type="recent_releases"] {
    grid-column: unset !important;
    width: 100% !important;
}

.group-stats-grid.drag-mode
    .dashboard-card-wrapper[data-card-type="group_stats"] {
    grid-column: unset !important;
    width: 100% !important;
    max-width: none !important;
    justify-self: unset !important;
}

/* Completely disable grid behavior during drag */
.group-stats-grid.drag-mode .dashboard-card-wrapper:only-of-type {
    max-width: none !important;
    justify-self: unset !important;
}

.dashboard-cards-container.drag-active::before {
    content: "🎯 Drop your card here to reorder";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-yellow);
    color: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInBounce 0.5s ease forwards;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

.dashboard-card-wrapper:not(.dragging).drag-session-active {
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.dashboard-card-wrapper:not(.dragging).drag-session-active:hover {
    border-color: var(--primary-yellow);
    background: rgba(255, 215, 0, 0.05);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.dashboard-card-wrapper:not(.dragging).drag-session-active:hover::after {
    content: "📍 Drop here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.95);
    color: var(--primary-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 1000;
    animation: fadeInBounce 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .drop-zone-indicator {
        background: var(--text-primary);
        height: 6px;
    }

    .dashboard-card-wrapper.drag-over {
        border: 3px solid var(--text-primary);
        background: var(--secondary-bg);
    }

    .dashboard-cards-container.drag-active {
        border: 2px solid var(--text-primary);
        background: var(--secondary-bg);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .dashboard-card-wrapper,
    .drop-zone-indicator,
    .dashboard-cards-container {
        transition: none;
        animation: none;
    }

    .dashboard-card-wrapper.dragging {
        transform: scale(1.05);
        animation: none;
    }

    .drop-zone-placeholder.active {
        animation: none;
    }
}

.card-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 5px;
}

.remove-card-btn {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.remove-card-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.add-card-btn {
    padding: 1rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.add-card-btn:hover {
    background: var(--tertiary-bg);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.15);
}

/* Refresh Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.btn .refresh-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.btn:disabled .refresh-icon {
    animation: spin 1s linear infinite;
}

/* Modal Styles */
.group-option {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.group-option:hover {
    background: var(--secondary-bg);
}

.group-option:last-child {
    border-bottom: none;
}

/* Edit Mode Indicators */
.edit-mode .dashboard-card-wrapper {
    border: 2px dashed var(--primary-yellow);
    border-radius: 8px;
    cursor: move;
}

.edit-mode .dashboard-card-wrapper:hover {
    border-color: var(--secondary-yellow);
    background: rgba(255, 215, 0, 0.05);
}

/* Clickable Statistics */
.clickable-stat {
    cursor: pointer;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.clickable-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
    border-color: var(--primary-yellow);
}

.clickable-stat:hover .stat-number {
    color: var(--primary-yellow);
}

.clickable-stat:hover .text-muted {
    color: var(--text-secondary);
}

.clickable-stat:active {
    transform: translateY(-2px);
    transition: transform 0.1s ease;
}

/* Releases Table Enhancements */
.releases-table {
    font-size: 0.9rem;
}

.releases-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.releases-table .col-release {
    white-space: normal;
    word-break: break-word;
    max-width: 0;
}

.releases-table tbody tr {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.releases-table tbody tr:hover {
    border-left-color: var(--primary-yellow);
    background: var(--tertiary-bg);
}

/* Status badges in releases table */
.status-badge {
    display: inline-block;
    white-space: nowrap;
    background-color: #007bff;
    color: white;
}

/* Section badges - custom styling */
.status-badge.section-badge,
.status-badge.status-normal[style*="background"] {
    background: #007bff !important;
    color: white !important;
    border: 1px solid var(--border-color) !important;
}

/* Status badges with specific statuses */
.status-badge.status-nuke {
    /*background-color: var(--error-color) !important;*/
    background-color: #e34343 !important;
    color: white !important;
}
.status-badge.status-unnuke {
    background-color: var(--success-color) !important;
    color: white !important;
}
.status-badge.status-modnuke {
    /*background-color: var(--warning-color) !important;*/
    background-color: #df5c04 !important;
    color: white !important;
}
.status-badge.status-delpre {
    background-color: #ff9800 !important;
    color: white !important;
}
.status-badge.status-undelpre {
    background-color: #2196f3 !important;
    color: white !important;
}

/* Pagination enhancements */
.pagination {
    user-select: none;
}

.pagination-btn {
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* Loading states */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile responsiveness for tables */
@media (max-width: 1024px) {
    .releases-table {
        font-size: 0.85rem;
    }

    .releases-table th,
    .releases-table td {
        padding: 0.4rem 0.3rem;
    }
}

@media (max-width: 768px) {
    .releases-table {
        font-size: 0.8rem;
    }

    .col-pretime {
        width: 100px;
        min-width: 100px;
    }
    .col-section {
        width: 70px;
        min-width: 70px;
    }
    .col-files {
        width: 40px;
        min-width: 40px;
    }
    .col-size {
        width: 80px;
        min-width: 80px;
    }

    .releases-table .col-release {
        font-size: 0.75rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
}

/* Click feedback for stat cards */
.clickable-stat::after {
    content: "🔗";
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.8rem;
}

.clickable-stat:hover::after {
    opacity: 0.6;
}

/* Table header enhancements */
.releases-table th {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Better visual hierarchy for filter info */
.filter-info h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-info h4::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--primary-yellow);
    border-radius: 2px;
}

a {
    color: var(--primary-yellow);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-yellow);
    text-decoration: underline;
}

/* Layout Components */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

.card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--primary-yellow);
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--tertiary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-yellow);
    color: var(--primary-bg);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: var(--secondary-yellow);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--primary-bg);
}

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

.btn-secondary:hover {
    background-color: var(--tertiary-bg);
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
}

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

.btn-danger:hover {
    background-color: #ff5252;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Navigation */
.navbar {
    background-color: var(--secondary-bg);
    border-bottom: 3px solid var(--primary-yellow);
    padding: 0.5rem 0;
    box-shadow: var(--shadow);
    z-index: 100;
    height: var(--navbar-height);
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 1rem;
    height: 100%;
}

/* Mobile hamburger - hidden on desktop, shown by media query below */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background-color: var(--tertiary-bg);
}

/* Navbar search */
.navbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    min-width: 0;
}

.navbar-search-form {
    display: flex;
    align-items: center;
}

.navbar-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: var(--tertiary-bg);
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
}

.navbar-search-input:focus {
    border-color: var(--primary-yellow);
}

.navbar-search-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-yellow);
    color: var(--primary-bg);
    border: 2px solid var(--primary-yellow);
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.navbar-search-btn:hover {
    background: var(--secondary-yellow);
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.user-admin-tag {
    color: var(--warning-color);
}

.user-menu-arrow {
    font-size: 0.8rem;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.user-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-menu a:hover {
    background-color: var(--tertiary-bg);
}

.user-dropdown-menu form {
    margin: 0;
}

.user-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.user-dropdown-menu button:hover {
    background-color: var(--tertiary-bg);
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-yellow);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--secondary-yellow);
    text-decoration: none;
}

/* Logo Styling */
.logo-image {
    height: 40px;
    width: 40px;
    object-fit: contain;
    display: block;
}

.logo-fallback {
    font-size: 2rem;
    line-height: 1;
    display: block;
}

/* Context-specific logo sizes */
.logo-large .logo-image {
    height: 64px;
    width: 64px;
}

.logo-large .logo-fallback {
    font-size: 4rem;
}

.logo-small .logo-image {
    height: 32px;
    width: 32px;
}

.logo-small .logo-fallback {
    font-size: 1.8rem;
}

.logo-xlarge .logo-image {
    height: 80px;
    width: 80px;
}

.logo-xlarge .logo-fallback {
    font-size: 5rem;
}

/* Simple Logo Replacement */
.logo-with-image {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 2.5rem;
    width: 2.5rem;
    object-fit: contain;
    vertical-align: middle;
}

/* Hide emoji when image loads successfully */
.logo-with-image .logo-img:not([style*="display: none"]) + .logo-emoji {
    display: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.navbar-nav a:hover {
    background-color: var(--tertiary-bg);
    text-decoration: none;
}

.navbar-nav a.active {
    background-color: var(--primary-yellow);
    color: var(--primary-bg);
}

/* Sidebar */
.sidebar {
    background-color: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    padding: 0;
    height: calc(100vh - var(--navbar-height));
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    width: var(--sidebar-width);
    overflow-y: auto;
    z-index: 50;
}

/* Sidebar inner layout (was inline styles in the partial) */
.sidebar-inner {
    padding: 1rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-sections {
    flex: 1;
}

.sidebar-heading {
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-submenu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-submenu-toggle:hover {
    background-color: var(--tertiary-bg);
    border-radius: 8px;
}

.sidebar-submenu-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.sidebar-submenu {
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.sidebar-submenu .sidebar-nav {
    font-size: 0.85rem;
}

.sidebar-submenu .sidebar-nav a {
    padding: 0.3rem 0.5rem;
}

.sidebar-stats {
    text-align: center;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sidebar-footer {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Backdrop shown behind the mobile slide-in sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 150;
}

.sidebar-backdrop.active {
    display: block;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover {
    background-color: var(--tertiary-bg);
    color: var(--primary-yellow);
    text-decoration: none;
}

.sidebar-nav a.active {
    background-color: var(--primary-yellow);
    color: var(--primary-bg);
}

/* Main content with sidebar */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 1rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(
        135deg,
        var(--primary-bg) 0%,
        var(--secondary-bg) 100%
    );
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    color: var(--primary-yellow);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(
        135deg,
        var(--secondary-bg) 0%,
        var(--tertiary-bg) 100%
    );
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--primary-yellow),
        var(--secondary-yellow)
    );
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-yellow);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background-color: var(--secondary-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Plain horizontal-scroll wrapper (used where table-container's bg/border
   would double up with the table's own styling) */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--tertiary-bg);
    color: var(--primary-yellow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: var(--tertiary-bg);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-error {
    background-color: rgba(255, 107, 107, 0.1);
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background-color: rgba(81, 207, 102, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background-color: rgba(255, 167, 38, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

/* Utilities */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.text-muted {
    color: var(--text-muted);
}
.text-yellow {
    color: var(--primary-yellow);
}

.mb-1 {
    margin-bottom: 0.25rem;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-3 {
    margin-bottom: 1rem;
}
.mb-4 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}
.mt-2 {
    margin-top: 0.5rem;
}
.mt-3 {
    margin-top: 1rem;
}
.mt-4 {
    margin-top: 2rem;
}

.d-flex {
    display: flex;
}
.justify-between {
    justify-content: space-between;
}
.align-center {
    align-items: center;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-yellow);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Sidebar slides in from the left, over a backdrop */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    /* Navbar becomes two rows: [hamburger | brand | user] / [search].
       Total height is --navbar-height (104px), set in :root above. */
    .navbar-content {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0 10px;
        align-content: center;
    }

    .mobile-menu-btn {
        display: block;
        order: 0;
    }

    .navbar-brand {
        order: 1;
        font-size: 1.4rem;
        margin-right: auto;
    }

    .navbar-brand .logo-img {
        height: 1.8rem;
        width: 1.8rem;
    }

    .navbar-nav {
        order: 2;
        gap: 0.5rem;
    }

    .user-menu-btn {
        font-size: 0.85rem;
        padding: 0.4rem;
    }

    .navbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        margin: 0;
    }

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

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    /* Many views still carry inline two-column grids (style="grid-template-
       columns: 1fr 1fr") which media queries can't override without
       !important. Collapse them to one column on small screens. */
    .main-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .card {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 2rem;
    }

    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }

    /* Tighter table cells on phones */
    th,
    td {
        padding: 0.5rem;
    }
}
