/* Calendar Page Styles */

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

/* Card Styling */
.calendar-container .card {
    background-color: #1a1a1a;
    border: 1px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin: 0 0 10px 0;
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
}

/* Date Picker Container - Separate card like briefings page (no glow) */
.date-picker-container {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-picker-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 0;
    display: inline-block;
    white-space: nowrap;
}

.date-picker-input {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 16px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Make entire field clickable on iOS */
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.3);
    touch-action: manipulation;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.3s ease;
}

.date-picker-input:hover {
    border-color: #4a4a4a;
}

.date-picker-input:focus {
    outline: none;
    border-color: #4a9eff;
}

/* Error Message */
.error-message {
    background-color: #2a1a1a;
    border-left: 4px solid #ef4444;
    color: #ffffff;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

/* Events Panels (High/Medium Importance) - Accordion Style */
.events-panel {
    margin-bottom: 24px;
}

.events-panel:last-child {
    margin-bottom: 0;
}

.events-panel-header {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.2s ease;
}

.events-panel-header:hover {
    opacity: 0.8;
}

.events-panel-arrow {
    color: #fbbf24; /* Amber */
    font-size: 12px;
    transition: transform 0.15s ease-out;
}

.events-panel.expanded .events-panel-arrow {
    transform: rotate(180deg);
}

/* Light gray for panels with no events */
.events-panel.no-events .events-panel-arrow {
    color: #888; /* Light gray */
}

.events-panel-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
    overflow: hidden;
}

.events-panel.expanded .events-panel-content-wrapper {
    grid-template-rows: 1fr;
}

.events-panel-content {
    min-height: 0;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Event Cards */
.event-card {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 0; /* Gap handled by events-panel-content */
    transition: border-color 0.2s ease;
}

.event-card:hover {
    border-color: #3a3a3a;
}

.event-card:last-child {
    margin-bottom: 0;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.event-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

/* Removed importance line styling - no colored borders */
.event-name.importance-high {
    /* No border */
}

.event-name.importance-medium {
    /* No border */
}

.event-time {
    color: #888;
    font-size: 14px;
}

.importance-badge {
    display: none;
}

.importance-badge.high {
    display: none;
}

.importance-badge.medium {
    display: none;
}

.importance-badge.low {
    display: none;
}

/* Data Grid */
.event-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-label {
    color: #888;
    font-size: 12px;
}

.data-value {
    color: #ffffff;
    font-weight: 600;
}

.surprise-value {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.surprise-value.positive {
    color: #22c55e;
}

.surprise-value.negative {
    color: #ef4444;
}

.surprise-value.neutral {
    color: #888;
}

/* Interpretation Section */
.interpretation-toggle {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* Inline impact label inside the Interpretation toggle */
.interpretation-impact.highly_bullish,
.interpretation-impact.moderately_bullish {
    color: #10b981;
    font-weight: 700;
}

.interpretation-impact.highly_bearish,
.interpretation-impact.moderately_bearish {
    color: #ef4444;
    font-weight: 700;
}

.interpretation-impact.neutral {
    color: #888;
    font-weight: 700;
}

.interpretation-toggle:hover {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
}

.interpretation-arrow {
    color: #fbbf24; /* Amber */
    transition: transform 0.15s ease-out;
}

.event-card.interpretation-expanded .interpretation-arrow {
    transform: rotate(180deg);
}

/* Accordion content wrapper (CSS Grid for smooth animation) */
.interpretation-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
    overflow: hidden;
}

.event-card.interpretation-expanded .interpretation-content-wrapper {
    grid-template-rows: 1fr;
}

.interpretation-content {
    min-height: 0;
    padding-top: 12px;
}

/* Accordion items (Event Description, Growth, Inflation, Monetary Policy) */
.interpretation-accordion-item {
    margin-bottom: 8px;
}

.interpretation-accordion-item:last-child {
    margin-bottom: 0;
}

.interpretation-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
    transition: opacity 0.2s ease;
}

.interpretation-accordion-header:hover {
    opacity: 0.8;
}

.interpretation-accordion-title {
    font-weight: 600;
    font-size: 14px;
}

/* Accordion title colors - all white */
.interpretation-accordion-item.importance-high .interpretation-accordion-title,
.interpretation-accordion-item.importance-medium .interpretation-accordion-title,
.interpretation-accordion-item.importance-low .interpretation-accordion-title {
    color: #ffffff; /* White for all */
}

.interpretation-accordion-arrow {
    color: #fbbf24; /* Amber */
    font-size: 12px;
    transition: transform 0.15s ease-out;
}

.interpretation-accordion-item.expanded .interpretation-accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion content wrapper (nested accordion) */
.interpretation-accordion-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
    overflow: hidden;
}

.interpretation-accordion-item.expanded .interpretation-accordion-content-wrapper {
    grid-template-rows: 1fr;
}

.interpretation-accordion-content {
    min-height: 0;
    padding-left: 12px;
    padding-top: 0;
    transition: padding-top 0.15s ease-out;
}

.interpretation-accordion-item.expanded .interpretation-accordion-content {
    padding-top: 8px;
}

.interpretation-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.interpretation-explanation {
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
    font-style: italic;
    margin-top: 8px;
    margin-bottom: 12px;
}

.interpretation-detail-section {
    margin-top: 12px;
    margin-bottom: 12px;
}

.interpretation-detail-item {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
}

.interpretation-detail-item:last-child {
    margin-bottom: 0;
}

.interpretation-detail-label {
    color: #888;
    font-size: 12px;
    font-weight: 600;
    min-width: 120px;
    margin-right: 8px;
    flex-shrink: 0;
}

.interpretation-detail-value {
    color: #ccc;
    font-size: 12px;
    line-height: 1.5;
    flex: 1;
}

.interpretation-item {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
}

/* Overall Assessment Section */
.overall-assessment-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Impact (interpretation.impact) - primary 5-level label */
.impact-section {
    margin-top: 12px;
}

.impact-badge {
    width: 100%;
    padding: 10px 12px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.impact-label {
    color: #888;
    font-weight: 500;
}

.impact-value {
    font-weight: 600;
}

/* Impact colors (reuse assessment palette) */
.impact-badge.highly_bullish .impact-value,
.impact-badge.moderately_bullish .impact-value {
    color: #10b981;
}

.impact-badge.highly_bearish .impact-value,
.impact-badge.moderately_bearish .impact-value {
    color: #ef4444;
}

.impact-badge.neutral .impact-value {
    color: #888;
}

.assessment-toggle {
    width: 100%;
    padding: 10px 12px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assessment-toggle:hover {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
}

.assessment-label {
    color: #ffffff; /* White */
    font-weight: 500;
    margin-right: 8px;
}

/* Assessment header no longer shows a value; keep spacing consistent */
.assessment-value { display: none; }

/* Assessment text - 5-color scale */
.assessment-impact.neutral {
    color: #888; /* Gray */
    font-weight: 700;
}

.assessment-impact.moderately_bearish {
    color: #f87171; /* Light red */
    font-weight: 700;
}

.assessment-impact.highly_bearish {
    color: #dc2626; /* Dark red */
    font-weight: 700;
}

.assessment-impact.moderately_bullish {
    color: #4ade80; /* Light green */
    font-weight: 700;
}

.assessment-impact.highly_bullish {
    color: #059669; /* Dark green */
    font-weight: 700;
}

/* Assessment value color coding based on overall assessment */
.overall-assessment-section .assessment-value {
    color: #fff; /* Default white */
}

/* Bullish assessments - Green */
.overall-assessment-section .assessment-toggle.highly_bullish .assessment-value,
.overall-assessment-section .assessment-toggle.moderately_bullish .assessment-value {
    color: #10b981; /* Green */
}

/* Bearish assessments - Red */
.overall-assessment-section .assessment-toggle.highly_bearish .assessment-value,
.overall-assessment-section .assessment-toggle.moderately_bearish .assessment-value {
    color: #ef4444; /* Red */
}

/* Neutral assessment - Gray */
.overall-assessment-section .assessment-toggle.neutral .assessment-value {
    color: #888; /* Gray */
}

.assessment-arrow {
    color: #fbbf24; /* Amber */
    font-size: 12px;
    transition: transform 0.15s ease-out;
}

.overall-assessment-section.assessment-expanded .assessment-arrow {
    transform: rotate(180deg);
}

/* Assessment content wrapper (CSS Grid for smooth animation) */
.assessment-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
    overflow: hidden;
}

.overall-assessment-section.assessment-expanded .assessment-content-wrapper {
    grid-template-rows: 1fr;
}

.assessment-content {
    min-height: 0;
    padding-top: 12px;
}

.breakdown-header {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
    cursor: default; /* Non-clickable */
}

/* Breakdown header colors - all white */
.breakdown-header.importance-high,
.breakdown-header.importance-medium,
.breakdown-header.importance-low {
    color: #ffffff; /* White for all */
}

/* Assessment Accordion Items */
.assessment-accordion-item {
    margin-bottom: 8px;
}

.assessment-accordion-item:last-child {
    margin-bottom: 0;
}

.assessment-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
    transition: opacity 0.2s ease;
}

.assessment-accordion-header:hover {
    opacity: 0.8;
}

.assessment-accordion-title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff; /* White */
}

/* Only the "Assessment Breakdown" header uses importance colors, not the accordion items */

.assessment-accordion-arrow {
    color: #fbbf24; /* Amber */
    font-size: 12px;
    transition: transform 0.15s ease-out;
}

.assessment-accordion-item.expanded .assessment-accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion content wrapper (nested accordion) */
.assessment-accordion-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
    overflow: hidden;
}

.assessment-accordion-item.expanded .assessment-accordion-content-wrapper {
    grid-template-rows: 1fr;
}

.assessment-accordion-content {
    min-height: 0;
    padding-left: 0;
    padding-top: 8px;
}

/* Breakdown icon styling within accordion */
.assessment-accordion-title .breakdown-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

/* Icon colors based on assessment class */
.assessment-accordion-item.assessment-positive .breakdown-icon,
.assessment-accordion-item.assessment-improving .breakdown-icon {
    color: #10b981; /* Green */
}

.assessment-accordion-item.assessment-negative .breakdown-icon,
.assessment-accordion-item.assessment-deteriorating .breakdown-icon {
    color: #ef4444; /* Red */
}

.assessment-accordion-item.assessment-neutral .breakdown-icon,
.assessment-accordion-item.assessment-stable .breakdown-icon {
    color: #888; /* Gray */
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.breakdown-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.breakdown-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.breakdown-item.positive .breakdown-icon,
.breakdown-item.improving .breakdown-icon {
    color: #10b981; /* Green */
}

.breakdown-item.negative .breakdown-icon,
.breakdown-item.deteriorating .breakdown-icon {
    color: #ef4444; /* Red */
}

.breakdown-item.neutral .breakdown-icon,
.breakdown-item.stable .breakdown-icon {
    color: #888; /* Gray */
}

.breakdown-label {
    font-weight: 600;
    color: #fbbf24; /* Yellow */
    min-width: 80px;
}

.breakdown-value {
    font-weight: 500;
    margin-left: 4px;
    color: #fff;
}

.breakdown-reason {
    color: #ccc;
    margin-top: 4px;
    margin-left: 28px;
    font-size: 12px;
    line-height: 1.5;
}

.breakdown-synthesis {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-style: italic;
    color: #aaa;
    font-size: 12px;
    line-height: 1.6;
}

.synthesis-label {
    color: #fbbf24;
    font-weight: 600;
    margin-right: 4px;
}

.synthesis-text {
    color: #ccc;
}

.interpretation-label {
    color: #ffffff; /* White */
    font-weight: 600;
    margin-right: 8px;
}

.interpretation-text {
    color: #ffffff; /* White */
}

/* LLM Note Card */
.llm-note-card {
    background-color: #1a1a1a;
    border: 1px solid #ffffff;
    border-radius: 12px;
    padding: 20px;
}

.llm-section {
    margin-bottom: 24px;
}

.llm-section:last-child {
    margin-bottom: 0;
}

.llm-section-title {
    color: #fbbf24;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
}

.llm-paragraph {
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.llm-paragraph:last-child {
    margin-bottom: 0;
}

.llm-note-placeholder {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .calendar-container {
        padding: 15px;
    }

    .section-title {
        font-size: 20px;
    }

    .card-header {
        font-size: 16px;
    }

    .calendar-container .card {
        padding: 15px;
    }

    .event-card {
        padding: 10px;
    }

    .event-header {
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .event-name {
        font-size: clamp(11px, 3.5vw, 14px);
        min-width: 0;
        flex: 1 1 auto;
        padding-right: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .event-time {
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .importance-badge {
        display: none;
    }

    .event-data-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        font-size: 12px;
    }

    .data-label {
        font-size: 11px;
    }

    .data-value {
        font-size: 13px;
    }

    .interpretation-toggle {
        font-size: 12px;
        padding: 8px 12px;
    }

    .interpretation-item {
        font-size: 12px;
    }

    .llm-section-title {
        font-size: 16px;
    }

    .llm-paragraph {
        font-size: 14px;
    }
    
    .assessment-badge {
        padding: 10px;
        font-size: 13px;
    }
    
    .assessment-breakdown {
        padding: 10px;
        font-size: 12px;
    }
    
    .breakdown-reason {
        font-size: 11px;
        margin-left: 24px;
    }
    
    .breakdown-synthesis {
        font-size: 11px;
    }
}

