/* Copied from server/static/dashboard.css to keep portal standalone */
/* Dashboard Specific Styles */

/* Dashboard Body */
.dashboard-body {
    background-color: #F8F9FA;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Dashboard Header */
.dashboard-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #302403;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #F7F7F7;
    color: #D6B301;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: #302403;
    font-size: 20px;
    font-weight: 700;
}

.dashboard-logo .brand-logo {
    --logo-h: 68px;
}

.dashboard-logo .brand-text {
    font-size: 20px;
    font-weight: 700;
    color: #302403;
}

.dashboard-logo:hover .brand-text {
    color: #B89A00;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: #F7F7F7;
    border-radius: 25px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: #D6B301;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 16px;
}

.user-name {
    font-weight: 600;
    color: #302403;
    font-size: 14px;
}

.logout-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #302403;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #F7F7F7;
    color: #E74C3C;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background-color: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 999;
}

.dashboard-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #6B7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background-color: #F7F7F7;
    color: #302403;
}

.nav-item.active .nav-link {
    background-color: #D6B301;
    color: #FFFFFF;
}

.nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #B89A00;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-badge {
    background-color: #E74C3C;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    transition: margin-left 0.3s ease;
}

.dashboard-main.expanded {
    margin-left: 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #E5E7EB;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #302403;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #FFFFFF;
}

.stat-icon.gold { background: linear-gradient(135deg, #D6B301, #B89A00); }
.stat-icon.blue { background: linear-gradient(135deg, #3498DB, #2980B9); }
.stat-icon.green { background: linear-gradient(135deg, #27AE60, #229954); }
.stat-icon.red { background: linear-gradient(135deg, #E74C3C, #C0392B); }

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: #302403;
    margin: 0 0 4px 0;
}

.stat-label {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 8px;
    display: inline-block;
}

.stat-change.positive { background-color: #D4EDDA; color: #155724; }
.stat-change.negative { background-color: #F8D7DA; color: #721C24; }
.stat-change.neutral { background-color: #E2E3E5; color: #6C757D; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.content-grid.single {
    grid-template-columns: 1fr;
}

/* Widget */
.widget {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.widget-wide {
    grid-column: 1 / -1;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F8F9FA;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #302403;
    margin: 0;
}

.widget-link {
    color: #D6B301;
    font-size: 14px;
    font-weight: 500;
}

.widget-content {
    padding: 24px;
}

/* Filter Form */
.filter-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-form .form-group {
    margin-bottom: 0;
    flex: 1;
}

.filter-form .form-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B7280;
}

.filter-form input,
.filter-form select {
    padding: 10px 14px;
}

/* Incidents List */
.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.incident-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.incident-item.critical {
    background-color: #FEF2F2;
    border-left: 4px solid #E74C3C;
}

.incident-item.warning {
    background-color: #FFFBEB;
    border-left: 4px solid #F39C12;
}

.incident-item:hover {
    transform: translateX(4px);
}

.incident-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #FFFFFF;
    flex-shrink: 0;
}

.incident-item.critical .incident-icon { background-color: #E74C3C; }
.incident-item.warning .incident-icon { background-color: #F39C12; }

.incident-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #302403;
    margin: 0 0 4px 0;
}

.incident-meta {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

.incident-time {
    font-size: 12px;
    color: #9CA3AF;
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.screenshot-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.screenshot-item:hover {
    transform: scale(1.02);
}

.screenshot-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.screenshot-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background-color: #F8F9FA;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    text-decoration: none;
    color: #302403;
    transition: all 0.3s ease;
}

.quick-link:hover {
    background-color: #D6B301;
    color: #FFFFFF;
    border-color: #D6B301;
    transform: translateY(-2px);
}

.quick-link i {
    font-size: 28px;
}

.quick-link span {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #F8F9FA;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.device-item:hover {
    background-color: #E5E7EB;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-icon {
    width: 40px;
    height: 40px;
    background-color: #D6B301;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.device-name {
    font-weight: 600;
    color: #302403;
}

.device-count {
    font-size: 13px;
    color: #6B7280;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Screenshot Modal */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screenshot-modal.open {
    display: flex;
}

.modal-content {
    background-color: #FFFFFF;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F8F9FA;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #302403;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.close-modal:hover {
    color: #302403;
}

.modal-body {
    padding: 20px;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-right {
        gap: 12px;
    }
    
    .user-name {
        display: none;
    }
    
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .widget-content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .screenshot-gallery {
        grid-template-columns: 1fr;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widget, .stat-card {
    animation: fadeIn 0.3s ease-out;
}

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-width: 100%;
}

