/**
 * Self-Control Savings Gap Calculator Styles
 *
 * All styles scoped to .scc-calculator wrapper
 * to prevent conflicts with other calculators.
 *
 * Part of the Behavioral Finance Calculator Series.
 * Pompian Chapter 19: Self-Control Bias.
 *
 * @package Ryan_OConnell_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables (Scoped to wrapper)
   ========================================================================== */

.scc-calculator {
    --scc-primary: #2563eb;
    --scc-primary-dark: #1e40af;
    --scc-excellent: #15803d;
    --scc-excellent-bg: #dcfce7;
    --scc-good: #22c55e;
    --scc-good-bg: #dcfce7;
    --scc-moderate: #eab308;
    --scc-moderate-bg: #fef9c3;
    --scc-limited: #f59e0b;
    --scc-limited-bg: #fef3c7;
    --scc-minimal: #ef4444;
    --scc-minimal-bg: #fee2e2;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

/* Card Entrance Animation */
.scc-calculator .calculator-card {
    opacity: 0;
    animation: sccAnimateFadeInUp 0.6s ease-out forwards;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered delays for left column cards */
.scc-calculator .col-lg-5 .calculator-card:nth-child(1) { animation-delay: 0ms; }
.scc-calculator .col-lg-5 .calculator-card:nth-child(2) { animation-delay: 100ms; }
.scc-calculator .col-lg-5 .calculator-card:nth-child(3) { animation-delay: 200ms; }

/* Staggered delays for right column cards */
.scc-calculator .col-lg-7 .calculator-card:nth-child(1) { animation-delay: 50ms; }
.scc-calculator .col-lg-7 .calculator-card:nth-child(2) { animation-delay: 150ms; }
.scc-calculator .col-lg-7 .calculator-card:nth-child(3) { animation-delay: 250ms; }
.scc-calculator .col-lg-7 .calculator-card:nth-child(4) { animation-delay: 350ms; }

/* Educational section card animation */
.scc-calculator .educational-section {
    opacity: 0;
    animation: sccAnimateFadeInUp 0.6s ease-out forwards;
    animation-delay: 300ms;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FAQ accordion items animation */
.scc-calculator .faq-accordion .accordion-item {
    opacity: 0;
    animation: sccAnimateFadeInUp 0.6s ease-out forwards;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.scc-calculator .faq-accordion .accordion-item:nth-child(1) { animation-delay: 350ms; }
.scc-calculator .faq-accordion .accordion-item:nth-child(2) { animation-delay: 400ms; }
.scc-calculator .faq-accordion .accordion-item:nth-child(3) { animation-delay: 450ms; }
.scc-calculator .faq-accordion .accordion-item:nth-child(4) { animation-delay: 500ms; }
.scc-calculator .faq-accordion .accordion-item:nth-child(5) { animation-delay: 550ms; }
.scc-calculator .faq-accordion .accordion-item:nth-child(6) { animation-delay: 600ms; }

/* Enhanced hover effects */
.scc-calculator .calculator-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.scc-calculator .educational-section:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.scc-calculator .faq-accordion .accordion-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.scc-calculator .hero-section {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 0;
}

.scc-calculator .hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white !important;
}

.scc-calculator .hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.95;
}

.scc-calculator .hero-section .text-white-50 {
    opacity: 0.7;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.scc-calculator .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.scc-calculator .breadcrumb-item a {
    color: var(--scc-primary);
    text-decoration: none;
}

.scc-calculator .breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.scc-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);
    overflow: hidden;
}

.scc-calculator .calculator-card .card-header {
    background: linear-gradient(135deg, var(--scc-primary) 0%, var(--scc-primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 1.25rem;
}

.scc-calculator .calculator-card .card-header h2 {
    color: white;
    margin: 0;
}

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

/* ==========================================================================
   Form Elements
   ========================================================================== */

.scc-calculator .form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.scc-calculator .form-control:focus {
    border-color: var(--scc-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.scc-calculator .form-text {
    font-size: 0.8rem;
    color: #6b7280;
}

.scc-calculator .input-group-text {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

/* Tooltip */
.scc-calculator .scc-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
    position: relative;
}

.scc-calculator .scc-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.scc-calculator .results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.scc-calculator .result-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.scc-calculator .result-box:hover {
    background: #f1f5f9;
}

.scc-calculator .result-box.full-width {
    grid-column: 1 / -1;
}

.scc-calculator .result-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.scc-calculator .result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.scc-calculator .result-value.excellent {
    color: var(--scc-excellent);
}

.scc-calculator .result-value.good {
    color: var(--scc-good);
}

.scc-calculator .result-value.moderate {
    color: var(--scc-moderate);
}

.scc-calculator .result-value.limited {
    color: var(--scc-limited);
}

.scc-calculator .result-value.minimal {
    color: var(--scc-minimal);
}

.scc-calculator .secondary-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Rating Badge */
.scc-calculator .rating-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.scc-calculator .rating-badge.excellent {
    background: var(--scc-excellent-bg);
    color: var(--scc-excellent);
}

.scc-calculator .rating-badge.good {
    background: var(--scc-good-bg);
    color: var(--scc-good);
}

.scc-calculator .rating-badge.moderate {
    background: var(--scc-moderate-bg);
    color: var(--scc-moderate);
}

.scc-calculator .rating-badge.limited {
    background: var(--scc-limited-bg);
    color: var(--scc-limited);
}

.scc-calculator .rating-badge.minimal {
    background: var(--scc-minimal-bg);
    color: var(--scc-minimal);
}

/* ==========================================================================
   Verdict Box
   ========================================================================== */

.scc-calculator .verdict-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    margin-top: 1rem;
}

.scc-calculator .verdict-box.no-gap {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
}

.scc-calculator .verdict-box.surplus {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
}

.scc-calculator .verdict-text {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* ==========================================================================
   Charts
   ========================================================================== */

.scc-calculator .chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.scc-calculator .chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    text-align: center;
}

/* ==========================================================================
   Sensitivity Table
   ========================================================================== */

.scc-calculator .sensitivity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.scc-calculator .sensitivity-table th,
.scc-calculator .sensitivity-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}

.scc-calculator .sensitivity-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
}

.scc-calculator .sensitivity-table th:first-child,
.scc-calculator .sensitivity-table td:first-child {
    text-align: left;
}

.scc-calculator .sensitivity-table tbody tr:hover {
    background: #f1f5f9;
}

.scc-calculator .sensitivity-table .highlight-row {
    background: #eff6ff;
    font-weight: 600;
}

/* ==========================================================================
   When to Use Box
   ========================================================================== */

.scc-calculator .when-to-use-box {
    background: #eff6ff;
    border-left: 4px solid var(--scc-primary);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.scc-calculator .when-to-use-box h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--scc-primary-dark);
    margin: 0 0 0.75rem 0;
}

.scc-calculator .when-to-use-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.scc-calculator .when-to-use-box li {
    margin-bottom: 0.5rem;
    color: #475569;
}

.scc-calculator .when-to-use-box li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Model Assumptions
   ========================================================================== */

.scc-calculator .assumptions-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.25rem;
}

.scc-calculator .assumptions-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.75rem 0;
}

.scc-calculator .assumptions-box ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: #64748b;
}

.scc-calculator .assumptions-box li {
    margin-bottom: 0.375rem;
}

/* ==========================================================================
   Cross-Link Box
   ========================================================================== */

.scc-calculator .cross-link-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.scc-calculator .cross-link-box i {
    color: #22c55e;
    font-size: 1.25rem;
}

.scc-calculator .cross-link-box p {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.scc-calculator .cross-link-box a {
    color: var(--scc-primary);
    font-weight: 500;
    text-decoration: none;
}

.scc-calculator .cross-link-box a:hover {
    text-decoration: underline;
}

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

@media (max-width: 992px) {
    .scc-calculator .hero-section h1 {
        font-size: 2rem;
    }

    .scc-calculator .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .scc-calculator .hero-section {
        padding: 2rem 0;
    }

    .scc-calculator .hero-section h1 {
        font-size: 1.75rem;
    }

    .scc-calculator .result-value {
        font-size: 1.5rem;
    }

    .scc-calculator .chart-container {
        height: 250px;
    }

    .scc-calculator .sensitivity-table {
        font-size: 0.85rem;
    }

    .scc-calculator .sensitivity-table th,
    .scc-calculator .sensitivity-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .scc-calculator .hero-section {
        padding: 1.5rem 0;
    }

    .scc-calculator .hero-section h1 {
        font-size: 1.5rem;
    }

    .scc-calculator .calculator-card .card-body {
        padding: 1rem;
    }

    .scc-calculator .result-value {
        font-size: 1.25rem;
    }

    .scc-calculator .secondary-value {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Embed Mode
   ========================================================================== */

.scc-calculator.embed-mode .hero-section {
    padding: 1.5rem 0;
}

.scc-calculator.embed-mode .hero-section h1 {
    font-size: 1.5rem;
}

.scc-calculator.embed-mode .calculator-card {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.scc-calculator .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
