* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #2a6dc9;
    --primary-light: #e8f1ff;
    --secondary: #34a853;
    --dark: #333;
    --light: #f8f9fa;
    --gray: #6c757d;
    --danger: #ea4335;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 70px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.logo-link:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Mobile Navigation */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--dark);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), #1a4d9e);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

#search-input {
    width: 100%;
    padding: 18px 60px 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

#search-input:focus {
    outline: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

#search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-btn:hover {
    background: #1a4d9e;
    transform: translateY(-50%) scale(1.05);
}

.search-hint {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Education Panel */
.education-panel {
    padding: 80px 0;
    background: white;
}

.education-panel h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--dark);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.info-card {
    background: var(--light);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.info-card p, .info-card li {
    color: var(--gray);
    margin-bottom: 10px;
}

.info-card ul {
    list-style-position: inside;
}

.info-card li {
    margin-bottom: 8px;
    padding-left: 5px;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 30px 0;
}

.footer-link {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

/* Search Result Styles */
.search-result {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin: 40px auto;
    max-width: 900px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 6px solid var(--primary);
    animation: fadeIn 0.5s ease;
}

.search-result.loading {
    background: white;
    border-left-color: var(--primary);
}

.search-result.error {
    border-left-color: var(--danger);
}

.result-content h3 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
}

/* Answer Text with Better Formatting */
.answer-text {
    line-height: 1.8;
    color: var(--dark);
    font-size: 1.15rem;
    margin-bottom: 30px;
}

.answer-text p {
    margin-bottom: 20px;
    text-align: left;
}

.answer-text strong {
    color: var(--primary);
    font-weight: 600;
}

.answer-text em {
    color: var(--gray);
    font-style: italic;
}

.answer-text h4 {
    color: var(--primary);
    margin: 25px 0 15px 0;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
}

.answer-text br {
    margin-bottom: 10px;
}

/* Loading Spinner Styles */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--primary);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.loading-spinner p {
    margin: 0;
    font-size: 1.1rem;
}

/* Result Actions */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Error State */
.search-result.error h3 {
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-result.error h3 i {
    font-size: 1.3rem;
}

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

/* Ensure hero section stays clean */
.hero {
    position: relative;
    z-index: 1;
}

/* Prediction Page Specific Styles */
.container.py-5 {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
}

.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 20px;
}

.feature-card {
    margin-bottom: 15px;
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-select {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(42, 109, 201, 0.25);
}

.btn-primary {
    background: var(--primary);
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
}

.btn-primary:hover {
    background: #1a4d9e;
}

.risk-result {
    display: none;
}

/* Prediction Page Styles - Without Bootstrap */
.prediction-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.prediction-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.prediction-header {
    background: var(--primary);
    color: white;
    padding: 25px;
    text-align: center;
}

.prediction-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.prediction-body {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
}

.form-section h4 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(42, 109, 201, 0.2);
}

.form-submit {
    margin-top: 30px;
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.submit-btn:hover {
    background: #1a4d9e;
    transform: translateY(-2px);
}

/* Risk Results */
.risk-result {
    display: none;
    margin-top: 40px;
    padding: 30px;
    background: var(--light);
    border-radius: 8px;
    text-align: center;
}

.risk-percentage {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    margin: 20px 0;
}

.risk-note {
    color: var(--gray);
    font-style: italic;
}

/* Risk Interpretation Styling */
.risk-interpretation {
    line-height: 1.7;
    color: var(--dark);
    font-size: 1.1rem;
    text-align: left;
    margin: 20px 0;
}

.risk-interpretation p {
    margin-bottom: 15px;
}

.risk-interpretation strong {
    color: var(--primary);
    font-weight: 600;
}

.risk-interpretation em {
    color: var(--gray);
    font-style: italic;
}

.risk-interpretation br {
    margin-bottom: 10px;
}

/* Risk Display Styling */
.risk-display {
    margin: 30px 0;
}

.risk-percentage {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    margin: 20px 0;
    padding: 20px;
    background: var(--primary-light);
    border-radius: 12px;
    border-left: 6px solid var(--primary);
}

/* Risk level specific colors */
.risk-percentage[data-risk="Very Low"] { color: var(--secondary); }
.risk-percentage[data-risk="Low"] { color: #2ecc71; }
.risk-percentage[data-risk="Low to moderate"] { color: #f39c12; }
.risk-percentage[data-risk="Moderate to high"] { color: #e67e22; }
.risk-percentage[data-risk="High to Very High"] { color: #e74c3c; }
.risk-percentage[data-risk="Extremely high"] { color: #c0392b; }

/* Responsive Design for mobile */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 0;
    }

    .logo-img {
        height: 50px; /* Single consistent size */
    }

    /* Hide desktop navigation on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1001;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

    .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        justify-content: space-between;
        display: flex;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--primary-light);
        display: none;
        width: 100%;
    }

    .dropdown-menu.active {
        display: block;
    }

    .dropdown-menu a {
        padding: 12px 40px;
        border-bottom: 1px solid #e0e0e0;
    }

    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }

    /* Hero adjustments */
    .hero {
        padding: 40px 0; /* Use the smaller padding from 480px */
    }

    .hero-content h1 {
        font-size: 1.8rem; /* Use the smaller size from 480px */
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    /* Education panel */
    .education-panel {
        padding: 50px 0; /* Use from 480px */
    }

    .education-panel h2 {
        font-size: 2rem; /* Use from 480px */
        margin-bottom: 30px; /* Use from 480px */
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 20px; /* Use from 480px */
    }

    /* Other existing styles */
    .container.py-5 {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    .col-md-6 {
        margin-bottom: 10px;
    }

    .prediction-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .prediction-header h2 {
        font-size: 1.5rem;
    }

    .search-result {
        padding: 20px;
        margin: 20px auto;
    }

    .result-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}