/**
 * AI School Supplies Waller ISD Fixed CSS - Version 8.1
 * Enhanced with Waller ISD support and universal school name variations
 */

/* Main container styling */
.bss-ai-test-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header styling with Waller ISD branding */
.bss-test-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    position: relative;
}

.bss-test-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bss-test-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Version badge with Waller ISD indicator */
.bss-version-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced debug panel for Waller ISD */
.bss-debug-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.bss-debug-panel h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: bold;
}

#bss-debug-log {
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
}

.bss-debug-entry {
    margin-bottom: 5px;
    padding: 2px 0;
    border-bottom: 1px solid #f1f3f4;
}

.bss-debug-time {
    color: #6c757d;
    font-weight: bold;
}

/* Form styling with enhanced dropdowns */
.bss-test-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.bss-form-row {
    margin-bottom: 20px;
}

.bss-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Enhanced select styling for better UX */
.bss-form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #495057;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.bss-form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bss-form-row select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Enhanced generate button */
.bss-generate-button {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.bss-generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bss-generate-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* Enhanced loading animation */
.bss-loading {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.bss-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: bss-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.bss-loading p {
    color: #495057;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Enhanced error message styling */
.bss-error-message {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border-left: 4px solid #dc3545;
}

.bss-error-message strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Split-screen enhancements for Waller ISD results */
.bss-split-container {
    margin: 20px auto;
    max-width: 1400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.bss-split-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.bss-split-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.bss-split-header p {
    margin: 0 0 5px 0;
    opacity: 0.9;
    font-size: 16px;
}

.bss-enhancement-badge {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bss-split-content {
    display: flex;
    min-height: 700px;
}

.bss-split-horizontal .bss-split-content {
    flex-direction: row;
}

.bss-split-vertical .bss-split-content {
    flex-direction: column;
}

.bss-split-left {
    flex: 0 0 40%;
    padding: 25px;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    max-height: 700px;
    background: #f8f9fa;
}

.bss-split-vertical .bss-split-left {
    flex: 0 0 50%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
    max-height: 350px;
}

.bss-split-right {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    max-height: 700px;
    background: white;
}

.bss-split-vertical .bss-split-right {
    max-height: 350px;
}

.bss-split-section-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.bss-split-section-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 20px;
    font-weight: 700;
}

/* Enhanced divider for resizing */
.bss-split-divider {
    width: 6px;
    background: linear-gradient(to bottom, #e9ecef, #dee2e6, #e9ecef);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.bss-split-divider:hover {
    background: linear-gradient(to bottom, #667eea, #764ba2, #667eea);
}

.bss-split-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 30px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

/* Supply list content styling */
.bss-supply-content h3 {
    color: #667eea;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 22px;
}

.bss-supply-content h4 {
    color: #495057;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    padding-left: 10px;
    border-left: 3px solid #667eea;
}

.bss-supply-content ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.bss-supply-content li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #495057;
}

.bss-supply-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.bss-supply-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Enhanced status badges */
.bss-source-verified {
    display: inline-block;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    margin: 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.bss-source-generic {
    display: inline-block;
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    margin: 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Enhanced notice boxes */
.bss-notice-district {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #17a2b8;
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

.bss-notice-generic {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.bss-notice-district strong,
.bss-notice-generic strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .bss-ai-test-container {
        margin: 10px;
        padding: 15px;
    }
    
    .bss-test-header {
        padding: 15px;
    }
    
    .bss-test-header h3 {
        font-size: 22px;
    }
    
    .bss-version-badge {
        position: static;
        display: inline-block;
        margin-top: 10px;
    }
    
    .bss-enhancement-badge {
        position: static;
        display: inline-block;
        margin-top: 10px;
    }
    
    .bss-split-content {
        flex-direction: column !important;
    }
    
    .bss-split-left {
        flex: 0 0 auto !important;
        border-right: none !important;
        border-bottom: 1px solid #e9ecef;
        max-height: 400px;
    }
    
    .bss-split-divider {
        display: none;
    }
    
    .bss-form-row select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Enhanced animations */
@keyframes bss-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bss-ai-test-container {
    animation: bss-fade-in 0.5s ease-out;
}

/* Focus management for accessibility */
.bss-form-row select:focus,
.bss-generate-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bss-test-header {
        background: #000;
        color: #fff;
    }
    
    .bss-generate-button {
        background: #000;
        border: 2px solid #fff;
    }
    
    .bss-form-row select {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bss-spinner {
        animation: none;
    }
    
    .bss-generate-button:hover:not(:disabled) {
        transform: none;
    }
    
    .bss-ai-test-container {
        animation: none;
    }
}

/* Print styles */
@media print {
    .bss-debug-panel,
    .bss-generate-button,
    .bss-loading {
        display: none !important;
    }
    
    .bss-split-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .bss-split-header {
        background: #000 !important;
        color: #fff !important;
    }
}

