/* === Global Styles === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background: #f9f9f9;
    color: #333;
}

h1 {
    margin-bottom: 20px;
}

/* === Main Layout === */
.main-layout {
    display: flex;
    gap: 20px;
}

/* === Left Controls Panel === */
.controls {
    flex: 0 0 400px;
    /* fixed width */
    max-width: 400px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    height: calc(100vh - 80px);
    /* allow scroll if content exceeds */
}

/* === Settings Wrapper === */
.settings-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-wrapper label {
    display: block;
    margin: 8px 0 4px;
}

.settings-wrapper input,
.settings-wrapper select {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.settings-wrapper button {
    width: fit-content;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: larger;
    height: fit-content;
}

.settings-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* Icon Buttons */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

/* === Tabs === */
.advanced-tabs {
    margin-top: 10px;
}

.tab-header {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    gap: 5px;
    border-bottom: 1px solid #ccc;
}

.tab-header li {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    background: #eee;
}

.tab-header li.active {
    background: #fff;
    border: 1px solid #ccc;
    border-bottom: none;
}

.tab-panel {
    display: none;
    background: #fff;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 0 4px 4px 4px;
}

.tab-panel.active {
    display: block;
}

.weekday-radio {
    display: flex;
    justify-content: space-between;
}

.weekday-radio input {
    width: fit-content;
}

/* === Right Editor Preview Panel === */
.editor-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    /* important for flex scrolling */
}

/* === Month Scroller === */
.month-scroller-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
}

.month-scroller {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    min-width: max-content;
    scrollbar-width: thin;
    /* Firefox */
}

.month-scroller::-webkit-scrollbar {
    height: 8px;
}

.month-scroller::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.month-card {
    flex: 0 0 auto;
    width: 96px;
    height: 120px;
    border-radius: 8px;
    background: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
    transition: transform 0.2s;
}

.month-card:hover {
    transform: scale(1.05);
}

.month-label {
    text-align: center;
    font-weight: bold;
    padding: 6px 0;
    background: rgba(74, 74, 74, 0.15);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    color: rgb(20, 116, 184);
    text-shadow: 0 1px 1px rgba(12, 12, 206, 0.15);
}

.month-preview {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    color: #ee808d;
}

.month-card.selected {
    border: 1px solid #3ede9c;
    transform: scale(1.05);
    box-shadow: 0 3px 5px rgba(61, 129, 113, 0.449);
}

.month-card .check-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #3ede9c;
    /* blue, adjust if needed */
    font-size: 16px;
    display: none;
    /* hidden by default */
    font-weight: 800;
}

.month-card.selected .check-icon {
    display: block;
    /* show only for selected month */
}

/* === Calendar Display === */
.calendar-display {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === Fieldsets & Toolbars === */
fieldset {
    border: 1px solid #ccc;
    padding: 8px 5px;
    border-radius: 6px;
    margin-bottom: 12px;
}

legend {
    font-weight: bold;
    padding: 0 6px;
}

text-toolbar,
grid-toolbar,
shadow-toolbar {
    display: block;
    margin-top: 6px;
}

/* === Weekday Styles Container === */
#weekdayStyles {
    margin-top: 8px;
}

/* === Event List === */
#eventList {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.event-buttons button {
    margin-left: 4px;
    padding: 2px 4px;
}

/* === Advanced/Basic Toggle === */
.hidden {
    display: none !important;
}