/* Page-specific body styles for vertical centering */
body.body-calendar {
    display: flex;
    flex-direction: column;

    align-items: center;     /* Horizontally center */
    padding: 0; /* Remove body padding to let the wrapper handle it */
}

/* Set a different background for the calendar page ONLY on desktop screens */
@media (min-width: 769px) {
    body.body-calendar {
        background: #000000 url(https://ghproxy.net/https://raw.githubusercontent.com/ryusoh/host/refs/heads/master/images/DSCF5903-2.JPG) center center no-repeat !important;
        background-size: cover !important;
    }
}

/* Remove the dark container background on the calendar page for a cleaner look */
.body-calendar .content-block {
    background-color: transparent;
    box-shadow: none;
}

.cal-heatmap-container {
    margin-top: 35px;
    display: flex; /* Helps in centering the calendar block */
    justify-content: center; /* Horizontally center the calendar */
}

/* Ensure the calendar SVG scales down on smaller screens to fit its container */
#cal-heatmap svg {
    max-width: 100%;
}

/* Navigation controls for the calendar */
#calendar-navigation-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px; /* Add space above the detached buttons */
}

.cal-nav-btn {
    /* Minimalist icon-only buttons */
    background-color: transparent;
    border: none;
    color: rgba(44, 44, 46, 0.7); /* Set to match the container's background color as requested */
    padding: 8px; /* Add some padding to make them easier to click */
    cursor: pointer;
    font-size: 24px; /* Larger icons for better visibility */
    transition: color 0.2s ease, transform 0.1s ease;
    /* Center the icon inside the button */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Disable the default tap highlight color on mobile browsers */
    -webkit-tap-highlight-color: transparent;
}

.cal-nav-btn:hover:not(:disabled) {
    color: rgba(84, 84, 88, 0.7); /* A slightly lighter shade for the hover effect */
}

.cal-nav-btn:active:not(:disabled) {
    transform: scale(0.7);
}

.cal-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Override Cal-Heatmap default styles for a dark theme */
/* Note: Selectors updated to match Cal-Heatmap v4 */
.ch-tooltip {
    background: #1c1c1e !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-family: 'JetBrains Mono', monospace !important; /* This is now controlled by the tooltip.text function */
}

.ch-tooltip .pnl-positive {
    color: #4CAF50; /* Standard Green for positive P&L */
}

.ch-tooltip .pnl-negative {
    color: #F44336; /* Standard Red for negative P&L */
}

.ch-domain-label {
    /* Increase opacity and add a shadow to improve visibility */
    fill: rgba(255, 255, 255, 0.9) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 14px; /* Make month labels larger */
    stroke: black;
    stroke-width: 1px;
}

.ch-subdomain-text { font-size: 10px; pointer-events: none; }
.subdomain-line1 { font-weight: normal; }
.pnl-positive { fill: #1b5e20; }
.pnl-negative { fill: #b71c1c; }

.ch-week-label { /* .ch-month-label is for horizontal calendars, .ch-domain-label is used for vertical */
    font-size: 14px !important; /* Make month labels larger */
    fill: rgba(255, 255, 255, 0.4) !important;
}

.ch-subdomain-highlight {
    stroke: rgba(255, 255, 255, 0.8) !important;
    stroke-width: 1px !important;
}


.ch-subdomain[data-v] {
    /* Add a subtle frosted glass effect */
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Zoom functionality */
.page-center-wrapper {
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    background-color: rgba(44, 44, 46, 0); /* Initially transparent */
    border-radius: 0px; /* Initially no radius */
    box-shadow: 0 0 0 rgba(0, 0, 0, 0); /* Initially no shadow */
    position: relative; /* for z-index and positioning context */
    top: 0;
    left: 0;
}

.page-center-wrapper.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.6);
    max-width: 95vw;
    max-height: 95vh;
    overflow: auto;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.page-center-wrapper.zoomed .content-block {
    max-width: none;
}