/* ========================================
   CACHE MANAGEMENT - LIGHT MODE THEME
   Tema Terang & Responsif Mobile
   ======================================== */

/* ========================================
   CACHE STATS
   ======================================== */
.cache-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

/* ========================================
   FILE LIST
   ======================================== */
.file-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    background: #ffffff;
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.2s;
    background: #ffffff;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.file-details {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-cache {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.btn-cache:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-danger-cache {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-danger-cache:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    color: #ffffff;
}

.btn-success-cache {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-success-cache:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(81, 207, 102, 0.4);
    color: #ffffff;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f1f3f5;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   ALERTS
   ======================================== */
.alert-cache {
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
}

.alert-info-cache {
    background: linear-gradient(135deg, #74c0fc 0%, #339af0 100%);
    color: #ffffff;
}

.alert-warning-cache {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    color: #212529;
}

.alert-success-cache {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: #ffffff;
}

.alert-danger-cache {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #ffffff;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-header h5 {
    color: #212529;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.card-body {
    padding: 1.25rem;
}

/* ========================================
   RESPONSIVE - TABLET (< 992px)
   ======================================== */
@media (max-width: 991px) {
    .cache-stats {
        padding: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .stat-card p {
        font-size: 0.8rem;
    }

    .btn-cache,
    .btn-danger-cache,
    .btn-success-cache {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (< 768px)
   ======================================== */
@media (max-width: 768px) {
    /* Header */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between > div {
        width: 100%;
    }

    .d-flex.justify-content-between > div:last-child {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    /* Stats - 2 Grid */
    .cache-stats .row > [class*="col-md"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .cache-stats {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.75rem;
        margin: 0.25rem;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    .stat-card p {
        font-size: 0.7rem;
    }

    /* Buttons */
    .btn-cache,
    .btn-danger-cache,
    .btn-success-cache {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        flex: 1;
    }

    /* File List */
    .file-list {
        max-height: 350px;
        padding: 0.75rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .file-name {
        font-size: 0.85rem;
        word-break: break-all;
    }

    .file-details {
        font-size: 0.75rem;
    }

    .file-actions {
        width: 100%;
    }

    .file-actions button {
        flex: 1;
        font-size: 0.75rem;
    }

    /* Card */
    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Alert */
    .alert-cache {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   RESPONSIVE - VERY SMALL MOBILE (< 480px)
   ======================================== */
@media (max-width: 480px) {
    /* Stats - 1 Grid Full Width */
    .cache-stats .row > [class*="col-md"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .cache-stats {
        padding: 0.75rem;
    }

    .stat-card {
        padding: 0.65rem;
        margin: 0.25rem 0;
    }

    .stat-card h3 {
        font-size: 1.1rem;
    }

    .stat-card p {
        font-size: 0.65rem;
    }

    /* Buttons - Stack Vertically */
    .d-flex.justify-content-between > div:last-child {
        flex-direction: column;
    }

    .btn-cache,
    .btn-danger-cache,
    .btn-success-cache {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    /* File List */
    .file-list {
        max-height: 300px;
        padding: 0.5rem;
    }

    .file-item {
        padding: 0.5rem;
    }

    .file-name {
        font-size: 0.8rem;
    }

    .file-details {
        font-size: 0.7rem;
    }

    /* Card */
    .card-header {
        padding: 0.65rem;
    }

    .card-header h5 {
        font-size: 0.95rem;
    }

    .card-body {
        padding: 0.65rem;
    }
}

/* ========================================
   FORCE LIGHT MODE - NO DARK MODE
   ======================================== */
@media (prefers-color-scheme: dark) {
    .card,
    .file-list,
    .file-item {
        background: #ffffff !important;
        color: #212529 !important;
    }

    .card-header {
        background: #f8f9fa !important;
    }

    .file-name {
        color: #212529 !important;
    }

    .file-details {
        color: #6c757d !important;
    }
}

/* ========================================
   BADGE
   ======================================== */
.badge-primary {
    background-color: #667eea;
    color: #ffffff;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
}

