/* ========================================
   DI-CALENDAR
   ======================================== */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --fc-bg: #2d2d2d;
    --fc-cell-bg-color: transparent;
    --fc-bg-hover: #3a3a3a;
    --fc-bg-selected: #4a4a4a;
    --fc-text: #cccccc;
    --fc-text-muted: #888888;
    --fc-accent: #6a9fb5;
    --fc-border: #444444;
    --fc-overflow-text: #666666;
    --fc-cell-size: 80px;
    --fc-cell-icon-size: 24px;

    /* Button sizes - adjust these to match PNGs */
    --fc-btn-width: 40px;
    --fc-btn-height: 36px;
    --fc-btn-today-width: 80px;

    /* Dropdown sizes */
    --fc-dropdown-year-width: 120px;
    --fc-dropdown-year-height: 50px;
    --fc-dropdown-month-width: 160px;
    --fc-dropdown-month-height: 40px;
    --fc-dropdown-location-width: 180px;
    --fc-dropdown-location-height: 40px;

    /* Panel sizes */
    --fc-panel-moon-width: 120px;
    --fc-panel-moon-height: 150px;
    --fc-panel-weather-width: 250px;
    --fc-panel-weather-height: 100px;
    --fc-panel-temp-width: 120px;
    --fc-panel-temp-height: 80px;
    --fc-panel-day-label-width: 200px;
    --fc-panel-day-label-height: 60px;
    --fc-panel-events-width: 100%;
    --fc-panel-events-min-height: 100px;

    /* Panel image sizes (for detailed moon/weather images) */
    --fc-panel-moon-img-size: 64px;
    --fc-panel-weather-img-size: 64px;

    /* Temperature colors */
    --fc-temp-high-color: #e07070;
    --fc-temp-low-color: #7070e0;
    --fc-temp-divider-color: #888888;
}

/* ========================================
   RESET FOR WORDPRESS
   ======================================== */
.fc-module,
.fc-module *,
.fc-module *::before,
.fc-module *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.fc-module {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: var(--fc-text);
}

.fc-module img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   BUTTONS
   ======================================== */
.fc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--fc-btn-width);
    height: var(--fc-btn-height);
    padding: 0;
    background-color: var(--fc-bg);
    background-image: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--fc-text);
    border: 1px solid var(--fc-border);
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

.fc-btn:hover:not(:disabled) {
    background-color: var(--fc-bg-hover);
}

.fc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Button-specific backgrounds */
.fc-btn-prev-year {
    background-image: url('./assets/ui/btn_prev_year.png');
}
.fc-btn-prev-year:hover:not(:disabled) {
    background-image: url('./assets/ui/btn_prev_year_hover.png');
}
.fc-btn-prev-year:disabled {
    background-image: url('./assets/ui/btn_prev_year_disabled.png');
}

.fc-btn-prev-month {
    background-image: url('./assets/ui/btn_prev_month.png');
}
.fc-btn-prev-month:hover:not(:disabled) {
    background-image: url('./assets/ui/btn_prev_month_hover.png');
}
.fc-btn-prev-month:disabled {
    background-image: url('./assets/ui/btn_prev_month_disabled.png');
}

.fc-btn-next-month {
    background-image: url('./assets/ui/btn_next_month.png');
}
.fc-btn-next-month:hover:not(:disabled) {
    background-image: url('./assets/ui/btn_next_month_hover.png');
}
.fc-btn-next-month:disabled {
    background-image: url('./assets/ui/btn_next_month_disabled.png');
}

.fc-btn-next-year {
    background-image: url('./assets/ui/btn_next_year.png');
}
.fc-btn-next-year:hover:not(:disabled) {
    background-image: url('./assets/ui/btn_next_year_hover.png');
}
.fc-btn-next-year:disabled {
    background-image: url('./assets/ui/btn_next_year_disabled.png');
}

.fc-btn-today {
    width: var(--fc-btn-today-width);
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/btn_today.png');
    color: var(--fc-text);
    border-color: var(--fc-border);
}
.fc-btn-today:hover:not(:disabled) {
    background-color: var(--fc-bg-hover);
    background-image: url('./assets/ui/btn_today_hover.png');
}

/* Hide button text when background image loads */
.fc-btn {
    color: var(--fc-text);
}

/* ========================================
   DROPDOWNS
   ======================================== */
.fc-dropdown {
    position: relative;
    display: inline-block;
    background: transparent;
}

.fc-dropdown-month::after,
.fc-dropdown-location::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--fc-text);
    border-bottom: 2px solid var(--fc-text);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.fc-select,
.fc-input {
    -webkit-appearance: none;
    appearance: none;
    padding: 0.5rem 1rem;
    background-color: var(--fc-bg);
    background-image: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--fc-text);
    border: 1px solid var(--fc-border);
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.fc-select:hover,
.fc-input:hover,
.fc-select:focus,
.fc-input:focus {
    background-color: var(--fc-bg-hover);
}

.fc-input-year {
    width: var(--fc-dropdown-year-width);
    height: var(--fc-dropdown-year-height);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    background-image: url('./assets/ui/dropdown_year.png');
}

.fc-input-year::-webkit-outer-spin-button,
.fc-input-year::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fc-input-year {
    -moz-appearance: textfield;
}

.fc-select-month {
    width: var(--fc-dropdown-month-width);
    height: var(--fc-dropdown-month-height);
    background-image: url('./assets/ui/dropdown_month.png');
}

.fc-select-location {
    width: var(--fc-dropdown-location-width);
    height: var(--fc-dropdown-location-height);
    background-image: url('./assets/ui/dropdown_location.png');
}

/* iOS/iPadOS Safari fix - prevents auto-zoom and crunched form elements */
@supports (-webkit-touch-callout: none) {
    .fc-select,
    .fc-input {
        font-size: 16px;
        line-height: 1.2;
    }
}

/* ========================================
   YEAR MODULE
   ======================================== */
.fc-module-year {
    text-align: center;
}

/* ========================================
   NAV MODULE
   ======================================== */
.fc-module-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========================================
   CALENDAR GRID
   ======================================== */
.fc-calendar-grid {
    width: 100%;
    overflow-x: auto;
}

.fc-calendar-header {
    display: grid;
    grid-template-columns: repeat(8, minmax(var(--fc-cell-size), 1fr));
    gap: 2px;
    margin-bottom: 2px;
}

.fc-weekday {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--fc-text);
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/weekday_header.png');
    background-size: cover;
    background-position: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-calendar-body {
    display: grid;
    grid-template-columns: repeat(8, minmax(var(--fc-cell-size), 1fr));
    gap: 2px;
}

/* ========================================
   CALENDAR CELLS
   ======================================== */
.fc-day {
    position: relative;
    min-height: var(--fc-cell-size);
    min-width: var(--fc-cell-size);
    overflow: hidden;
}

.fc-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--fc-cell-bg-color);
    background-image: var(--fc-cell-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

.fc-cell-dim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
}

.fc-cell-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 4px;
    min-height: var(--fc-cell-size);
}

.fc-day.fc-current-month {
    cursor: pointer;
}

.fc-day.fc-current-month:hover {
    background-color: var(--fc-bg-hover);
}

/* Selection - CSS outline fallback */
.fc-day.fc-selected {
    outline: 2px solid var(--fc-accent);
    outline-offset: -2px;
}

/* Selection - PNG overlay via pseudo-element */
.fc-day.fc-selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('./assets/ui/cell_selected.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    pointer-events: none;
}

.fc-day.fc-overflow {
    color: var(--fc-overflow-text);
}

.fc-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.fc-day-number {
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.fc-cell-weather {
    width: var(--fc-cell-icon-size);
    height: var(--fc-cell-icon-size);
    flex-shrink: 0;
}

.fc-cell-middle {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.fc-cell-moon {
    width: var(--fc-cell-icon-size);
    height: var(--fc-cell-icon-size);
    flex-shrink: 0;
}

.fc-cell-bottom {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    min-height: 12px;
}

.fc-event-dot {
    width: 8px;
    height: 8px;
    background: var(--fc-accent);
    border-radius: 50%;
    cursor: help;
    flex-shrink: 0;
}

/* ========================================
   DAY LABEL PANEL
   ======================================== */
.fc-module-day-label {
    width: var(--fc-panel-day-label-width);
    min-height: var(--fc-panel-day-label-height);
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_day_label.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-day-label {
    display: flex;
    flex-direction: column;
}

.fc-day-label-day {
    font-size: 1.5rem;
    font-weight: bold;
}

.fc-day-label-month {
    font-size: 0.9rem;
    color: var(--fc-text-muted);
}

/* ========================================
   MOON IMAGE PANEL
   ======================================== */
.fc-module-moon-img {
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_moon_img.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-module-moon-img .fc-moon-img {
    width: var(--fc-panel-moon-img-size);
    height: var(--fc-panel-moon-img-size);
}

/* ========================================
   MOON LABEL PANEL
   ======================================== */
.fc-module-moon-label {
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_moon_label.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-moon-label {
    display: flex;
    flex-direction: column;
}

.fc-moon-name {
    font-weight: bold;
    font-size: 1rem;
}

.fc-moon-phase {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
}

/* ========================================
   WEATHER IMAGE PANEL
   ======================================== */
.fc-module-weather-img {
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_weather_img.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-module-weather-img .fc-weather-img {
    width: var(--fc-panel-weather-img-size);
    height: var(--fc-panel-weather-img-size);
}

/* ========================================
   WEATHER INFO PANEL
   ======================================== */
.fc-module-weather-info {
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_weather_info.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-weather-type {
    font-weight: bold;
    text-transform: capitalize;
    font-size: 1.1rem;
}

.fc-weather-wind {
    color: var(--fc-accent);
    font-size: 0.9rem;
}

.fc-weather-desc {
    color: var(--fc-text-muted);
    font-size: 0.9rem;
}

/* ========================================
   TEMPERATURE PANEL
   ======================================== */
.fc-module-temp {
    width: var(--fc-panel-temp-width);
    min-height: var(--fc-panel-temp-height);
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_temp.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-temp {
    display: inline-flex;
    align-items: center;
    font-size: 1.1rem;
}

.fc-temp-high {
    color: var(--fc-temp-high-color);
}

.fc-temp-divider {
    color: var(--fc-temp-divider-color);
}

.fc-temp-low {
    color: var(--fc-temp-low-color);
}

/* ========================================
   LOCATION MODULE
   ======================================== */
.fc-module-location {
    display: flex;
    justify-content: center;
}

/* ========================================
   EVENTS PANEL
   ======================================== */
.fc-module-events {
    width: var(--fc-panel-events-width);
    min-height: var(--fc-panel-events-min-height);
    background-color: var(--fc-bg);
    background-image: url('./assets/ui/panel_events.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0.5rem;
}

.fc-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fc-event {
    padding: 0.75rem;
    background: var(--fc-bg);
    border-left: 3px solid var(--fc-accent);
    text-align: left;
}

.fc-event-title {
    font-weight: bold;
}

.fc-event-desc {
    color: var(--fc-text-muted);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.fc-no-data {
    color: var(--fc-text-muted);
    font-style: italic;
}

/* ========================================
   FLEXBOX ROW WRAPPER
   ======================================== */
.fc-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.fc-row > .fc-module {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fc-row {
        gap: 0.5rem;
    }

    .fc-row > .fc-module {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .fc-row {
        flex-direction: column;
        align-items: center;
    }

    .fc-row > .fc-module {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================
   NAV RESPONSIVE FIXES
   ======================================== */
.fc-module-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;  /* Prevent edge cutoff */
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .fc-module-nav {
        gap: 0.25rem;
    }

    .fc-module-nav .fc-btn {
        min-width: 36px;
        width: 36px;
        height: 36px;
        padding: 0.25rem;
        font-size: 0.875rem;
    }

    .fc-module-nav .fc-btn-today {
        width: auto;
        min-width: 60px;
        margin-left: 0.5rem;
    }

    .fc-module-nav .fc-select-month {
        width: 120px;
        font-size: 0.875rem;
    }
}

/* ========================================
   WEEKDAY RESPONSIVE
   ======================================== */
.fc-weekday-short {
    display: none;
}

/* Medium screens - show "Draco" instead of "Day Draco" */
@media (max-width: 960px) {
    .fc-weekday-full {
        display: none;
    }

    .fc-weekday-short {
        display: inline;
    }
}


/* ========================================
   TODAY BUTTON MODULE
   ======================================== */
.fc-module-today {
    display: flex;
    justify-content: center;
}

/* ========================================
   EVENTS - MONTH VIEW
   ======================================== */
.fc-event-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.fc-event-clickable:hover {
    background-color: var(--fc-bg-hover);
}

.fc-event-date {
    font-size: 0.8rem;
    color: var(--fc-accent);
    margin-bottom: 0.25rem;
}

.fc-event-title {
    font-weight: bold;
}

.fc-event-desc {
    color: var(--fc-text-muted);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}


/* ========================================
   ALIGN SHIT FOR BOTTOM PANEL
   ======================================== */
/* Moon name and phase - centered */
.fc-moon-label {
    text-align: center;
}

/* Weather info - all lines right aligned */
.fc-module-weather-info {
    text-align: right;
}

/* Temperature - right aligned */
.fc-module-temp {
    text-align: right;
}

/* Moon images - centered */
.fc-module-moon-img {
    display: flex;
    justify-content: center;
}

/* Weather image - centered */
.fc-module-weather-img {
    display: flex;
    justify-content: center;
}
