/* Dashboard Specific Styles - Dialog Theme */

/* Import Dialog Design System */
@import url('./dialog-design-system.css');
@import url('./dialog-buttons.css');
@import url('./dialog-cards.css');
@import url('./dialog-typography.css');
@import url('./dialog-forms.css');

.dashboard-container {
    min-height: 100vh;
    background: var(--dialog-bg-primary);
    display: flex;
    font-family: var(--dialog-font-family);
}

/* Sidebar */
.sidebar {
    width: 15rem;
    background: var(--dialog-bg-card);
    border-right: 0.0625rem solid var(--dialog-border-light);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    padding: var(--dialog-space-md) 0;
    box-shadow: 0.25rem 0 0.9375rem var(--dialog-shadow-light);
}

.sidebar-header {
    min-height: 6.5rem;
    padding: 0.5rem;
    border-bottom: 0.0625rem solid var(--dialog-border-light);
    margin-bottom: var(--dialog-space-md);
    align-items: center;
    justify-content: center;
    display: flex;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--dialog-space-md);
}

.sidebar-logo img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--dialog-radius-lg);
    object-fit: cover;
}

.sidebar-header h2 {
    /*font-size: var(--dialog-font-size-lg);
    font-weight: 600;
    color: var(--dialog-text-primary);*/
    background: linear-gradient(135deg, var(--dialog-primary) 0%, var(--dialog-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-size: 1.4rem;
}

.sidebar-nav {
    padding: 0 var(--dialog-space-md);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: var(--dialog-space-sm);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--dialog-space-md);
    padding: var(--dialog-space-md);
    color: var(--dialog-text-secondary);
    text-decoration: none;
    border-radius: var(--dialog-radius-lg);
    transition: all var(--dialog-transition-normal);
    font-weight: 500;
    font-size: var(--dialog-font-size-sm);
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--dialog-primary);
    color: var(--dialog-text-white);
    transform: translateX(0.25rem);
    text-decoration: none;
    box-shadow: 0 0.25rem 0.75rem rgba(241, 38, 114, 0.3);
}

.sidebar-nav svg {
    width: 1.125rem;
    height: 1.125rem;
}

.sidebar-footer {
    position: absolute;
    bottom: var(--dialog-space-lg);
    left: var(--dialog-space-md);
    right: var(--dialog-space-md);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--dialog-space-md);
    padding: var(--dialog-space-md);
    background: var(--dialog-bg-blue);
    border-radius: var(--dialog-radius-lg);
    /*border: 0.0625rem solid var(--dialog-border-light);*/
}

.user-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--dialog-radius-full);
    background: var(--dialog-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dialog-text-white);
    font-weight: 600;
    font-size: var(--dialog-font-size-xs);
}

.user-info h4 {
    font-size: var(--dialog-font-size-sm);
    font-weight: 600;
    color: var(--dialog-text-primary);
    margin-bottom: 0.125rem;
}

.user-info p {
    font-size: var(--dialog-font-size-xs);
    color: var(--dialog-text-secondary);
    margin: 0;
}

/* Main Content */
.main-content {
    margin-left: 15rem;
    /*padding: var(--dialog-space-md);*/
    flex: 1;
    min-height: 100vh;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--dialog-orange) 0%, var(--dialog-purple) 100%);
    border: 0.0625rem solid var(--dialog-border-light);
    border-radius: var(--dialog-radius-lg);
    margin-bottom: 0;
    /* padding: var(--dialog-space-lg); */
    box-shadow: 0 0.125rem 0.5rem var(--dialog-shadow-light);
    border-bottom: 0.0625rem solid var(--glass-border);
    padding: var(--dialog-space-lg) var(--dialog-space-md);
    position: sticky;
    top: 0.8rem;
    z-index: 50;
}

.dashboard-bg {
background: var(--dialog-bg-primary);
    position: sticky;
    top: 0rem;
    z-index: 50;
    padding: 1rem var(--dialog-space-md);
    padding-bottom: 0;
}

.header-content {
    max-width: 87.5rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo img {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    object-fit: cover;
}

.header-logo h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-0.125rem);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-0.125rem);
}

/* Main Content */
.dashboard-main {
    max-width: 87.5rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
    gap: 1.125rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.125rem;
    text-align: center;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Content Section */
.content-section {
    padding: 1.25rem;
    margin-bottom: 1.125rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.125rem;
}

.section-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

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

.btn-success:hover {
    background: #059669;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: rgba(255, 255, 255, 0.05);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.0.3125rem;
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 1rem;
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.05);
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.btn-warning:hover {
    background: #d97706;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(0.3125rem);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 31.25rem;
    width: 100%;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.75rem 1.25rem;
}

.empty-state-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0.3125rem);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3.75rem;
    height: 3.75rem;
    border: 0.25rem solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Header Icon Buttons */
.header-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.header-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: #f9fafb;
}

.header-icon-btn.btn-logout {
    color: #ef4444;
}

.header-icon-btn.btn-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Responsive Design */
@media (max-width: 48rem) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .section-header .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        border-radius: 0.75rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 30rem) {
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    th, td {
        padding: 0.625rem 0.375rem;
        font-size: 0.8rem;
    }
}

/* ===============================
   ENHANCED DASHBOARD STYLES
   =============================== */

/* Dashboard Grid Layout */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Enhanced Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stat-icon-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
}

.stat-icon-green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.stat-icon-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.stat-icon-orange {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.trend-up {
    color: #10B981;
    font-weight: 600;
}

.trend-down {
    color: #EF4444;
    font-weight: 600;
}

.trend-neutral {
    color: var(--text-muted);
    font-weight: 500;
}

.trend-text {
    color: var(--text-muted);
}

/* Analytics Row */
.analytics-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    padding: 1.5rem;
}

.chart-card h3 {
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Location List */
.location-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--accent-color);
    border-radius: 0.75rem;
    border: 0.0625rem solid var(--glass-border);
    transition: all 0.3s ease;
}

.location-item:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(239, 68, 68, 0.1);
}

.location-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.location-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.location-stats {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-block {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
}

/* Activity Row */
.activity-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.activity-card {
    padding: 1.5rem;
}

/* Enhanced Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.0.3125rem;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-secondary {
    background: #F3F4F6;
    color: #374151;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Enhanced Responsive Design */
@media (max-width: 64rem) {
    .analytics-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    }
}

@media (max-width: 48rem) {
    .dashboard-grid {
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analytics-row {
        gap: 1rem;
    }
    
    .location-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .location-actions {
        width: 100%;
    }
    
    .btn-block {
        width: 100%;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
    
    .activity-card {
        padding: 1rem;
    }
}

/* Enhanced Usage Analytics Styles */
.usage-page {
    padding: 1.25rem;
    max-width: 100%;
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.875rem;
}

.stat-card-small {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(0.625rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card-small:hover {
    transform: translateY(-0.3125rem);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0.625rem 25px rgba(0, 0, 0, 0.1);
}

.stat-card-small .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card-small .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.0.3125rem;
}

/* Status badges for usage table */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.status-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 0.0625rem solid rgba(40, 167, 69, 0.3);
}

.status-badge.status-info {
    background-color: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 0.0625rem solid rgba(23, 162, 184, 0.3);
}

.status-badge.status-error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 0.0625rem solid rgba(220, 53, 69, 0.3);
}

.status-badge.status-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 0.0625rem solid rgba(255, 193, 7, 0.3);
}

/* Mock data notice styling */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    border-left: 0.25rem solid;
}

.alert.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left-color: #ffc107;
}

.alert.alert-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left-color: #dc3545;
}

.alert.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Enhanced action buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: nowrap;
}

.action-buttons .btn {
    padding: 0.375rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
}

.action-buttons .btn svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.action-buttons .btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Pagination improvements */
.pagination-controls {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9rem;
    min-height: 2.25rem;
    white-space: nowrap;
}

.pagination-controls .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-controls .btn svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
}

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 0.25rem;
    font-weight: bold;
}

.pagination-info-only {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-right: 0.9375rem;
}

/* Enhanced table styles */
.table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e83e8c;
}

/* Loading spinner */
.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 0.25rem solid rgba(255, 255, 255, 0.1);
    border-left: 0.25rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
