/**
 * Hub Template - Main Stylesheet
 * High-performance Bootstrap 5 template for Joomla 5
 *
 * @package     Hub Template
 * @author      OUI Digital
 * @copyright   (C) 2024 OUI Digital
 * @license     GPL-2.0-or-later
 */

/* ==========================================================================
   CSS Custom Properties (Theme Tokens)
   ========================================================================== */
:root {
    /* Primary Colors - Can be overridden by template params */
    --hub-primary: #6366f1;
    --hub-primary-light: #818cf8;
    --hub-primary-dark: #4f46e5;
    --hub-secondary: #8b5cf6;

    /* Semantic Colors */
    --hub-success: #10b981;
    --hub-warning: #f59e0b;
    --hub-danger: #ef4444;
    --hub-info: #3b82f6;

    /* Background & Surface */
    --hub-bg: #f1efe9;
    --hub-surface: #ffffff;
    --hub-surface-secondary: #f8fafc;

    /* Text Colors */
    --hub-text: #1e293b;
    --hub-text-secondary: #64748b;
    --hub-text-muted: #94a3b8;

    /* Borders */
    --hub-border: #e2e8f0;
    --hub-border-light: rgba(255, 255, 255, 0.2);

    /* Spacing Scale */
    --hub-space-1: 0.25rem;
    --hub-space-2: 0.5rem;
    --hub-space-3: 1rem;
    --hub-space-4: 1.5rem;
    --hub-space-5: 2rem;
    --hub-space-6: 3rem;

    /* Layout */
    --hub-sidebar-width: 16%;
    --hub-sidebar-width-px: 260px;
    --hub-header-height: 0;

    /* Effects */
    --hub-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --hub-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --hub-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --hub-shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.15);

    /* Border Radius */
    --hub-radius-sm: 0.5rem;
    --hub-radius: 1rem;
    --hub-radius-lg: 1.5rem;
    --hub-radius-xl: 2rem;
    --hub-radius-full: 9999px;

    /* Transitions */
    --hub-transition: all 0.2s ease;
    --hub-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Glass Effect */
    --hub-glass-bg: rgba(255, 255, 255, 0.8);
    --hub-glass-border: rgba(255, 255, 255, 0.2);
    --hub-backdrop-blur: blur(12px);

    /* Typography */
    --hub-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hub-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--hub-font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--hub-text);
    background-color: var(--hub-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.guest {
    background-color: var(--hub-bg);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--hub-space-3);
    font-weight: 700;
    line-height: 1.3;
    color: var(--hub-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: var(--hub-space-3);
}

a {
    color: var(--hub-primary);
    text-decoration: none;
    transition: var(--hub-transition);
}

a:hover {
    color: var(--hub-primary-dark);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.hub-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hub-sidebar-width);
    min-width: var(--hub-sidebar-width-px);
    max-width: 320px;
    background: var(--hub-surface);
    border-right: 1px solid var(--hub-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hub-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--hub-space-5) 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo */
.hub-logo {
    text-align: center;
    padding: 0 var(--hub-space-4);
    margin-bottom: var(--hub-space-6);
}

.hub-logo-img {
    max-width: 40%;
    height: auto;
}

.hub-logo-svg {
    width: 60px;
    height: 60px;
    color: var(--hub-text);
}

/* Navigation */
.hub-nav {
    flex: 1;
    padding: 0;
}

.hub-nav .menu,
.hub-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hub-nav .menu > li,
.hub-nav ul > li {
    margin: 0;
}

.hub-nav .menu > li > a,
.hub-nav ul > li > a {
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
    padding: var(--hub-space-3) var(--hub-space-4);
    color: var(--hub-text);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hub-transition);
    border-left: 3px solid transparent;
}

.hub-nav .menu > li > a:hover,
.hub-nav ul > li > a:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
}

.hub-nav .menu > li.active > a,
.hub-nav .menu > li.current > a,
.hub-nav ul > li.active > a,
.hub-nav ul > li.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

.hub-nav .menu > li > a svg,
.hub-nav .menu > li > a i,
.hub-nav ul > li > a svg,
.hub-nav ul > li > a i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Module Menu - Full Width Items */
.mod-menu .nav-item {
    width: 100%;
}

.mod-menu .nav {
    flex-direction: column;
    width: 100%;
}

.mod-menu .nav-link {
    display: flex;
    align-items: center;
    gap: var(--hub-space-3);
    padding: var(--hub-space-3) var(--hub-space-4);
    color: var(--hub-text);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hub-transition);
    border-left: 3px solid transparent;
    width: 100%;
}

.mod-menu .nav-link:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
}

.mod-menu .nav-item.active > .nav-link,
.mod-menu .nav-item.current > .nav-link {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

/* Sub-menu: Hidden by default, shown only when parent or child is active */
.hub-nav .mod-menu__sub {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Show sub-menu when parent is active (user is on parent page or child page) */
.hub-nav .nav-item.active > .mod-menu__sub,
.hub-nav .nav-item.current > .mod-menu__sub,
.hub-nav .nav-item.alias-parent-active > .mod-menu__sub,
.hub-nav .nav-item.parent:hover > .mod-menu__sub {
    display: block;
}

/* Sub-menu item styling */
.hub-nav .mod-menu__sub .nav-item > a {
    padding: var(--hub-space-2) var(--hub-space-4) var(--hub-space-2) calc(var(--hub-space-4) + 1.5rem);
    font-size: 0.9rem;
    color: var(--hub-text-secondary);
    border-left: 3px solid transparent;
}

.hub-nav .mod-menu__sub .nav-item > a:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary-light);
}

.hub-nav .mod-menu__sub .nav-item.active > a,
.hub-nav .mod-menu__sub .nav-item.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
    border-left-color: var(--hub-primary);
    font-weight: 600;
}

/* Sidebar Footer */
.hub-sidebar-footer {
    padding: var(--hub-space-4);
    border-top: 1px solid var(--hub-border);
    margin-top: auto;
}

.hub-logout-form {
    margin: 0;
    padding: 0;
}

.hub-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    padding: var(--hub-space-3);
    color: var(--hub-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--hub-radius-sm);
    transition: var(--hub-transition);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

.hub-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--hub-danger);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.hub-main {
    min-height: 100vh;
    padding: var(--hub-space-5);
    transition: var(--hub-transition);
}

.hub-main.has-sidebar {
    margin-left: var(--hub-sidebar-width);
    min-width: calc(100% - var(--hub-sidebar-width));
}

.hub-main.no-sidebar {
    margin-left: 0;
}

/* ==========================================================================
   Mobile Menu Toggle
   ========================================================================== */
.hub-menu-toggle {
    position: fixed;
    top: var(--hub-space-3);
    left: var(--hub-space-3);
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    box-shadow: var(--hub-shadow);
    cursor: pointer;
    transition: var(--hub-transition);
}

.hub-menu-toggle:hover {
    background: var(--hub-bg);
}

.hub-menu-toggle svg {
    color: var(--hub-text);
}

/* Sidebar Overlay */
.hub-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hub-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   System Messages
   ========================================================================== */
.alert {
    padding: var(--hub-space-3) var(--hub-space-4);
    margin-bottom: var(--hub-space-4);
    border-radius: var(--hub-radius);
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-danger,
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* ==========================================================================
   Cards (Glass Style)
   ========================================================================== */
.card,
.glass-card {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow);
    overflow: hidden;
}

.glass-card {
    background: var(--hub-glass-bg);
    backdrop-filter: var(--hub-backdrop-blur);
    -webkit-backdrop-filter: var(--hub-backdrop-blur);
    border: 1px solid var(--hub-glass-border);
    box-shadow: var(--hub-shadow-glass);
}

.card-header {
    padding: var(--hub-space-4);
    border-bottom: 1px solid var(--hub-border);
    background: transparent;
}

.card-body {
    padding: var(--hub-space-4);
}

.card-footer {
    padding: var(--hub-space-4);
    border-top: 1px solid var(--hub-border);
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    padding: var(--hub-space-2) var(--hub-space-4);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--hub-radius-full);
    border: none;
    cursor: pointer;
    transition: var(--hub-transition);
}

.btn-primary {
    background: var(--hub-gradient-primary);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.btn-success {
    background: var(--hub-gradient-success);
    color: #fff;
}

.btn-warning {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.btn-danger {
    background: var(--hub-gradient-danger);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--hub-primary);
    color: var(--hub-primary);
}

.btn-outline-primary:hover {
    background: var(--hub-primary);
    color: #fff;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--hub-radius-full);
}

.badge-gradient {
    color: #fff;
}

.badge-high,
.badge-danger {
    background: var(--hub-gradient-danger);
    color: #fff;
}

.badge-medium,
.badge-warning {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.badge-low,
.badge-success {
    background: var(--hub-gradient-success);
    color: #fff;
}

.badge-info {
    background: var(--hub-gradient-info);
    color: #fff;
}

.badge-status-active {
    background: var(--hub-gradient-info);
    color: #fff;
}

.badge-status-review {
    background: var(--hub-gradient-warning);
    color: #fff;
}

.badge-status-planning {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #fff;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--hub-space-4);
}

.table th,
.table td {
    padding: var(--hub-space-3);
    text-align: left;
    border-bottom: 1px solid var(--hub-border);
}

.table th {
    font-weight: 600;
    color: var(--hub-text);
    background: var(--hub-surface-secondary);
}

.table tbody tr:hover {
    background-color: var(--hub-bg);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: var(--hub-space-2) var(--hub-space-3);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--hub-text);
    background-color: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    transition: var(--hub-transition);
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    display: block;
    margin-bottom: var(--hub-space-2);
    font-weight: 500;
    color: var(--hub-text);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-primary { color: var(--hub-primary) !important; }
.text-success { color: var(--hub-success) !important; }
.text-warning { color: var(--hub-warning) !important; }
.text-danger { color: var(--hub-danger) !important; }
.text-info { color: var(--hub-info) !important; }
.text-muted { color: var(--hub-text-muted) !important; }

.bg-primary { background: var(--hub-gradient-primary) !important; }
.bg-success { background: var(--hub-gradient-success) !important; }
.bg-warning { background: var(--hub-gradient-warning) !important; }
.bg-danger { background: var(--hub-gradient-danger) !important; }
.bg-info { background: var(--hub-gradient-info) !important; }

.bg-gradient-primary { background: var(--hub-gradient-primary) !important; }
.bg-gradient-secondary { background: var(--hub-gradient-success) !important; }
.bg-gradient-warning { background: var(--hub-gradient-warning) !important; }
.bg-gradient-danger { background: var(--hub-gradient-danger) !important; }
.bg-gradient-info { background: var(--hub-gradient-info) !important; }

.gradient-text {
    background: var(--hub-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-display {
    background: var(--hub-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--hub-font-mono);
    font-weight: 700;
}

.avatar-gradient {
    background: var(--hub-gradient-primary);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Hover Effects */
.hover-lift {
    transition: var(--hub-transition-slow);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--hub-shadow-lg);
}

/* Progress Bars */
.progress-glass {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--hub-radius);
    height: 0.5rem;
    overflow: hidden;
}

.progress-bar-gradient {
    background: var(--hub-gradient-primary);
    border-radius: var(--hub-radius);
    height: 100%;
}

.mon-hero {
    position: relative;
    padding: 3rem 2rem 4rem;
    background: var(--hub-gradient-hero);
    overflow: hidden;
    margin-bottom: -2rem;
    text-align:center;
}

/* Project Dashboard */
.projectflow-dashboard {
    max-width: 90%;
    margin: 0 auto;
}

/* ==========================================================================
   Dropfiles Styling (Component Override)
   ========================================================================== */
.dropfiles-content,
.dropfiles-dropblock-content,
.dropfiles-content .breadcrumbs {
    background: transparent !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
    display: block;
    font-size: 0.8125rem;
    background: var(--hub-surface);
    min-height: 50px;
    min-width: 12rem !important;
    padding: var(--hub-space-4);
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
    width: calc(33.333% - 20px) !important;
    float: left;
    box-sizing: border-box;
    flex-grow: 1;
    margin: 10px;
    transition: var(--hub-transition);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file:hover {
    box-shadow: var(--hub-shadow-md);
    transform: translateY(-2px);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .ext.ext-pdf {
    display: block;
    margin: auto;
    clear: both;
    float: none !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file h3 {
    display: block;
    margin: auto;
    clear: both;
    float: none !important;
    text-align: center;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .filecontent {
    width: 100% !important;
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file a.downloadlink {
    background-color: var(--hub-primary) !important;
    border-radius: var(--hub-radius-sm);
}

.dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file .file-right {
    display: flex;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large screens */
@media (min-width: 1400px) {
    .hub-main.has-sidebar {
        padding: 0;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .hub-menu-toggle {
        display: none;
    }

    .hub-sidebar-overlay {
        display: none !important;
    }
}

/* Tablet & Mobile */
@media (max-width: 991.98px) {
    .hub-sidebar {
        transform: translateX(-100%);
        width: var(--hub-sidebar-width-px);
        min-width: var(--hub-sidebar-width-px);
        transition: transform 0.3s ease;
    }

    .hub-sidebar.open {
        transform: translateX(0);
    }

    .hub-main.has-sidebar {
        margin-left: 0;
        min-width: 100%;
        padding-top: calc(var(--hub-space-5) + 60px);
    }

    .hub-footer.has-sidebar {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .hub-main {
        padding: var(--hub-space-3);
    }

    .oui_interface,
    .projectflow-dashboard {
        max-width: 100%;
        padding: var(--hub-space-2);
    }

    .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
        width: 100% !important;
        margin: var(--hub-space-2) 0;
    }
}

/* Small Mobile */
@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }

    .card-body {
        padding: var(--hub-space-3);
    }

    .btn {
        padding: var(--hub-space-2) var(--hub-space-3);
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .hub-sidebar,
    .hub-menu-toggle,
    .hub-sidebar-overlay {
        display: none !important;
    }

    .hub-main.has-sidebar {
        margin-left: 0;
        min-width: 100%;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Page Loading Overlay
   ========================================================================== */
.hub-page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hub-page-loader.active {
    opacity: 1;
    visibility: visible;
}

.hub-loader-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--hub-gradient-primary);
    position: relative;
    animation: hub-pulse 1.5s ease-in-out infinite;
}

.hub-loader-spinner::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: white;
    border-radius: 50%;
}

.hub-loader-spinner::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--hub-gradient-primary);
    animation: hub-spin 1s linear infinite;
}

@keyframes hub-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

.hub-loader-text {
    margin-top: var(--hub-space-4);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hub-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hub-loader-dots {
    display: inline-flex;
    gap: 4px;
}

.hub-loader-dots span {
    width: 6px;
    height: 6px;
    background: var(--hub-primary);
    border-radius: 50%;
    animation: hub-bounce 1.4s ease-in-out infinite both;
}

.hub-loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.hub-loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes hub-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

/* Theme Toggle Button */
.hub-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hub-space-2);
    width: 100%;
    padding: var(--hub-space-3);
    margin-bottom: var(--hub-space-3);
    background: var(--hub-bg);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    color: var(--hub-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--hub-transition);
}

.hub-theme-toggle:hover {
    background: var(--hub-primary);
    border-color: var(--hub-primary);
    color: #fff;
}

/* OUI4All panel header uses Hub gradient */
.oui4all__header {
    background: linear-gradient(135deg, #4285F4 0%, #34A853 50%, #FBBC05 100%) !important;
    color: #fff !important;
}
.oui4all__header .oui4all__title {
    color: #fff !important;
}
.oui4all__header .oui4all__reset,
.oui4all__header .oui4all__close {
    color: #fff !important;
}

/* Hide the default OUI4All floating button - sidebar has the trigger */
.oui4all__openbtn {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
}

/* Dark Mode CSS Custom Properties */
[data-theme="dark"] {
    /* Primary Colors - Keep accent colors similar */
    --hub-primary: #818cf8;
    --hub-primary-light: #a5b4fc;
    --hub-primary-dark: #6366f1;
    --hub-secondary: #a78bfa;

    /* Semantic Colors - Slightly brighter for dark bg */
    --hub-success: #34d399;
    --hub-warning: #fbbf24;
    --hub-danger: #f87171;
    --hub-info: #60a5fa;

    /* Background & Surface - Dark palette */
    --hub-bg: #0f172a;
    --hub-surface: #1e293b;
    --hub-surface-secondary: #334155;

    /* Text Colors - Light on dark */
    --hub-text: #f1f5f9;
    --hub-text-secondary: #94a3b8;
    --hub-text-muted: #64748b;

    /* Borders - Subtle on dark */
    --hub-border: #334155;
    --hub-border-light: rgba(255, 255, 255, 0.1);

    /* Effects - Adapted for dark */
    --hub-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --hub-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --hub-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --hub-shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Glass Effect - Dark glass */
    --hub-glass-bg: rgba(30, 41, 59, 0.8);
    --hub-glass-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Dark Mode - Base Styles
   ========================================================================== */
[data-theme="dark"] body {
    background-color: var(--hub-bg);
    color: var(--hub-text);
}

[data-theme="dark"] a {
    color: var(--hub-primary);
}

[data-theme="dark"] a:hover {
    color: var(--hub-primary-light);
}

/* ==========================================================================
   Dark Mode - Sidebar
   ========================================================================== */
[data-theme="dark"] .hub-sidebar {
    background: var(--hub-surface);
    border-right-color: var(--hub-border);
}

[data-theme="dark"] .hub-logo-svg {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-nav .menu > li > a,
[data-theme="dark"] .hub-nav ul > li > a,
[data-theme="dark"] .mod-menu .nav-link {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-nav .menu > li > a:hover,
[data-theme="dark"] .hub-nav ul > li > a:hover,
[data-theme="dark"] .mod-menu .nav-link:hover {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-nav .menu > li.active > a,
[data-theme="dark"] .hub-nav .menu > li.current > a,
[data-theme="dark"] .hub-nav ul > li.active > a,
[data-theme="dark"] .hub-nav ul > li.current > a,
[data-theme="dark"] .mod-menu .nav-item.active > .nav-link,
[data-theme="dark"] .mod-menu .nav-item.current > .nav-link {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item > a {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item > a:hover,
[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item.active > a,
[data-theme="dark"] .hub-nav .mod-menu__sub .nav-item.current > a {
    background-color: var(--hub-bg);
    color: var(--hub-primary);
}

[data-theme="dark"] .hub-sidebar-footer {
    border-top-color: var(--hub-border);
}

[data-theme="dark"] .hub-logout {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .hub-logout:hover {
    background-color: rgba(248, 113, 113, 0.15);
    color: var(--hub-danger);
}

/* ==========================================================================
   Dark Mode - Mobile Menu
   ========================================================================== */
[data-theme="dark"] .hub-menu-toggle {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-menu-toggle:hover {
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .hub-menu-toggle svg {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   Dark Mode - Cards
   ========================================================================== */
[data-theme="dark"] .card,
[data-theme="dark"] .glass-card {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .glass-card {
    background: var(--hub-glass-bg);
    border-color: var(--hub-glass-border);
}

[data-theme="dark"] .card-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .card-footer {
    border-top-color: var(--hub-border);
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Alerts
   ========================================================================== */
[data-theme="dark"] .alert-success {
    background-color: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.25);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fcd34d;
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error {
    background-color: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
}

/* ==========================================================================
   Dark Mode - Tables
   ========================================================================== */
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .table th {
    color: var(--hub-text);
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Forms
   ========================================================================== */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    color: var(--hub-text);
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--hub-text-muted);
}

[data-theme="dark"] .form-label {
    color: var(--hub-text);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--hub-surface);
    color: var(--hub-text);
    border-color: var(--hub-border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--hub-primary);
    outline-color: var(--hub-primary);
}

/* ==========================================================================
   Dark Mode - Buttons
   ========================================================================== */
[data-theme="dark"] .btn-outline-primary {
    border-color: var(--hub-primary);
    color: var(--hub-primary);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--hub-primary);
    color: #fff;
}

[data-theme="dark"] .btn-light {
    background: var(--hub-surface-secondary);
    color: var(--hub-text);
    border-color: var(--hub-border);
}

[data-theme="dark"] .btn-light:hover {
    background: var(--hub-border);
}

/* ==========================================================================
   Dark Mode - Text Utilities
   ========================================================================== */
[data-theme="dark"] .text-dark {
    color: var(--hub-text) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--hub-text-muted) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--hub-text-secondary) !important;
}

[data-theme="dark"] .text-body {
    color: var(--hub-text) !important;
}

/* ==========================================================================
   Dark Mode - Background Utilities
   ========================================================================== */
[data-theme="dark"] .bg-white {
    background-color: var(--hub-surface) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--hub-surface-secondary) !important;
}

[data-theme="dark"] .bg-body {
    background-color: var(--hub-bg) !important;
}

/* ==========================================================================
   Dark Mode - Borders
   ========================================================================== */
[data-theme="dark"] .border {
    border-color: var(--hub-border) !important;
}

[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--hub-border) !important;
}

/* ==========================================================================
   Dark Mode - Dropfiles Override
   ========================================================================== */
[data-theme="dark"] .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .dropfiles-content.dropfiles-content-default .dropfiles-container-default .dropfiles_list .file:hover {
    background: var(--hub-surface-secondary);
}

/* ==========================================================================
   Dark Mode - Page Loader
   ========================================================================== */
[data-theme="dark"] .hub-page-loader {
    background: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .hub-loader-spinner::before {
    background: var(--hub-surface);
}

[data-theme="dark"] .hub-loader-text {
    color: var(--hub-text-secondary);
}

/* ==========================================================================
   Dark Mode - Progress Bars
   ========================================================================== */
[data-theme="dark"] .progress,
[data-theme="dark"] .progress-glass {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Dark Mode - Modals & Offcanvas
   ========================================================================== */
[data-theme="dark"] .modal-content {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--hub-border);
}

[data-theme="dark"] .offcanvas {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .offcanvas-header {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   Dark Mode - Dropdowns
   ========================================================================== */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--hub-text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .dropdown-divider {
    border-top-color: var(--hub-border);
}

/* ==========================================================================
   Dark Mode - List Groups
   ========================================================================== */
[data-theme="dark"] .list-group-item {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .list-group-item:hover {
    background-color: var(--hub-surface-secondary);
}

[data-theme="dark"] .list-group-item.active {
    background-color: var(--hub-primary);
    border-color: var(--hub-primary);
}

/* ==========================================================================
   Dark Mode - Accordions
   ========================================================================== */
[data-theme="dark"] .accordion-item {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .accordion-button {
    background-color: var(--hub-surface);
    color: var(--hub-text);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-primary);
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   Dark Mode - Tabs & Nav
   ========================================================================== */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--hub-border);
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--hub-surface);
    border-color: var(--hub-border) var(--hub-border) var(--hub-surface);
    color: var(--hub-primary);
}

[data-theme="dark"] .nav-pills .nav-link {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .nav-pills .nav-link:hover {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: var(--hub-primary);
    color: #fff;
}

/* ==========================================================================
   Dark Mode - Breadcrumbs
   ========================================================================== */
[data-theme="dark"] .breadcrumb {
    background-color: var(--hub-surface);
}

[data-theme="dark"] .breadcrumb-item a {
    color: var(--hub-primary);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: var(--hub-text-secondary);
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--hub-text-muted);
}

/* ==========================================================================
   Dark Mode - Pagination
   ========================================================================== */
[data-theme="dark"] .page-link {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .page-link:hover {
    background-color: var(--hub-surface-secondary);
    border-color: var(--hub-border);
    color: var(--hub-primary);
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--hub-primary);
    border-color: var(--hub-primary);
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text-muted);
}

/* ==========================================================================
   Dark Mode - Tooltips & Popovers
   ========================================================================== */
[data-theme="dark"] .tooltip-inner {
    background-color: var(--hub-surface-secondary);
    color: var(--hub-text);
}

[data-theme="dark"] .popover {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .popover-header {
    background-color: var(--hub-surface-secondary);
    border-bottom-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] .popover-body {
    color: var(--hub-text);
}

/* ==========================================================================
   Dark Mode - Code & Pre
   ========================================================================== */
[data-theme="dark"] code {
    background-color: var(--hub-surface-secondary);
    color: #f472b6;
}

[data-theme="dark"] pre {
    background-color: var(--hub-surface);
    border-color: var(--hub-border);
    color: var(--hub-text);
}

[data-theme="dark"] pre code {
    background-color: transparent;
}

/* ==========================================================================
   Dark Mode - HR
   ========================================================================== */
[data-theme="dark"] hr {
    border-color: var(--hub-border);
    opacity: 1;
}

/* ==========================================================================
   Dark Mode - Shadows (already in variables, but ensure override)
   ========================================================================== */
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg {
    box-shadow: var(--hub-shadow) !important;
}

/* ==========================================================================
   Dark Mode - Component-Specific Overrides
   ========================================================================== */

/* ProjectFlow specific */
[data-theme="dark"] .projects-hero {
    background: linear-gradient(135deg, var(--hub-surface) 0%, var(--hub-surface-secondary) 100%);
}

[data-theme="dark"] .stat-card {
    background: var(--hub-surface);
}

[data-theme="dark"] .list-item {
    background: var(--hub-surface-secondary);
}

[data-theme="dark"] .list-item:hover {
    background: var(--hub-border);
}

[data-theme="dark"] .list-item-full {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

[data-theme="dark"] .list-item-full:hover {
    background: var(--hub-surface);
    border-color: var(--hub-text-muted);
}

/* Offcanvas gradients for dark mode */
[data-theme="dark"] .bg-gradient-warning-light,
[data-theme="dark"] .header-drafts {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%) !important;
}

[data-theme="dark"] .bg-gradient-primary-light,
[data-theme="dark"] .header-videos {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%) !important;
}

[data-theme="dark"] .bg-gradient-figma-light,
[data-theme="dark"] .header-figma {
    background: linear-gradient(135deg, rgba(162, 89, 255, 0.15) 0%, rgba(244, 78, 30, 0.1) 100%) !important;
}

/* Timer component */
[data-theme="dark"] .timer-display {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

/* Wiki/Documentation pages */
[data-theme="dark"] .wiki-content,
[data-theme="dark"] .documentation-content {
    background: var(--hub-surface);
}

[data-theme="dark"] .wiki-sidebar {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

/* Bootstrap Overrides for Dark Mode */
[data-theme="dark"] .bg-body-tertiary {
    background-color: var(--hub-surface-secondary) !important;
}

[data-theme="dark"] .bg-body-secondary {
    background-color: var(--hub-surface) !important;
}

[data-theme="dark"] .border-secondary {
    border-color: var(--hub-border) !important;
}

/* Text colors in dark mode */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--hub-text);
}

[data-theme="dark"] p {
    color: var(--hub-text);
}

[data-theme="dark"] .fw-semibold,
[data-theme="dark"] .fw-bold {
    color: inherit;
}

/* Ensure smooth transition when switching themes */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.hub-sidebar,
.hub-main,
.card,
.glass-card,
.form-control,
.form-select,
.btn,
.alert,
.modal-content,
.offcanvas,
.dropdown-menu,
.list-group-item,
.accordion-item,
.nav-tabs .nav-link,
.page-link {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==========================================================================
   REUSABLE VIEW COMPONENTS
   Use these classes across any view for consistent styling
   ========================================================================== */

/* View Container */
.hub-view {
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hub-view-hero {
    position: relative;
    padding: 3rem 2rem 4rem;
    background: var(--hub-gradient-hero);
    overflow: hidden;
    margin-bottom: -2rem;
}

.hub-view-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hub-view-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
}

.hub-view-hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Hero Badge (for company name, status, etc.) */
.hub-view-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hub-view-hero-badge svg {
    opacity: 0.9;
}

/* Hero Decoration */
.hub-view-hero-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hub-view-hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.hub-view-hero-circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
}

.hub-view-hero-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
}

.hub-view-hero-circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hero Actions (top right buttons) */
.hub-view-hero-actions {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 3;
}

.hub-view-btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: var(--hub-transition-slow);
    cursor: pointer;
}

.hub-view-btn-hero:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.hub-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Toolbar (Search & Filters)
   -------------------------------------------------------------------------- */


/* Search Box */
.hub-view-search-wrapper {
    margin-bottom: 1rem;
}

.hub-view-search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--hub-surface-secondary);
    border: 2px solid var(--hub-border);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    transition: var(--hub-transition-slow);
        position: relative;
    z-index: 10;
}

.hub-view-search-box:focus-within {
    border-color: var(--hub-primary);
    background: var(--hub-surface);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.hub-view-search-icon {
    color: var(--hub-text-muted);
    flex-shrink: 0;
}

.hub-view-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--hub-text);
    outline: none;
    min-width: 0;
}

.hub-view-search-input::placeholder {
    color: var(--hub-text-muted);
}

.hub-view-search-submit {
    padding: 0.625rem 1.5rem;
    background: var(--hub-gradient-primary-short);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--hub-transition-slow);
    white-space: nowrap;
}

.hub-view-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Filters */
.hub-view-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hub-view-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 180px;
}

.hub-view-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hub-text-secondary);
}

.hub-view-filter-label svg {
    color: var(--hub-text-muted);
}

.hub-view-filter-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: var(--hub-surface-secondary);
    border: 2px solid var(--hub-border);
    border-radius: var(--hub-radius-sm);
    font-size: 0.875rem;
    color: var(--hub-text);
    cursor: pointer;
    transition: var(--hub-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.hub-view-filter-select:hover {
    border-color: var(--hub-primary-light);
}

.hub-view-filter-select:focus {
    outline: none;
    border-color: var(--hub-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --------------------------------------------------------------------------
   Stats Grid
   -------------------------------------------------------------------------- */
.hub-view-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.hub-view-stat-card {
    background: var(--hub-surface);
    border-radius: var(--hub-radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--hub-shadow);
    border: 1px solid var(--hub-border);
    transition: var(--hub-transition-slow);
}

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

.hub-view-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.hub-view-stat-value.success { color: var(--hub-success); }
.hub-view-stat-value.danger { color: var(--hub-danger); }
.hub-view-stat-value.warning { color: var(--hub-warning); }
.hub-view-stat-value.primary { color: var(--hub-primary); }
.hub-view-stat-value.info { color: var(--hub-info); }

.hub-view-stat-label {
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Notice/Alert Banner
   -------------------------------------------------------------------------- */
.hub-view-notice {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--hub-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--hub-primary-dark);
}

.hub-view-notice svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Cards Grid (for card-based layouts)
   -------------------------------------------------------------------------- */
.hub-view-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   List Layout (for item-based layouts)
   -------------------------------------------------------------------------- */
.hub-view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   Item Card (universal card component)
   -------------------------------------------------------------------------- */
.hub-view-item {
    background: var(--hub-surface);
    border-radius: var(--hub-radius);
    padding: 1.5rem;
    border: 1px solid var(--hub-border);
    transition: var(--hub-transition-slow);
}

.hub-view-item:hover {
    box-shadow: var(--hub-shadow-lg);
    border-color: var(--hub-primary-light);
    transform: translateY(-2px);
}

.hub-view-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hub-view-item-info {
    flex: 1;
    min-width: 0;
}

.hub-view-item-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hub-view-item-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hub-text);
    margin: 0;
}

.hub-view-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hub-view-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hub-view-item-badge.purple {
    background: rgba(99, 102, 241, 0.15);
    color: var(--hub-primary);
}

.hub-view-item-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--hub-success);
}

.hub-view-item-badge.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--hub-warning);
}

.hub-view-item-badge.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--hub-danger);
}

.hub-view-item-badge.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--hub-info);
}

.hub-view-item-description {
    font-size: 0.875rem;
    color: var(--hub-text-secondary);
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.hub-view-item-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-border);
}

.hub-view-item-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--hub-text-secondary);
}

.hub-view-item-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--hub-text-muted);
}

/* Item Icon */
.hub-view-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hub-radius-sm);
    background: var(--hub-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-view-item-icon svg {
    width: 24px;
    height: 24px;
    color: var(--hub-text-muted);
}

/* Item Footer */
.hub-view-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hub-border);
}

/* --------------------------------------------------------------------------
   Status Badge
   -------------------------------------------------------------------------- */
.hub-view-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.hub-view-status-badge.online,
.hub-view-status-badge.success {
    background: var(--hub-success);
}

.hub-view-status-badge.offline,
.hub-view-status-badge.danger {
    background: var(--hub-danger);
}

.hub-view-status-badge.warning {
    background: var(--hub-warning);
}

/* --------------------------------------------------------------------------
   Action Buttons
   -------------------------------------------------------------------------- */
.hub-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--hub-gradient-primary-short);
    color: white;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--hub-transition-slow);
    border: none;
    cursor: pointer;
}

.hub-view-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: white;
}

.hub-view-btn-outline {
    background: transparent;
    border: 2px solid var(--hub-primary);
    color: var(--hub-primary);
}

.hub-view-btn-outline:hover {
    background: var(--hub-primary);
    color: white;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.hub-view-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--hub-surface);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow);
    border: 1px solid var(--hub-border);
}

.hub-view-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--hub-text-muted);
    opacity: 0.5;
}

.hub-view-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hub-text);
    margin: 0 0 0.5rem;
}

.hub-view-empty p {
    color: var(--hub-text-secondary);
    margin: 0 0 1.5rem;
}

/* --------------------------------------------------------------------------
   URL/Link Style
   -------------------------------------------------------------------------- */
.hub-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--hub-primary);
    text-decoration: none;
    transition: var(--hub-transition);
}

.hub-view-link:hover {
    color: var(--hub-primary-dark);
    text-decoration: underline;
}

.hub-view-link svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Value Display (uptime, percentages, etc.)
   -------------------------------------------------------------------------- */
.hub-view-value-display {
    text-align: right;
}

.hub-view-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.hub-view-value.success { color: var(--hub-success); }
.hub-view-value.danger { color: var(--hub-danger); }
.hub-view-value.warning { color: var(--hub-warning); }
.hub-view-value.primary { color: var(--hub-primary); }
.hub-view-value.info { color: var(--hub-info); }

.hub-view-value-label {
    font-size: 0.75rem;
    color: var(--hub-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Secondary Stats Block (like Plausible stats)
   -------------------------------------------------------------------------- */
.hub-view-secondary-stats {
    background: var(--hub-surface-secondary);
    border-radius: var(--hub-radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.hub-view-secondary-stats-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hub-text-secondary);
    margin-bottom: 0.75rem;
}

.hub-view-secondary-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.hub-view-secondary-stat {
    text-align: center;
}

.hub-view-secondary-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.hub-view-secondary-stat-label {
    font-size: 0.6875rem;
    color: var(--hub-text-muted);
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Item Actions
   -------------------------------------------------------------------------- */
.hub-view-item-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Responsive Styles for View Components
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .hub-view-secondary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hub-view-hero {
        padding: 2rem 1rem 3rem;
    }

    .hub-view-hero-title {
        font-size: 1.75rem;
    }



    .hub-view-search-box {
        flex-wrap: wrap;
        border-radius: var(--hub-radius-sm);
        padding: 0.75rem;
    }

    .hub-view-search-input {
        width: 100%;
        order: -1;
    }

    .hub-view-filters {
        flex-direction: column;
    }

    .hub-view-filter-group {
        min-width: 100%;
    }

    .hub-view-item-header {
        flex-direction: column;
    }

    .hub-view-value-display {
        text-align: left;
    }

    .hub-view-hero-actions {
        position: static;
        text-align: center;
        margin-top: 1rem;
    }

    .hub-view-secondary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hub-view-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hub-view-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Dark Mode for View Components
   -------------------------------------------------------------------------- */

[data-theme="dark"] .hub-view-item,
[data-theme="dark"] .hub-view-stat-card,
[data-theme="dark"] .hub-view-empty {
    background: var(--hub-surface);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-view-search-box,
[data-theme="dark"] .hub-view-filter-select,
[data-theme="dark"] .hub-view-secondary-stats {
    background: var(--hub-surface-secondary);
    border-color: var(--hub-border);
}

[data-theme="dark"] .hub-view-search-input {
    color: var(--hub-text);
}

[data-theme="dark"] .hub-view-item-icon {
    background: var(--hub-surface-secondary);
}

/* System messages - fixed top right */
#system-message-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    max-width: 420px;
    width: 100%;
}

#system-message-container:empty {
    display: none;
}
