/* ===========================
   Upload Page Styles
=========================== */

/* ===========================
   Mobile/Tablet Responsive Layout
=========================== */

/* Desktop: Show hint and clear button */
@media (min-width: 992px) {
    .upload-hint-col {
        display: flex !important;
    }
    
    /* Add gap between save buttons on desktop */
    .upload-save-row {
        gap: 10px;
    }
}

/* Desktop: Header row layout */
@media (min-width: 992px) {
    .upload-header-row {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .upload-header-col {
        flex: 1;
    }
    
    .upload-dropdowns-col {
        flex: 0 0 auto;
        width: 300px;
        display: flex;
        flex-direction: column; /* Stack vertically on desktop */
        gap: 0.5rem;
    }
    
    .upload-box-col {
        flex: 0 0 auto;
        width: 450px;
    }
}

/* Tablet and Mobile: Stack layout */
@media (max-width: 991px) {
    /* Header row - stack sections */
    .upload-header-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .upload-header-col,
    .upload-dropdowns-col,
    .upload-box-col {
        width: 100% !important;
    }
    
    /* Dropdowns stay side-by-side on mobile */
    .upload-dropdowns-col {
        display: flex !important;
        gap: 0.75rem !important;
    }
    
    .upload-dropdowns-col > div {
        flex: 1;
        min-width: 0; /* Prevent flex overflow */
    }
    
    /* Upload box - increase min-height for better touch target */
    .upload-box-col > div {
        min-height: 150px;
    }
    
    /* Hint row and Actions row - stack buttons */
    .upload-hint-row,
    .upload-actions-row {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem !important;
    }
    
    /* Show hint text on mobile - full width above grid */
    .upload-hint-col {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        order: 10;
        padding: 0 !important;
        margin-bottom: 0.75rem;
    }
    
    .upload-hint-col i {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
    }
    
    /* Stack action buttons full width */
    .upload-add-transaction-col,
    .upload-summary-col,
    .upload-bulk-edit-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        justify-content: stretch !important;
        order: 1;
    }
    
    .upload-add-transaction-col button,
    .upload-summary-col button,
    .upload-bulk-edit-col button {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    /* Transaction grid - reduce height on mobile */
    #transactions-grid {
        height: 400px !important;
    }
    
    /* Save row - keep buttons side by side on mobile */
    .upload-save-row {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        gap: 0.5rem;
        margin-top: 1rem;
        padding: 0 0.5rem;
    }
    
    /* Save and Clear buttons side by side on mobile */
    .upload-save-col,
    .upload-clear-col {
        flex: 1 !important;
        order: 1;
        padding: 0 !important;
    }
    
    .upload-save-col {
        max-width: none !important;
    }
    
    .upload-clear-col {
        max-width: none !important;
    }
    
    /* Show the Clear button on mobile in save row */
    .upload-clear-mobile-btn {
        display: block !important;
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .upload-save-col button {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    /* Message takes full width below buttons */
    .upload-message-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        text-align: center !important;
        order: 2;
        margin-top: 0.75rem;
        padding: 0 !important;
    }
}

/* Tablet specific adjustments (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Dropdowns side by side on tablet */
    .upload-dropdowns-col {
        display: flex;
        gap: 1rem;
    }
    
    .upload-dropdowns-col > div {
        flex: 1;
    }
    
    /* Slightly larger grid on tablet */
    #transactions-grid {
        height: 500px !important;
    }
}

/* Small mobile optimizations */
@media (max-width: 576px) {
    /* Smaller header text */
    .upload-header-col .page-header {
        font-size: 1.75rem;
    }
    
    .last-transaction-date {
        font-size: 0.9rem;
    }
    
    /* Compact buttons */
    .upload-add-transaction-col button,
    .upload-summary-col button,
    .upload-bulk-edit-col button,
    .upload-save-col button,
    .upload-clear-mobile-btn {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    /* Smaller grid on very small screens */
    #transactions-grid {
        height: 350px !important;
    }
}

/* ===========================
   Dark Mode Support
=========================== */

/* Summary of Uploads button - make it visible in dark mode */
[data-theme="dark"] #upload-summary-button {
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] #upload-summary-button:hover {
    color: var(--text-primary) !important;
    border-color: var(--brand-purple) !important;
    background-color: rgba(180, 100, 255, 0.1) !important;
}

/* ===========================
   Duplicate Resolution Styling
=========================== */

/* Duplicate Resolution section in modal */
.duplicate-resolution-title {
    color: var(--brand-purple);
    margin-bottom: 15px;
    font-weight: 600;
}

.duplicate-resolution-box {
    background-color: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

/* Ensure text inside is readable in both themes */
.duplicate-resolution-box p {
    color: var(--text-primary);
}

