/* ============================================
   UPLOAD HISTORY PAGE STYLES v2.1.0
   Vector Contour Ltd.
   ============================================ */

/* This file extends dashboard.css with history-specific styles */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: 0 var(--spacing-lg);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

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

/* History Section */
.history-section {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin: 0 var(--spacing-lg) var(--spacing-lg);
    border-left: 4px solid var(--primary-dark);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.section-title h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Filter Buttons */
.filters {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background: var(--bg-secondary);
}

.history-table th {
    padding: 15px 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.history-table td {
    padding: 18px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: middle;
}

.history-table tbody tr {
    transition: background-color var(--transition-fast);
}

.history-table tbody tr:hover {
    background: var(--primary-light);
}

.history-table .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Change Badge */
.change-badge {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.change-item {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.change-item.change-updated {
    background: #cce5ff;
    color: #004085;
}

.change-item.change-removed {
    background: #f8d7da;
    color: #721c24;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 80px;
}

.status-badge.status-success {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-partial {
    background: #fff3cd;
    color: #856404;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    padding: 8px 16px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.icon-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.icon-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.icon-btn.secondary {
    background: #6c757d;
}

.icon-btn.secondary:hover {
    background: #5a6268;
}

/* Date Cell Styling */
.date-cell-main {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 3px;
}

.date-cell-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* File Cell Styling */
.file-cell-main {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 3px;
}

.file-cell-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: var(--spacing-lg);
}

/* Modal Content Sections */
.modal-section {
    margin-bottom: var(--spacing-lg);
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--border-color);
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.modal-info-item {
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.modal-info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.modal-info-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Change List in Modal */
.change-list {
    list-style: none;
    padding: 0;
}

.change-list-item {
    padding: var(--spacing-sm);
    border-left: 3px solid var(--primary-color);
    background: var(--bg-secondary);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.change-list-item:last-child {
    margin-bottom: 0;
}

.change-list-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.change-list-deal {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.change-list-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.change-arrow {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 5px;
}

/* Modal Action Buttons */
.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--spacing-sm);
    }

    .history-section {
        margin: 0 var(--spacing-sm) var(--spacing-sm);
        padding: var(--spacing-md);
    }

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

    .filters {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        min-width: 80px;
    }

    .history-table {
        font-size: 0.85rem;
    }

    .history-table th,
    .history-table td {
        padding: 10px 8px;
    }

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

    .icon-btn {
        width: 100%;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 1.8rem;
    }

    .history-table th,
    .history-table td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }

    .change-badge {
        flex-direction: column;
        gap: 5px;
    }
}
