/* Calendar Heatmap Styles */
.calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calendar-year-block {
    width: 100%;
}

.calendar-year-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #e2e8f0;
    border-left: 3px solid #f59e0b;
    padding-left: 10px;
}

/* Controls */
.cal-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.cal-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 0 10px;
    height: 34px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    width: max-content;
    width: -moz-max-content;
    width: -webkit-max-content;
    min-width: unset;
    text-align: center;
}

.cal-select:hover, .cal-select:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(30, 41, 59, 0.8);
}

.cal-select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

.cal-btn-nav {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    height: 34px;
    width: 34px;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cal-btn-nav:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    color: #e2e8f0;
}

.calendar-grid-container {
    display: block;
}

/* Changed from grid to block for single month view */
.cal-month {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s;
    max-width: 100%;
}

.cal-month:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.cal-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    padding-bottom: 4px;
}

.cal-cell {
    /* aspect-ratio: 1; removed for fixed height */
    height: 58px;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.015);
    position: relative;
    transition: all 0.2s;
}

/* Mobile Responsive for Calendar */
@media (max-width: 768px) {
    .cal-cell {
        height: 48px;
        padding-top: 2px;
    }

    .cal-pnl {
        font-size: 0.7rem !important;
        /* Force override inline styles if any, though we removed them from JS it's safer */
    }

    .cal-count {
        display: none;
        /* Hide trade count on mobile to avoid clutter */
    }

    .cal-date {
        font-size: 0.6rem;
        top: 1px;
        left: 2px;
    }

    .calendar-grid-container {
        grid-template-columns: 1fr;
        /* Ensure single column on mobile */
    }

    .card.span-6 {
        grid-column: span 12;
        /* Make card full width on mobile */
    }

    /* Fix controls overflow on mobile */
    .cal-controls {
        gap: 6px;
        justify-content: flex-start;
    }

    .cal-select {
        padding: 0 8px;
        font-size: 0.8rem;
        width: auto;
        min-width: max-content;
        height: 32px;
    }

    .cal-btn-nav {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        /* Keep buttons from shrinking */
    }
}

.cal-cell.empty {
    background: transparent;
}

.cal-cell.has-trade:hover {
    z-index: 10;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.cal-cell.win {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.cal-cell.loss {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.cal-cell.break-even {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.cal-date {
    font-size: 0.65rem;
    opacity: 0.5;
    position: absolute;
    top: 2px;
    left: 4px;
    font-weight: 500;
}

.cal-pnl {
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1.1;
}

.cal-count {
    font-size: 0.6rem;
    opacity: 0.8;
    margin-top: 1px;
}

/* Tooltip-like behavior handled by title or custom JS if needed. Using title for now. */
