/* ===== HEADER STYLES ===== */
.search-header {
    text-align: center;
    padding: 20px 15px;
    background: #0073aa;
    color: white;
    margin-bottom: 20px;
}

.search-header h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
}

.search-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* ===== UNIFIED FILTER STYLES ===== */
.search-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 15px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.filter-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #0073aa;
}

.filter-group select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* ===== UNIFIED BUTTON STYLES ===== */
.search-button {
    padding: 14px 25px;
    background: #0073aa;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-button:hover {
    background: #006399;
}

.search-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ===== CLASSIC SEARCH SPECIFIC ===== */
.school-search-classic .school-results {
    margin-top: 15px;
    padding: 15px;
    background: white;
}

.school-search-classic .school-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 14px;
}

.school-search-classic .school-meta p {
    margin: 0;
    color: #666;
}

.school-search-classic .class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.school-search-classic .class-box {
    border: 1px solid #ddd;
    padding: 0;
    background: white;
}

.school-search-classic .class-header {
    background: #0073aa;
    color: white;
    padding: 12px;
    text-align: center;
}

.school-search-classic .class-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.school-search-classic .records-grid {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.school-search-classic .record-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
}

.school-search-classic .field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.school-search-classic .field-label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.school-search-classic .field-value {
    font-size: 14px;
    color: #333;
}

.school-search-classic .available-seats {
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.school-search-classic .available-value {
    font-size: 28px;
    color: #0073aa;
    font-weight: bold;
}

.school-search-classic .available-label {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* ===== ADVANCED & SUMMARY SEARCH ===== */
.school-search-advanced .search-box-container,
.school-search-summary .search-form-wrapper {
    background: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.search-button-group {
    display: flex;
    align-items: flex-end;
}

/* ===== GRID VIEW STYLES ===== */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
}

.school-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.school-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.school-card-header {
    background: #0073aa;
    color: white;
    padding: 15px;
}

.school-card-header h5 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: white;
}

.school-code {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

.school-card-body {
    padding: 20px;
}

.school-info-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-weight: 500;
}

.seats-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.seats-value {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
}

.school-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
    text-align: center;
}

/* ===== RESULTS STYLES ===== */
.search-results {
    background: white;
    border: 1px solid #eaeaea;
    margin-top: 20px;
}

.results-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header h4 {
    margin: 0;
    font-size: 18px;
    color: white;
}

.results-count {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 4px;
}

.details-button {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
    width: 100%;
}

.details-button:hover {
    background: #006399;
}

/* ===== MODAL STYLES ===== */
.school-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border-radius: 8px;
}

.modal-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 20px;
}

.school-info h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 20px;
}

.school-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.school-meta p {
    margin: 0;
    font-size: 14px;
}

.seat-details h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
}

.class-section {
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    overflow: hidden;
}

.class-section h6 {
    margin: 0;
    color: white;
    font-size: 16px;
    background: #0073aa;
    padding: 12px 15px;
}

.table-responsive {
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 500px;
}

.details-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

.details-table td {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
}

.class-total {
    background: #e7f3ff !important;
    font-weight: 600;
}

.overall-total {
    text-align: center;
    padding: 15px;
    background: #0073aa;
    color: white;
    margin-top: 20px;
    border-radius: 6px;
}

.overall-total p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* ===== LOADING STATES ===== */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* ===== UTILITY STYLES ===== */
.loading, .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    margin: 15px 0;
    border-radius: 4px;
}

.pagination-container {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eaeaea;
    background: #f8f9fa;
}

.pagination {
    display: inline-flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: #0073aa;
    font-size: 14px;
    display: inline-block;
    min-width: 40px;
    text-align: center;
    border-radius: 4px;
}

.pagination .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.pagination a:hover {
    background: #f8f9fa;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .school-search-container {
        padding: 10px;
    }
    
    .search-header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .search-header h3 {
        font-size: 20px;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .school-search-classic .class-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .school-search-classic .school-results {
        padding: 12px;
    }
    
    .school-search-classic .school-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .school-search-classic .records-grid {
        padding: 10px;
        gap: 8px;
    }
    
    .schools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .school-card {
        margin-bottom: 0;
    }
    
    .results-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .school-meta {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .search-header h3 {
        font-size: 18px;
    }
    
    .search-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .school-search-classic .available-value {
        font-size: 24px;
    }
    
    .modal-content {
        width: 100%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .details-table th,
    .details-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .school-card-header h5 {
        font-size: 16px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .seats-value {
        font-size: 18px;
    }
}