:root {
    --primary-color: #2563eb;
    --secondary-color: #0f172a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --match-color: #dcfce7;
    --match-dark: #16a34a;
    --inflated-color: #fef9c3;
    --inflated-dark: #ca8a04;
    --deflated-color: #fee2e2;
    --deflated-dark: #dc2626;
    --total-color: #e2e8f0;
    --total-dark: #475569;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-bg);
    color: var(--secondary-color);
}

/* Header Styles */
.header {
    padding: 1.5rem 0;
}

.main-logo {
    max-height: 80px;
    max-width: 100%;
}

.system-logo {
    height: 40px;
    margin-right: 15px;
}

/* Upload Panel Styles */
.upload-panel {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    height: 100%;
    transition: all 0.2s ease;
}

.panel-header {
    text-align: center;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.icon-large {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-info {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Summary Section Styles */
.summary-section {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
}

.section-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.summary-card.selected {
    border: 2px solid #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.summary-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.summary-card .metric {
    margin-bottom: 0.5rem;
}

.summary-card .count {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.summary-card .qty {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
}

.summary-card .label {
    font-size: 0.9rem;
    color: #64748b;
    display: block;
}

/* Status Color Themes */
.match {
    background-color: var(--match-color);
}

.match h3 {
    color: var(--match-dark);
}

.inflated {
    background-color: var(--inflated-color);
}

.inflated h3 {
    color: var(--inflated-dark);
}

.deflated {
    background-color: var(--deflated-color);
}

.deflated h3 {
    color: var(--deflated-dark);
}

.total {
    background-color: var(--total-color);
}

.total h3 {
    color: var(--total-dark);
}

/* Table Styles */
.table-responsive {
    background-color: #fff;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding-top: .5rem;
    margin-bottom: 2rem;
}

.pagination{
    margin-right: 2px !important;
    margin-top: -40px !important;
}

.dataTables_length, .dataTables_info{
    margin-left: 5px !important;
}

#results-table {
    width: 100%;
}

#results-table thead th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 500;
    border: none;
}

/* Table row status colors */
#results-table tbody tr.status-match {
    background-color: var(--match-color);
}

#results-table tbody tr.status-inflated {
    background-color: var(--inflated-color);
}

#results-table tbody tr.status-deflated {
    background-color: var(--deflated-color);
}

/* Status icons */
.status-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.match-icon {
    color: var(--match-dark);
}

.inflated-icon {
    color: var(--inflated-dark);
}

.deflated-icon {
    color: var(--deflated-dark);
}

/* Improve hover on table rows */
#results-table tbody tr:hover {
    filter: brightness(0.97);
    transition: all 0.2s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay p {
    margin-top: 1rem;
    font-weight: 500;
}

/* Collapsible Section Styles */
.collapsible-section {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.collapsible-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.collapsible-content {
    overflow: hidden;
}

/* Add transition only when explicitly animating */
.collapsible-content.animate {
    transition: max-height 0.4s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.collapsible-content.collapsed.animate {
    transition: max-height 0.3s ease;
}

#toggle-upload {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#toggle-upload.collapsed #toggle-icon {
    transform: rotate(180deg);
}

/* Remove bottom margin from header when collapsed */
.collapsible-section .collapsible-content.collapsed + .d-flex.justify-content-between.align-items-center.mb-3 {
    margin-bottom: 0 !important;
}

/* Alternative selector that targets the header when section is collapsed */
.collapsible-section:has(.collapsible-content.collapsed) .d-flex.justify-content-between.align-items-center.mb-3 {
    margin-bottom: 0 !important;
}

/* Button Styles */
.btn-success {
    background-color: #16a34a;
    border-color: #16a34a;
}

.btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
