.cache-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cache-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.cache-modal {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cache-modal-overlay.active .cache-modal {
    transform: scale(1);
}

.cache-modal-header {
    padding: 24px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cache-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #fff;
    font-weight: 600;
}

.cache-modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cache-modal-close:hover {
    background: #333;
    color: #fff;
}

.cache-stats {
    display: flex;
    gap: 20px;
    padding: 16px 24px;
    background: #252525;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
}

.cache-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cache-stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
}

.cache-stat-value {
    font-size: 16px;
    color: #4ade80;
    font-weight: 600;
}

.cache-usage-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    flex: 1;
    min-width: 200px;
    position: relative;
}

.cache-usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.cache-usage-fill.warning {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.cache-usage-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.cache-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cache-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.cache-item {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.cache-item:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.15);
}

.cache-item.selected {
    border-color: #4ade80;
    background: #2a2a2a;
}

.cache-item-select {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
    accent-color: #4ade80;
}

.cache-item-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #1a1a1a;
    display: block;
}

.cache-item-info {
    padding: 12px;
}

.cache-item-filename {
    font-size: 13px;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.cache-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
}

.cache-item-time {
    color: #4ade80;
}

.cache-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.cache-item-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cache-item-btn:hover {
    border-color: #4ade80;
    background: #252525;
}

.cache-item-btn.delete {
    border-color: #ef4444;
    color: #ef4444;
}

.cache-item-btn.delete:hover {
    background: #ef4444;
    color: #fff;
}

.cache-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.cache-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.cache-empty h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 18px;
}

.cache-empty p {
    margin: 0;
    font-size: 14px;
}

.cache-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #333;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.cache-footer-left {
    display: flex;
    gap: 12px;
}

.cache-footer-btn {
    padding: 10px 20px;
    border: 1px solid #333;
    background: #252525;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cache-footer-btn:hover {
    border-color: #4ade80;
    background: #2a2a2a;
}

.cache-footer-btn.danger {
    border-color: #ef4444;
    color: #ef4444;
}

.cache-footer-btn.danger:hover {
    background: #ef4444;
    color: #fff;
}

.cache-footer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #333;
}

.cache-footer-btn:disabled:hover {
    background: #252525;
    border-color: #333;
}

@media (max-width: 768px) {
    .cache-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cache-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .cache-modal-header {
        padding: 16px;
    }

    .cache-stats {
        padding: 12px 16px;
        gap: 12px;
    }

    .cache-modal-content {
        padding: 16px;
    }

    .cache-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }

    .cache-footer-left {
        width: 100%;
    }

    .cache-footer-btn {
        flex: 1;
    }
}
