/* Unified Input Styles */

/* Tab pills styling */
#inputTabs {
    gap: 1rem;
}

#inputTabs .nav-link {
    color: var(--color-text-muted);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    font-weight: 500;
}

#inputTabs .nav-link:hover {
    color: var(--color-primary);
    background-color: rgba(102, 126, 234, 0.1);
    border-color: #cbd5e1;
}

#inputTabs .nav-link.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* All screens: hide text on inactive tabs, show on active (mobile-first design) */
/* Consistent sizing for all tabs */
#inputTabs .nav-link {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    box-sizing: border-box;
}

#inputTabs .nav-link .tab-text {
    display: none;
    white-space: nowrap;
}

/* Remove icon margin when text is hidden */
#inputTabs .nav-link i {
    margin-right: 0 !important;
}

/* Active tab with text+icon */
#inputTabs .nav-link.active .tab-text {
    display: inline;
    margin-left: 0.5rem;
}

#inputTabs .nav-link.active i {
    margin-right: 0 !important;
}

/* Browse Files button - styled like result action buttons */
.browse-files-btn {
    font-size: 0.95rem !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 0.375rem;
    border: 2px solid #6c757d !important;
    background-color: transparent !important;
    color: #6c757d !important;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.browse-files-btn:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.browse-files-btn:active {
    transform: translateY(0);
}

/* Drag and drop areas */
.drag-drop-area {
    border: 3px dashed #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 2rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #f8fafc;
}

.drag-drop-hint {
    font-size: 0.85rem;
}

.drag-drop-area:hover {
    border-color: var(--color-primary);
    background-color: rgba(102, 126, 234, 0.05);
}

.drag-drop-area.drag-over {
    border-color: var(--color-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    transform: scale(1.02);
}

.drag-drop-icon {
    font-size: 4rem;
    color: var(--color-primary);
    display: block;
}

/* File preview */
.file-preview {
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.file-preview h6 {
    font-weight: 500; /* Medium weight instead of default 600 */
}

/* BiomPIN input styling */
#biompinInput {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

#biompinInput::placeholder {
    letter-spacing: normal;
}

/* BiomPIN option switch */
.biompin-option {
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Process button states */
#processBtn {
    background: var(--gradient-primary);
    border: none;
    font-weight: 600;
    padding: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
}

#processBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#processBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#processBtn .processing-spinner {
    display: none;
}

#processBtn.processing .btn-text {
    display: none;
}

#processBtn.processing .processing-spinner {
    display: inline;
}

/* Alert container */
#alertContainer .alert {
    border-radius: var(--border-radius-sm);
    border: none;
}

/* Card height adjustments */
.upload-card {
    height: auto;
}

.upload-card .card-body {
    height: auto;
    overflow: hidden;
}

/* Disable Bootstrap fade to prevent height jump during tab transitions */
#inputTabContent .tab-pane.fade {
    transition: none;
    opacity: 1 !important;
}

#inputTabContent .tab-pane.fade:not(.show) {
    display: none !important;
}

/* History Tab Styles */
.history-container {
    /* No max-height - let content expand naturally with Load More pattern */
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 2px; /* Extra padding to prevent border clipping on hover */
}

.history-item {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.history-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    z-index: 1;
}

/* BiomPIN - prominent first line */
.history-item-pin {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

/* Second line - patient info and time */
.history-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.history-item-patient-info {
    color: var(--color-text-muted);
}

.history-item-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Time color classes */
.time-safe {
    color: #10b981; /* Green - 48-72+ hours */
}

.time-warning {
    color: #f59e0b; /* Yellow - 24-48 hours */
}

.time-urgent {
    color: #f97316; /* Orange - <24 hours */
}

.time-expired,
.time-unknown {
    color: var(--color-text-muted);
}

/* Empty state */
.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.history-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Load more card - half height, subtle gray */
.history-load-more {
    background: rgba(108, 117, 125, 0.08);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1rem; /* Half height of regular items */
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    position: relative;
}

.history-load-more:hover {
    background: rgba(108, 117, 125, 0.15);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    z-index: 1;
}

.history-load-more i {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Transcribe empty state - match history empty state styling */
.transcribe-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.transcribe-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    display: block;
}

/* Mobile adjustments for input tabs */
@media (max-width: 576px) {
    /* Tab navigation - more compact */
    #inputTabs {
        gap: 0.35rem;
        margin-bottom: 1rem !important;
    }

    #inputTabs .nav-link {
        padding: 0.35rem 0.7rem;
        min-height: 2.4rem;
    }

    #inputTabs .nav-link i {
        font-size: 0.95rem;
    }

    #inputTabs .nav-link.active .tab-text {
        font-size: 0.8rem;
    }

    /* Drag-drop area - reduced padding */
    .drag-drop-area {
        padding: 1.5rem 1rem;
    }

    .drag-drop-icon {
        font-size: 3rem !important;
        margin-bottom: 0.75rem !important;
    }

    .browse-files-btn {
        font-size: 0.875rem !important;
        padding: 0.45rem 1rem !important;
    }

    .drag-drop-hint {
        font-size: 0.8rem;
        margin-bottom: 0.5rem !important;
    }

    /* File preview - more compact */
    .file-preview {
        padding: 0.75rem;
    }

    .file-preview i {
        font-size: 1.5rem !important;
    }

    .file-preview h6 {
        font-size: 0.85rem;
        margin-bottom: 0.25rem !important;
    }

    .file-preview small {
        font-size: 0.7rem;
    }

    /* File preview remove button - more compact */
    #uploadRemoveFile {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.85rem;
        min-width: auto;
    }

    #uploadRemoveFile i {
        margin: 0 !important;
    }

    /* Process button - slightly smaller */
    #processBtn {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    /* History items - more compact */
    .history-item {
        padding: 0.65rem 0.85rem;
    }

    .history-item-pin {
        font-size: 0.95rem;
    }

    .history-item-info {
        font-size: 0.8rem;
    }

    /* Empty states - reduced padding */
    .history-empty,
    .transcribe-empty {
        padding: 1.5rem 1rem;
    }

    .history-empty i,
    .transcribe-empty i {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
}
