/**
 * PNR Converter Page Styles
 * Comprehensive styling for the converter interface
 */

/* ============================
   GENERAL LAYOUT & STRUCTURE
   ============================ */

.converter-page {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================
   FILTER PANEL STYLES
   ============================ */

.filter-panel {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 #f8f9fa;
}

.filter-panel::-webkit-scrollbar {
    width: 6px;
}

.filter-panel::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h6 {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================
   TOGGLE SWITCH STYLES
   ============================ */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #007bff;
}

.toggle-switch input:focus + .slider {
    box-shadow: 0 0 1px #007bff;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* ============================
   BUTTON GROUP STYLES
   ============================ */

.btn-group-custom {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.btn-group-custom .btn {
    border: none;
    border-radius: 0;
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
}

.btn-group-custom .btn:not(:last-child) {
    border-right: 1px solid #dee2e6;
}

.btn-group-custom .btn.active {
    background-color: #007bff;
    color: white;
    font-weight: 500;
}

.btn-group-custom .btn:hover:not(.active) {
    background-color: #f8f9fa;
}

/* ============================
   CARD STYLES
   ============================ */

.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.card-body {
    padding: 1.5rem;
}

/* ============================
   SAMPLE CARD STYLES
   ============================ */

.sample-card {
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    border-width: 2px;
}

.sample-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sample-card .card-body {
    padding: 1.5rem 1rem;
}

.sample-card .fa-2x {
    font-size: 2.5rem !important;
}

.sample-card .card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.sample-card .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
}

/* ============================
   FORM STYLES
   ============================ */

.form-control {
    border-radius: 8px;
    border: 1.5px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label.fw-bold {
    font-weight: 600;
    color: #343a40;
}

#pnr_text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 300px;
}

#pnr_text::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* ============================
   BUTTON STYLES
   ============================ */

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-width: 1.5px;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    transform: translateY(-1px);
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    transform: translateY(-1px);
}

.btn-outline-primary:hover {
    background-color: #007bff;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    transform: none !important;
}

/* ============================
   FORMAT DETECTION STYLES
   ============================ */

#formatDetection {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.format-detection-animation {
    animation: formatPulse 1.5s infinite;
}

@keyframes formatPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02);
    }
}

/* ============================
   PROCESSING STATUS STYLES
   ============================ */

#processingStatus {
    border-radius: 8px;
}

#processingStatus .alert {
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
}

#processingStatus .progress {
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

#processingStatus .progress-bar {
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #17a2b8 0%, #007bff 100%);
}

/* ============================
   RECENT CONVERSIONS STYLES
   ============================ */

#recentConversions .card {
    transition: all 0.2s ease;
}

#recentConversions .card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#recentConversions .fa-plane {
    opacity: 0.8;
}

#recentConversions h6 {
    font-weight: 600;
    color: #343a40;
}

#recentConversions .text-muted {
    font-size: 0.85rem;
}

/* ============================
   FORM VALIDATION STYLES
   ============================ */

.is-valid {
    border-color: #28a745 !important;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-text .fas {
    color: #007bff;
}

/* ============================
   RESPONSIVE DESIGN
   ============================ */

@media (max-width: 1199.98px) {
    .filter-panel {
        position: relative !important;
        max-height: none;
        margin-bottom: 2rem;
    }
    
    .filter-section {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .filter-panel {
        padding: 1rem !important;
    }
    
    .btn-group-custom .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.4rem;
    }
    
    .sample-card .fa-2x {
        font-size: 2rem !important;
    }
    
    .sample-card .card-body {
        padding: 1rem 0.75rem;
    }
    
    #pnr_text {
        min-height: 250px;
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .card-header p {
        font-size: 0.85rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .filter-section h6 {
        font-size: 0.8rem;
    }
}

/* ============================
   ANIMATION UTILITIES
   ============================ */

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* ============================
   LOADING STATES
   ============================ */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 1000;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ============================
   ACCESSIBILITY IMPROVEMENTS
   ============================ */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.toggle-switch input:focus + .slider {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ============================
   DARK MODE SUPPORT (Optional)
   ============================ */

@media (prefers-color-scheme: dark) {
    .converter-page {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .filter-panel {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .card {
        background: #2d3748;
        color: #e9ecef;
    }
    
    .form-control {
        background: #4a5568;
        border-color: #6c757d;
        color: #e9ecef;
    }
    
    .form-control:focus {
        background: #4a5568;
        border-color: #007bff;
        color: #e9ecef;
    }
}