/**
 * Tax-Equivalent Yield Calculator Styles
 *
 * Scoped to .tey-calculator wrapper
 * Blue color scheme (#2563eb, #1e40af) - no purple
 *
 * @package Ryan_OConnell_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
.tey-calculator {
    --primary: #2563eb;
    --primaryDark: #1e40af;
    --excellent: #15803d;
    --good: #22c55e;
    --moderate: #eab308;
    --limited: #f59e0b;
    --minimal: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --white: #ffffff;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.tey-calculator .hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryDark) 100%);
    color: var(--white);
    padding: 3rem 0;
    margin-bottom: 0;
}

.tey-calculator .hero-section h1 {
    font-weight: 700;
    color: var(--white);
}

.tey-calculator .hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ==========================================================================
   Card Styling
   ========================================================================== */
.tey-calculator .calculator-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    animation: fade-in-up 0.3s ease-out;
}

.tey-calculator .calculator-card .card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem;
}

.tey-calculator .calculator-card .card-header h2,
.tey-calculator .calculator-card .card-header h5 {
    color: var(--gray-800);
    font-weight: 600;
}

.tey-calculator .calculator-card .card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Form Inputs
   ========================================================================== */
.tey-calculator .form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.tey-calculator .form-control,
.tey-calculator .form-select {
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tey-calculator .form-control:focus,
.tey-calculator .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tey-calculator .form-control-lg {
    font-size: 1.1rem;
}

.tey-calculator .input-group-text {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-600);
    font-weight: 500;
}

.tey-calculator .form-text {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Form Switch (Checkboxes) */
.tey-calculator .form-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
}

.tey-calculator .form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.tey-calculator .form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tey-calculator .form-switch .form-check-label {
    cursor: pointer;
    padding-left: 0.5rem;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */
.tey-calculator .tey-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--gray-300);
    color: var(--gray-600);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
    position: relative;
}

.tey-calculator .tey-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: 220px;
    text-align: center;
    z-index: 100;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* ==========================================================================
   Results Display
   ========================================================================== */
.tey-calculator .tey-primary-result {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryDark) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.tey-calculator .tey-result-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.tey-calculator .tey-result-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
}

.tey-calculator .tey-rating-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
}

/* Recommendation Box */
.tey-calculator .tey-recommendation {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    background: var(--gray-100);
    color: var(--gray-600);
}

.tey-calculator .recommendation-buy-muni {
    background: rgba(21, 128, 61, 0.1);
    color: var(--excellent);
    border: 2px solid var(--excellent);
}

.tey-calculator .recommendation-buy-taxable {
    background: rgba(239, 68, 68, 0.1);
    color: var(--minimal);
    border: 2px solid var(--minimal);
}

.tey-calculator .recommendation-neutral {
    background: rgba(234, 179, 8, 0.1);
    color: var(--moderate);
    border: 2px solid var(--moderate);
}

/* Secondary Results */
.tey-calculator .tey-secondary-result {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.tey-calculator .tey-secondary-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.tey-calculator .tey-secondary-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* ==========================================================================
   Formula Breakdown
   ========================================================================== */
.tey-calculator .tey-formula-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
}

.tey-calculator .tey-formula-section h6 {
    color: var(--gray-700);
    font-weight: 600;
}

.tey-calculator .tey-formula-step {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.tey-calculator .tey-formula-step:last-child {
    border-bottom: none;
}

.tey-calculator .tey-step-label {
    font-weight: 500;
    color: var(--gray-600);
    flex: 0 0 auto;
    margin-right: 0.5rem;
}

.tey-calculator .tey-step-value {
    color: var(--gray-800);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    flex: 1 1 auto;
    text-align: right;
}

/* ==========================================================================
   Model Assumptions
   ========================================================================== */
.tey-calculator .model-assumptions {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.tey-calculator .model-assumptions h5 {
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tey-calculator .model-assumptions ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.tey-calculator .model-assumptions li {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */
.tey-calculator .accordion-button {
    font-weight: 500;
    color: var(--gray-700);
}

.tey-calculator .accordion-button:not(.collapsed) {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.tey-calculator .accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

.tey-calculator .accordion-body {
    color: var(--gray-600);
    line-height: 1.6;
}

/* ==========================================================================
   Author Badge
   ========================================================================== */
.tey-calculator .author-badge {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    transition: box-shadow 0.2s ease;
}

.tey-calculator .author-badge:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tey-calculator .author-badge img {
    border: 2px solid var(--primary);
}

/* ==========================================================================
   Warning Alert
   ========================================================================== */
.tey-calculator .alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid var(--moderate);
    color: var(--gray-800);
    border-radius: 8px;
}

/* ==========================================================================
   Related Articles
   ========================================================================== */
.tey-calculator .related-articles-section .card {
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tey-calculator .related-articles-section .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and below */
@media (max-width: 992px) {
    .tey-calculator .hero-section {
        padding: 2rem 0;
    }

    .tey-calculator .hero-section h1 {
        font-size: 2rem;
    }

    .tey-calculator .tey-result-value {
        font-size: 2.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tey-calculator .hero-section h1 {
        font-size: 1.75rem;
    }

    .tey-calculator .hero-section .lead {
        font-size: 1rem;
    }

    .tey-calculator .tey-primary-result {
        padding: 1.5rem;
    }

    .tey-calculator .tey-result-value {
        font-size: 2rem;
    }

    .tey-calculator .tey-secondary-value {
        font-size: 1.2rem;
    }

    .tey-calculator .tey-formula-step {
        flex-direction: column;
    }

    .tey-calculator .tey-step-value {
        text-align: left;
        margin-top: 0.25rem;
    }
}

/* Small mobile */
@media (max-width: 576px) {
    .tey-calculator .calculator-card .card-body {
        padding: 1rem;
    }

    .tey-calculator .tey-primary-result {
        padding: 1rem;
    }

    .tey-calculator .tey-result-value {
        font-size: 1.75rem;
    }

    .tey-calculator .tey-tooltip:hover::after {
        width: 180px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.tey-calculator .text-success {
    color: var(--excellent) !important;
}

.tey-calculator .text-danger {
    color: var(--minimal) !important;
}
