/* Custom CSS for US School Search */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-stats {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Search Card */
.search-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-card h2 {
    color: var(--primary-color);
    font-weight: 600;
}

/* School Cards */
.school-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    height: auto;
    min-height: 200px;
}

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

.school-card h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.school-badges .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
}

.school-info {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.school-info i {
    width: 16px;
    margin-right: 0.5rem;
}

/* School Header */
.school-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.school-badges .badge {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

.school-stats {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.card-header h5 {
    color: var(--primary-color);
    margin: 0;
}

/* Quick Facts */
.quick-facts .fact-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-facts .fact-item:last-child {
    border-bottom: none;
}

/* Feature Items */
.feature-item {
    text-align: center;
    padding: 1.5rem;
}

.feature-item i {
    color: var(--primary-color);
}

.feature-item h5 {
    margin: 1rem 0 0.5rem 0;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Footer */
footer {
    margin-top: 4rem;
}

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

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .search-card {
        padding: 1.5rem;
    }
    
    .school-card {
        padding: 1rem;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    .hero-stats {
        padding: 1.5rem;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .search-card {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Results Section */
#results {
    min-height: 400px;
    overflow: visible;
}

#schoolsList {
    /* Remove flexbox to allow normal Bootstrap grid behavior */
    overflow: visible;
}

/* Ensure page can scroll */
.container {
    overflow: visible;
}

.row {
    overflow: visible;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .school-header {
        background: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Compare functionality styles */
.school-preview {
    min-height: 120px;
}

.school-preview-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.school-preview-card h6 {
    color: #0d6efd;
    margin-bottom: 0.5rem;
}

.school-preview-card p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* Compare button animations */
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
    transition: all 0.2s ease;
}

/* Comparison table styles */
.table th {
    background-color: #343a40;
    color: white;
    border-color: #495057;
}

.table td {
    vertical-align: middle;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Compare indicator in navigation */
.nav-link.text-warning {
    font-weight: bold;
}

/* Recommendation cards */
.recommendation-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    border-color: #007bff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.15);
}

.recommendation-card .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
}

.match-reasons ul li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.tuition-info {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border-left: 4px solid #28a745;
}

.school-info {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.school-info i {
    width: 16px;
    margin-right: 0.5rem;
    color: #6c757d;
}

/* Pentagon chart styles */
.pentagon-chart-container {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

#pentagonChart {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.pentagon-scores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.score-label {
    color: #6c757d;
    font-weight: 500;
}

.score-value {
    color: #007bff;
    font-weight: 600;
}

.score-item.total-score {
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.score-item.total-score .score-label {
    color: #495057;
}

.score-item.total-score .score-value {
    color: #28a745;
    font-size: 1rem;
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Floating Compare Menu */
.floating-compare-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.compare-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    color: white;
    font-size: 20px;
}

.compare-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

.compare-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.compare-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.compare-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.compare-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.compare-header h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: #dc3545;
}

.compare-content {
    padding: 15px 20px 20px;
}

.compare-list {
    min-height: 100px;
    margin-bottom: 15px;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 20px 0;
}

.empty-state i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.compare-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.compare-item-info {
    flex: 1;
}

.compare-item-name {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 2px;
}

.compare-item-details {
    font-size: 12px;
    color: #6c757d;
}

.compare-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.compare-item-remove:hover {
    background: #f8d7da;
}

.compare-actions .btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .floating-compare-menu {
        bottom: 15px;
        right: 15px;
    }
    
    .compare-panel {
        width: 280px;
        right: -10px;
    }
    
    .compare-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .compare-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

    .compare-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
}
