/* Prediction Page Styles - Premium Overhaul */
:root {
    --pred-primary: #a51c36;
    --pred-primary-rgb: 165, 28, 54;
    --pred-bg: #f4f6f9;
    --pred-card-bg: #ffffff;
    --pred-text: #2c3e50;
    --pred-text-muted: #6c757d;

    /* Gradients */
    --pred-gradient-main: linear-gradient(135deg, #a51c36 0%, #d92546 100%);
    --pred-gradient-soft: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    --pred-gradient-trend: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    --pred-gradient-bull: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --pred-gradient-bear: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);

    /* Glass & Shadows */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 25px 50px rgba(0, 0, 0, 0.12);
}

.prediction-section {
    background-color: var(--pred-bg);
    min-height: 100vh;
    padding: 3rem 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--pred-text);
    position: relative;
}

/* Main Input Card */
.prediction-card {
    background: var(--pred-card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    /* overflow removed to allow dropdown to escape */
    margin-bottom: 2rem;
}

.prediction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--pred-gradient-main);
}

.prediction-title {
    color: var(--pred-text);
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.prediction-subtitle {
    text-align: center;
    color: var(--pred-text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Elements */
.pred-form-group {
    margin-bottom: 1.25rem;
}

.pred-label {
    font-weight: 600;
    color: var(--pred-text);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pred-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    transition: all 0.25s ease;
    background: #f8f9fa;
    color: var(--pred-text);
}

.pred-input:focus {
    border-color: var(--pred-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--pred-primary-rgb), 0.1);
    outline: none;
}

.pred-btn {
    background: var(--pred-gradient-main);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px rgba(165, 28, 54, 0.2);
}

.pred-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(165, 28, 54, 0.3);
}

.pred-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Autocomplete Dropdown */
.atp-autocomplete {
    position: relative;
}

.atp-autocomplete-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.atp-autocomplete-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.atp-autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    font-size: 0.95rem;
    color: var(--pred-text);
}

.atp-autocomplete-item:hover {
    background: #f8f9fa;
    color: var(--pred-primary);
}

/* Results Container */
.results-container {
    margin-top: 3rem;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Current Valuation Card */
.current-val-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.current-val-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(165, 28, 54, 0.03) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.cv-label {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    color: var(--pred-text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cv-amount {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--pred-gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.25rem;
    line-height: 1.1;
    letter-spacing: -2px;
}

.cv-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.cv-chip {
    background: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pred-text);
    border: 1px solid #e9ecef;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cv-chip i {
    color: var(--pred-primary);
}

/* Scenarios Grid */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.scenario-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-sm);
}

.scenario-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.scenario-card.trend::before {
    background: var(--pred-gradient-trend);
}

.scenario-card.bull::before {
    background: var(--pred-gradient-bull);
}

.scenario-card.bear::before {
    background: var(--pred-gradient-bear);
}

.sc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
}

.sc-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--pred-text);
}

.sc-rate {
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 10px;
    font-size: 0.875rem;
}

.trend .sc-rate {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.bull .sc-rate {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.bear .sc-rate {
    background: rgba(241, 196, 15, 0.1);
    color: #d35400;
}

.sc-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sc-point {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-year {
    color: var(--pred-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.sc-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--pred-text);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 380px;
    position: relative;
}

/* Loading Overlay - Covers only prediction section */
.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--pred-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: var(--pred-text);
    font-weight: 600;
    font-size: 1.1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .prediction-card {
        padding: 1.5rem 1.25rem;
    }

    .prediction-title {
        font-size: 1.75rem;
    }

    .cv-amount {
        font-size: 2.5rem;
    }

    .scenarios-grid {
        grid-template-columns: 1fr;
    }

    .cv-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cv-chip {
        width: 100%;
        justify-content: center;
    }
}