/* Custom styles for chromatogram analyzer */

/* Quality highlighting for sequence bases */
.base {
    padding: 2px 3px;
    margin: 0 1px;
    border-radius: 3px;
    display: inline-block;
    font-weight: bold;
}

/* Quality color scheme */
.q-high {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.q-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.q-low {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Sequence container styling */
.sequence-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    word-wrap: break-word;
}

/* File upload area enhancements */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
}

/* Button enhancements */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Loading spinner for file processing */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive plot container */
.plot-container {
    position: relative;
    width: 100%;
    height: 450px;
}

/* Summary cards styling */
.card-body h3 {
    font-weight: bold;
    color: var(--bs-primary);
}

/* Badge styling for quality indicators */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Custom scrollbar for sequence container */
.sequence-container::-webkit-scrollbar {
    width: 8px;
}

.sequence-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sequence-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.sequence-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Form validation feedback */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    color: #198754;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Progressive enhancement for JavaScript disabled */
.no-js .chart-container {
    display: none;
}

.no-js .chart-fallback {
    display: block;
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

/* Print styles */
@media print {
    .btn, .card-header, .navbar {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .sequence-container {
        max-height: none !important;
        overflow: visible !important;
    }
    
    body {
        font-size: 12pt;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .q-high {
        background-color: #000;
        color: #fff;
    }
    
    .q-medium {
        background-color: #666;
        color: #fff;
    }
    
    .q-low {
        background-color: #ccc;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card, .btn {
        transition: none;
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .sequence-container {
    background-color: #2b2b2b;
    border-color: #495057;
    color: #ffffff;
}

[data-bs-theme="dark"] .q-high {
    background-color: #0f5132;
    color: #d1e7dd;
    border-color: #0a3622;
}

[data-bs-theme="dark"] .q-medium {
    background-color: #664d03;
    color: #fff3cd;
    border-color: #4d3900;
}

[data-bs-theme="dark"] .q-low {
    background-color: #58151c;
    color: #f8d7da;
    border-color: #3c0a0e;
}

/* Accessibility improvements */
.base:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .card-body {
    position: relative;
}

.loading .card-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File drag and drop styling */
.file-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.file-drop-zone.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

.file-drop-zone:hover {
    border-color: var(--bs-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .sequence-container {
        font-size: 12px;
        padding: 10px;
    }
    
    .base {
        padding: 1px 2px;
        margin: 0 0.5px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}
