/* Forecast page uses site.css variables */
.forecast-container {
    width: 100%;
    min-height: calc(100vh - 200px);
    margin: 0;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
    text-align: center;
}

.page-subtitle {
    max-width: 900px;
    margin: 0 auto 2rem;
    text-align: center;
    color: var(--muted);
    line-height: 1.7;
}

.page-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

.daily-forecast-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.daily-forecast-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.forecast-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.forecast-btn {
    background: linear-gradient(180deg, var(--blue), var(--blue-2));
    color: white;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(47, 123, 255, 0.3);
    display: inline-block;
    border: none;
}

.forecast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(47, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.forecast-btn:active {
    transform: translateY(0);
}

.generate-analysis-btn,
.generate-report-btn {
    background: linear-gradient(180deg, #238636, #1a5f28);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(35, 134, 54, 0.3);
    margin-left: auto;
}

.generate-analysis-btn:hover,
.generate-report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(35, 134, 54, 0.4);
}

.generate-analysis-btn:active,
.generate-report-btn:active {
    transform: translateY(0);
}

.generate-report-btn {
    margin-left: 1rem;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

/* Mobile: larger tap targets */
@media (max-width: 576px) {
    .forecast-container {
        padding: 1rem;
    }

    .calendar-day {
        min-height: 46px;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--surface-2);
    color: var(--text);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.image-upload-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.image-upload-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-upload-label {
    color: #c9d1d9;
    font-size: 0.875rem;
    font-weight: 500;
}

.image-date-info {
    color: #8b949e;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
}

.image-upload-label {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.image-date-info {
    color: var(--muted-2);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
}

.image-upload-input {
    padding: 0.5rem;
    background-color: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload-input:hover {
    border-color: var(--blue);
}

.image-upload-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 0.25rem rgba(47, 123, 255, 0.25);
}

.image-preview {
    width: 100%;
    min-height: 150px;
    max-height: 200px;
    background-color: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: none;
}

.image-preview img.show {
    display: block;
}

.image-preview::before {
    content: 'No image selected';
    color: var(--muted-2);
    font-size: 0.875rem;
}

.image-preview.has-image::before {
    display: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background-color: #238636;
    color: #ffffff;
}

.modal-btn-primary:hover {
    background-color: #2ea043;
}

.modal-btn-primary:disabled {
    background-color: #1a5f28;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.modal-btn-secondary:hover {
    border-color: var(--blue);
    color: var(--blue);
    background-color: var(--surface);
}

.modal-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.modal-message.success {
    display: block;
    background-color: rgba(35, 134, 54, 0.1);
    border: 1px solid #238636;
    color: #2ea043;
}

.modal-message.error {
    display: block;
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    color: #f85149;
}

.report-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.report-message.success {
    display: block;
    background-color: rgba(35, 134, 54, 0.1);
    border: 1px solid #238636;
    color: #2ea043;
}

.report-message.error {
    display: block;
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    color: #f85149;
}

.forecast-data-section {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Newest Report Button */
.newest-report-button-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.newest-report-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(47, 123, 255, 0.3), rgba(27, 77, 255, 0.4));
    border: 1px solid rgba(47, 123, 255, 0.5);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(47, 123, 255, 0.2);
    position: relative;
    cursor: pointer;
}

.newest-report-button:hover:not(.newest-report-locked) {
    background: linear-gradient(135deg, rgba(47, 123, 255, 0.5), rgba(27, 77, 255, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 123, 255, 0.4);
    color: var(--text);
    text-decoration: none;
}

.newest-report-button:active:not(.newest-report-locked) {
    transform: translateY(0);
}

.newest-report-button:focus-visible {
    outline: 2px solid rgba(25, 211, 197, 0.85);
    outline-offset: 3px;
}

.newest-report-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.newest-report-date {
    font-size: 0.9375rem;
    color: var(--muted);
    font-weight: 500;
}

.newest-report-locked {
    background: linear-gradient(135deg, rgba(255, 176, 32, 0.20), rgba(47, 123, 255, 0.25));
    border-color: rgba(255, 176, 32, 0.45);
    cursor: pointer;
    opacity: 0.85;
}

.newest-report-locked:hover {
    background: linear-gradient(135deg, rgba(255, 176, 32, 0.30), rgba(47, 123, 255, 0.35));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 176, 32, 0.3);
}

.newest-report-lock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0.95;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.reports-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--muted);
    font-style: italic;
}

/* Reports Table Styles */
.reports-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: var(--bg-1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    table-layout: fixed;
}

.reports-table thead {
    background-color: var(--surface-2);
}

.reports-table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.reports-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.reports-table tbody tr:hover {
    background-color: var(--surface);
}

.reports-table tbody tr:last-child {
    border-bottom: none;
}

.reports-table tbody td {
    padding: 1.25rem 1.5rem;
    color: var(--muted);
    font-size: 0.9375rem;
    vertical-align: middle;
}

.reports-table tbody td:first-child {
    color: var(--text);
    font-weight: 500;
}

.reports-table tbody td:nth-child(2) {
    font-weight: 600;
    text-transform: capitalize;
}

.reports-table tbody td.status-finished {
    color: var(--teal);
}

/* View Report Button */
.view-report-btn {
    background: linear-gradient(180deg, #238636, #1a5f28);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-report-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(35, 134, 54, 0.4);
}

.view-report-btn:active {
    transform: translateY(0);
}

/* Forecast Details Styles */
.forecast-details-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.forecast-header-info {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.info-label {
    color: #8b949e;
    font-size: 0.875rem;
    font-weight: 500;
}

.info-value {
    color: #f0f6fc;
    font-size: 0.9375rem;
    font-weight: 600;
}

.forecast-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #58a6ff;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #30363d;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-row.full-width {
    flex-direction: column;
    gap: 0.5rem;
}

.info-text {
    color: #c9d1d9;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

/* Risk Level Colors */
.risk-low {
    color: #2ea043;
}

.risk-medium {
    color: #d29922;
}

.risk-high {
    color: #f85149;
}

.risk-extreme {
    color: #da3633;
}

/* Opportunity Level Colors */
.opportunity-low {
    color: #8b949e;
}

.opportunity-moderate {
    color: #58a6ff;
}

.opportunity-high {
    color: #2ea043;
}

.opportunity-highifpatience {
    color: #79c0ff;
}

/* Scenario Styles */
.scenario-item {
    padding: 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.scenario-item:last-child {
    margin-bottom: 0;
}

.scenario-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 0.75rem;
}

.scenario-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Zone Styles */
.zone-item {
    padding: 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.zone-item:last-child {
    margin-bottom: 0;
}

.danger-zone {
    border-left: 4px solid #f85149;
}

.opportunity-zone {
    border-left: 4px solid #2ea043;
}

.severity-low {
    color: #8b949e;
}

.severity-medium {
    color: #d29922;
}

.severity-high {
    color: #f85149;
}

.severity-extreme {
    color: #da3633;
}

.conviction-low {
    color: #8b949e;
}

.conviction-moderate {
    color: #58a6ff;
}

.conviction-high {
    color: #2ea043;
}

.conviction-mediumtohigh {
    color: #79c0ff;
}

/* Key Levels Styles */
.levels-section {
    margin-bottom: 1.5rem;
}

.levels-section:last-child {
    margin-bottom: 0;
}

.levels-title {
    font-size: 1rem;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 0.75rem;
}

.level-item {
    padding: 0.75rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.level-item:last-child {
    margin-bottom: 0;
}

.level-value {
    color: #f0f6fc;
    font-size: 1rem;
    font-weight: 600;
}

.level-strength {
    font-size: 0.875rem;
    font-weight: 500;
}

.strength-weak {
    color: #8b949e;
}

.strength-moderate {
    color: #d29922;
}

.strength-strong {
    color: #2ea043;
}

.strength-nearterm {
    color: #58a6ff;
}

.level-reason {
    color: #8b949e;
    font-size: 0.875rem;
    margin: 0;
    margin-top: 0.25rem;
}

/* Calendar Styles */
.calendar-container {
    max-width: 650px;
    width: 100%;
    margin: 2rem auto 0;
}

.calendar-month {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.calendar-month-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.calendar-nav-btn {
    background: linear-gradient(180deg, var(--blue), var(--blue-2));
    color: white;
    border: none;
    padding: 0.35rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(47, 123, 255, 0.3);
}

.calendar-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(47, 123, 255, 0.4);
}

.calendar-nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.calendar-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-grid {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.3rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
}

/* Make report days proper links without breaking layout */
.calendar-day-link {
    text-decoration: none;
    color: inherit;
}

.calendar-day-link:focus-visible {
    outline: 2px solid rgba(25, 211, 197, 0.85);
    outline-offset: 3px;
}

.calendar-day-empty {
    border: none;
    background: transparent;
}

.calendar-day-no-reports {
    background: rgba(139, 148, 158, 0.1);
    color: rgba(234, 240, 255, 0.4);
    cursor: default;
}

.calendar-day-has-reports {
    background: linear-gradient(135deg, rgba(47, 123, 255, 0.3), rgba(27, 77, 255, 0.4));
    color: var(--text);
    cursor: pointer;
    border-color: rgba(47, 123, 255, 0.5);
}

.calendar-day-has-reports:hover {
    background: linear-gradient(135deg, rgba(47, 123, 255, 0.5), rgba(27, 77, 255, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 123, 255, 0.4);
}

/* Locked (recent) report for anonymous users */
.calendar-day-locked {
    background: linear-gradient(135deg, rgba(255, 176, 32, 0.20), rgba(47, 123, 255, 0.25));
    border-color: rgba(255, 176, 32, 0.45);
}

.calendar-day-lock {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.85rem;
    opacity: 0.95;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.calendar-day-has-reports:active {
    transform: translateY(0);
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 600;
}

.calendar-day-today {
    border: 2px solid #f85149 !important;
    box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.2);
}

/* Responsive Design */
@media (max-width: 767px) {
    .forecast-container {
        padding: 1rem;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .daily-forecast-title {
        font-size: 1.5rem;
    }

    .forecast-buttons {
        flex-direction: column;
    }

    .forecast-btn,
    .generate-analysis-btn,
    .generate-report-btn {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    .generate-report-btn {
        margin-top: 1rem;
    }

    .image-upload-container {
        grid-template-columns: 1fr;
    }

    .forecast-data-section {
        padding: 1.5rem;
        min-height: 300px;
    }

    /* Calendar Mobile Layout - 4 columns instead of 7 */
    .calendar-container {
        max-width: 100%;
        margin: 1rem auto 0;
    }

    .calendar-month {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .calendar-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .calendar-month-title {
        font-size: 1.1rem;
    }

    .calendar-nav-btn {
        padding: 0.3rem 0.75rem;
        font-size: 0.75rem;
    }

    .calendar-weekdays {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
        margin-bottom: 0.25rem;
    }

    .calendar-weekday {
        font-size: 0.7rem;
        padding: 0.25rem;
        text-align: center;
    }

    /* Show only first 4 weekdays on mobile, hide the rest */
    .calendar-weekday:nth-child(n+5) {
        display: none;
    }

    .calendar-days {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }

    .calendar-day {
        min-height: 44px;
        aspect-ratio: 1;
        border-radius: 4px;
    }

    .calendar-day-number {
        font-size: 0.8rem;
    }

    .calendar-day-lock {
        top: 4px;
        right: 4px;
        font-size: 0.75rem;
    }

    .reports-table {
        font-size: 0.875rem;
    }

    .reports-table thead th,
    .reports-table tbody td {
        padding: 0.875rem 1rem;
    }

    .reports-table thead th {
        font-size: 0.75rem;
    }

    .view-report-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
}

