/*
 * Styles for the front-end monthly calendar display
 */

/* General Container Styling */
.rc-monthly-calendar {
    max-width: 900px;
    margin: 0 auto 30px;
    font-family: Arial, sans-serif;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

/* Calendar Header (Navigation and Selector) */
.rc-calendar-header {
    display: flex;
    justify-content: space-between; /* Pushes Prev/Next to the edges */
    align-items: center; /* Vertically centers all elements */
    padding: 10px 15px 0 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ccc;
    
    /* === START: CHANGE TO ADD GAP BETWEEN ELEMENTS === */
    gap: 15px; /* Adds 15px space between Prev, Date Form, and Next */
    /* === END: CHANGE === */
}

.rc-calendar-header h2 {
    margin: 0;
    font-size: 1.2em;
    flex-grow: 1; /* Allows the title to take up remaining space */
    text-align: center;
}

.rc-nav {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    white-space: nowrap; /* Prevents button text from wrapping */
}

.rc-nav:hover {
    background-color: #e0e0e0;
}

/* Date Selection Form Styling */
.rc-date-selector {
    display: flex;
    align-items: center;
    /* The 'gap' property on .rc-calendar-header will create space around this form. 
        We use a smaller gap within the form elements themselves. */
    gap: 5px; 
}

.rc-date-selector select,
.rc-date-selector .rc-go-button {
    padding: 5px 8px;
    height: 35px; /* Aligns height of dropdowns and button */
    box-sizing: border-box;
    margin: 0; /* Remove default margins */
}

/* Calendar Grid */
.rc-monthly-calendar table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Ensures uniform column width */
}

.rc-monthly-calendar th,
.rc-monthly-calendar td {
    padding: 0;
    text-align: center;
    border: 1px solid #eee;
    height: 90px; /* Standard height for calendar cells */
    vertical-align: top; /* Ensures content starts at the top */
}

.rc-monthly-calendar th {
    background-color: #eee;
    padding: 10px 0;
    font-weight: bold;
}


/* ------------------------------------------- */
/* --- UPDATED DAY CELL STYLES FOR CUBE REMINDERS --- */
/* ------------------------------------------- */

/* Day Cell Content - We use padding to reserve space for the cubes */
.rc-monthly-calendar td.rc-day,
.rc-monthly-calendar td.rc-day-today {
    position: relative;
    padding: 5px; 
    padding-top: 25px; /* INCREASED PADDING (was 5px) to reserve space for the cubes/bars */
    vertical-align: top;
}

/* Day Cell Number - Position it absolutely in the reserved space */
.rc-day-number {
    font-weight: bold;
    font-size: 1.1em;
    padding: 0; 
    text-align: right;
    color: #333;
    
    /* Position the day number in the top-right corner of the cell's initial padding */
    position: absolute;
    top: 5px;
    right: 5px; 
    margin: 0; /* Remove any previous margins */
}

/* REMINDER BAR STYLING - Now a cube/block */
.rc-reminder-bar {
    /* --- CUBE STYLES --- */
    width: 10px;        /* Cube width */
    height: 10px;       /* Cube height */
    border-radius: 2px; /* Slight rounding on corners */
    display: inline-block; /* Allows cubes to sit side-by-side */
    float: left; /* Makes them flow next to each other horizontally */
    margin: 0 3px 3px 0; /* Spacing between cubes (right and bottom) */
    
    /* Ensure they are positioned relative to flow below the absolute day number */
    position: relative;
    cursor: help;
    /* The background color is set via INLINE style in PHP */
}

/* Clear the float after the cubes to ensure the event list starts on a new line */
.rc-monthly-calendar td::after {
    content: "";
    display: table;
    clear: both;
}


/* Event List inside a day cell - adjusted to sit below the floating bars */
.rc-events-list {
    margin-top: 5px;
    text-align: left;
    padding: 0 5px;
    overflow-y: auto; /* Scroll for too many events */
    max-height: 55px;
}

/* ------------------------------------------- */
/* --- EXISTING/DEFAULT STYLES (REVERTED) --- */
/* ------------------------------------------- */

.rc-day-empty {
    background-color: #f9f9f9;
}

.rc-day-today {
    background-color: #fffbe6; /* Light yellow background for today */
}

.rc-event-title {
    font-size: 0.85em;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.rc-event-title a {
    text-decoration: none;
    display: block; /* Make the whole line clickable */
    /* Color is set using an inline 'style="color: #HEXCODE;"' attribute in PHP */
}

.rc-event-title a:hover {
    text-decoration: underline;
}

.rc-day.has-events {
    background-color: #e6f7ff; /* Light blue background for days with events */
}