*   CLEANUP.HTML CSS */
/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== HEADER & TYPOGRAPHY ===== */
.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* ===== STATS & CARDS ===== */
.stats,
.cron-stats,
.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card,
.cron-stat {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0px;
    border-radius: 10px;
    text-align: center;
}

.cron-stat {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 5px;
}

.stat-number,
.cron-value {
    font-size: 25px;
    font-weight: bold;
    margin-bottom: 0px;
}

.cron-value {
    font-size: 1.3em;
}

.stat-label,
.cron-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.cron-label {
    margin-bottom: 5px;
}

/* ===== BUTTONS ===== */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn,
.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

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

.modal-btn.refresh {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.modal-btn.download {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

.modal-btn.close {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn:hover,
.modal-btn:hover {
    transform: translateY(-2px);
}

.btn-primary:hover { background: #0056b3; }
.btn-danger:hover { background: #c82333; }
.btn-success:hover { background: #218838; }
.btn-info:hover { background: #138496; }
.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* ===== DIRECTORY & FILE STYLES ===== */
.directories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.directory-card,
.cron-status {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cron-status {
    margin-bottom: 20px;
}

.directory-header,
.cron-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    border-bottom: none;
}

.cron-header h3,
.modal-header h3 {
    color: #333;
    margin: 0;
}

.modal-header h3 {
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.directory-name {
    font-weight: bold;
    color: #333;
    font-size: 1.2em;
}

.file-count {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.file-list,
.recent-logs {
    max-height: 300px;
    overflow-y: auto;
}

.recent-logs {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.file-item.old {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.file-details {
    font-size: 0.8em;
    color: #666;
}

.file-age {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.age-new {
    background: #d4edda;
    color: #155724;
}

.age-old {
    background: #f8d7da;
    color: #721c24;
}

/* ===== LOG STYLES ===== */
.log-container,
.complete-log-content {
    background: #1e1e1e;
    color: #00ff00;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-y: auto;
}

.log-container {
    max-height: 400px;
    margin-top: 20px;
    display: none;
}

.complete-log-content {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
    flex: 1;
    white-space: pre-wrap;
    line-height: 1.5;
    border: 2px solid #2d2d2d;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Fira Code', 'Courier New', monospace;
}

.log-entry,
.log-line,
.log-line-modal {
    margin: 5px 0;
    padding: 5px;
    border-left: 2px solid transparent;
}

.log-line {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
    font-size: 0.9em;
}

.log-line-modal {
    margin: 4px 0;
    padding: 8px 12px;
    border-left: 4px solid transparent;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.log-line-modal:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Log Type Colors */
.log-info,
.log-line-modal.info {
    border-left-color: #17a2b8;
}

.log-success,
.log-line-modal.success {
    border-left-color: #28a745;
}

.log-line-modal.success {
    background: rgba(40, 167, 69, 0.08);
}

.log-error,
.log-line-modal.error {
    border-left-color: #dc3545;
}

.log-line.error,
.log-line-modal.error {
    background: #fff5f5;
}

.log-line-modal.error {
    background: rgba(220, 53, 69, 0.08);
}

.log-warning,
.log-line-modal.warning {
    border-left-color: #ffc107;
}

.log-line.warning,
.log-line-modal.warning {
    background: #fffef0;
}

.log-line-modal.warning {
    background: rgba(255, 193, 7, 0.08);
}

.log-line.success {
    background: #f8fff9;
    border-left-color: #28a745;
}

/* ===== STATUS & UTILITY STYLES ===== */
.status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.last-updated {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

/* ===== MODAL STYLES ===== */
.backend-log-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.backend-log-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid #e0e0e0;
    animation: modalAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-body {
    padding: 25px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.modal-stats .stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
    color: #333;
}

.modal-stats .stat-card:hover {
    transform: translateY(-2px);
}

.modal-stats .stat-label {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-stats .stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
}

.modal-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #6c757d;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-tips {
    font-size: 0.85em;
    color: #999;
}

/* ===== SCROLLBAR STYLING ===== */
.file-list::-webkit-scrollbar,
.recent-logs::-webkit-scrollbar,
.log-container::-webkit-scrollbar,
.complete-log-content::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track,
.recent-logs::-webkit-scrollbar-track,
.log-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.complete-log-content::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 6px;
}

.file-list::-webkit-scrollbar-thumb,
.recent-logs::-webkit-scrollbar-thumb,
.log-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover,
.recent-logs::-webkit-scrollbar-thumb:hover,
.log-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.complete-log-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
    border: 2px solid #2d2d2d;
}

.complete-log-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* ===== LOADING ANIMATION ===== */
.loading-log {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: #17a2b8;
    font-size: 1.1em;
}

.loading-log::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #17a2b8;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .backend-log-modal {
        padding: 10px;
    }
    
    .backend-log-modal .modal-content {
        width: 100%;
        height: 95vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-header h3 {
        font-size: 1.4em;
    }
    
    .modal-controls {
        width: 100%;
        justify-content: center;
    }
    
    .modal-btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-stats .stat-card {
        padding: 15px;
    }
    
    .footer-info {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .directories {
        grid-template-columns: 1fr;
    }
    
    .cron-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Cron Logs Modal - Same style as backend logs */
.cron-log-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.cron-log-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid #e0e0e0;
    animation: modalAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
/* Better mobile modal */
@media (max-width: 768px) {
    .backend-log-modal .modal-content {
        height: 95vh;
        margin: 0;
        border-radius: 0;
        width: 100%;
    }
    
    .complete-log-content {
        font-size: 12px;
        padding: 15px;
        line-height: 1.4;
    }
    
    .log-line-modal {
        padding: 6px 8px;
        margin: 2px 0;
        font-size: 11px;
    }
    .modal-stats {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 2px !important;
    }
    
    .modal-stats .stat-card {
        flex: 0 0 auto !important;
        min-width: 85px !important;
        padding: 5px 10px !important;
    }
    
    .modal-stats .stat-value {
        font-size: 1.1em !important;
    }
    
    .modal-stats .stat-label {
        font-size: 0.8em !important;
    }
}