/**
 * Admin Dashboard CSS
 * Custom styles for the AdminLTE-based dashboard
 * Responsive design with modern UI components
 * 
 * @author PacePro Development Team
 * @version 1.0.0
 */

/* ==========================================================================
   Dashboard Layout & General Styles
   ========================================================================== */

.content-wrapper {
    background-color: #f8f9fa;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0;
}

.content-header h1 i {
    margin-right: 8px;
}

.content-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb {
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #007bff;
}

.breadcrumb-item.active {
    color: #495057;
}

/* ==========================================================================
   Period Selection & Actions
   ========================================================================== */

.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
}

.dropdown-header {
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #e9ecef;
    transform: translateX(2px);
}

.dropdown-item.active {
    background-color: #007bff;
    color: white;
}

.dropdown-item.active:hover {
    background-color: #0056b3;
}

/* ==========================================================================
   Metric Cards & Info Boxes
   ========================================================================== */

.small-box {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.small-box .inner {
    padding: 20px;
}

.small-box h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.small-box p {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.small-box small {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.small-box .icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 3rem;
}

.small-box .small-box-footer {
    background: rgba(0, 0, 0, 0.1);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    transition: background 0.2s ease;
}

.small-box .small-box-footer:hover {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* Info Boxes */
.info-box {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.info-box:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.info-box-icon {
    border-radius: 8px 0 0 8px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
}

.info-box-content {
    padding: 15px;
}

.info-box-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #495057;
    margin: 5px 0;
}

/* Gradient Info Boxes */
.info-box.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.info-box.bg-gradient-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.info-box.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: white;
}

.info-box.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.info-box.bg-gradient-info .info-box-text,
.info-box.bg-gradient-success .info-box-text,
.info-box.bg-gradient-warning .info-box-text,
.info-box.bg-gradient-danger .info-box-text {
    color: rgba(255, 255, 255, 0.9);
}

.info-box.bg-gradient-info .info-box-number,
.info-box.bg-gradient-success .info-box-number,
.info-box.bg-gradient-warning .info-box-number,
.info-box.bg-gradient-danger .info-box-number {
    color: white;
}

.info-box.bg-gradient-info .progress-description,
.info-box.bg-gradient-success .progress-description,
.info-box.bg-gradient-warning .progress-description,
.info-box.bg-gradient-danger .progress-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
}

/* ==========================================================================
   Cards & Charts
   ========================================================================== */

.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
}

.card-title i {
    margin-right: 6px;
}

.card-tools .btn-tool {
    background: none;
    border: none;
    color: #6c757d;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.card-tools .btn-tool:hover {
    background-color: #e9ecef;
    color: #495057;
}

.card-body {
    padding: 20px;
}

.card.card-success .card-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.card.card-success .card-title {
    color: white;
}

.card.card-success .card-tools .btn-tool {
    color: rgba(255, 255, 255, 0.8);
}

.card.card-success .card-tools .btn-tool:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

canvas {
    border-radius: 8px;
}

/* Maximized Card Styles */
.maximized-card {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1050 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: auto;
}

.maximized-card .card-body {
    height: calc(100vh - 80px);
    overflow: auto;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.002);
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
}

.table-responsive {
    border-radius: 8px;
}

/* ==========================================================================
   Progress Bars
   ========================================================================== */

.progress {
    height: 6px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.progress-bar {
    border-radius: 3px;
    transition: width 0.6s ease;
}

.progress-sm {
    height: 4px;
}

/* ==========================================================================
   Badges & Labels
   ========================================================================== */

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.6em;
    border-radius: 6px;
}

.badge-primary {
    background-color: #007bff;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-info {
    background-color: #17a2b8;
}

.badge-light {
    background-color: #f8f9fa;
    color: #495057;
}

/* ==========================================================================
   Alerts & Insights
   ========================================================================== */

.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

.alert h5 {
    color: inherit;
    font-weight: 600;
}

.alert ul {
    margin-bottom: 0;
}

.alert li {
    margin-bottom: 8px;
}

/* ==========================================================================
   Loading & Animations
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
    color: #007bff;
}

.loading-spinner p {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 500;
}

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

/* Fade in animation for cards */
.card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Counter animation */
.counter-animation {
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .small-box .inner {
        padding: 15px;
    }
    
    .small-box h3 {
        font-size: 1.5rem;
    }
    
    .small-box .icon {
        font-size: 2.5rem;
        top: 15px;
        right: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .info-box-icon {
        width: 60px;
        font-size: 1.3rem;
    }
    
    .info-box-number {
        font-size: 1.4rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 10px;
    }
    
    .d-flex.justify-content-between .btn-group,
    .d-flex.justify-content-between .d-flex {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .col-lg-3.col-6 {
        margin-bottom: 20px;
    }
    
    .small-box h3 {
        font-size: 1.3rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .alert {
        margin-bottom: 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
}


/* ==========================================================================
   Light Theme Enforcement
   ========================================================================== */

/* Ensure all components use light theme colors */
body,
.content-wrapper,
.main-content,
.container-fluid {
    background-color: #f8f9fa !important;
    color: #495057 !important;
}

/* Force light backgrounds for all major components */
.card,
.card-body,
.small-box,
.info-box {
    background-color: white !important;
    color: #495057 !important;
}

/* Ensure text readability on light backgrounds */
.card-title,
.info-box-text,
.small-box p:not(.text-*) {
    color: #495057 !important;
}

/* Light theme table styling */
.table {
    background-color: white !important;
    color: #495057 !important;
}

.table th,
.table td {
    background-color: white !important;
    color: #495057 !important;
    border-color: #dee2e6 !important;
}

.table thead th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
}

.table tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* Light theme dropdowns */
.dropdown-menu {
    background-color: white !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

.dropdown-item {
    color: #495057 !important;
}

.dropdown-item:hover {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

/* Light theme alerts */
.alert {
    border: 1px solid #dee2e6 !important;
}

/* Ensure breadcrumb text is visible */
.breadcrumb-item,
.breadcrumb-item a {
    color: #6c757d !important;
}

.breadcrumb-item.active {
    color: #495057 !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .content-header,
    .card-tools,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .small-box {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .info-box {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}