/* ==================================================
   1. Header & Navigation
================================================== */
.nbcal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 10px;
    min-height: 30px;
}

.nbcal-header .nbcal-current-month {
    flex: 1;
    text-align: center;
}

.nbcal-current-month {
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nbcal-current-month:hover {
    background-color: #f0f0f1;
    color: #2271b1;
    /* WordPress link blue */
}

.nbcal-nav-placeholder {
    display: inline-block;
    width: 30px;
    /* Matches nav button width */
}

/* ==================================================
   2. Calendar Table
================================================== */
.nbcal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.nbcal-table th {
    font-size: 0.8em;
    color: #999;
    padding-bottom: 10px;
}

/* ==================================================
   3. Circles
================================================== */
.nbcal-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Holiday: filled circle */
.is-holiday .nbcal-circle {
    background-color: #ff4757;
    color: #fff;
}

/* User-overridable color classes */
.nbcal-circle-1 {}

.nbcal-circle-2 {}

.nbcal-circle-3 {}

.nbcal-circle-4 {}

.nbcal-circle-5 {}

.nbcal-circle-6 {}

.nbcal-circle-7 {}

.nbcal-circle-8 {}

.nbcal-circle-9 {}

.nbcal-circle-10 {}

/* ==================================================
   4. Legend (Front-end)
================================================== */
.nbcal-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 10px;
    font-size: 80%;
    color: #555;
    width: 100%;
    text-align: left;
}

.nbcal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: inherit;
}

/* Small dot for legend (fits within line height) */
.nbcal-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-top: -1px;
}

.nbcal-legend-text {
    line-height: 1;
}

/* ==================================================
   5. Front-end Title & Wrapper
================================================== */
.nbcal-front-wrapper {
    margin-bottom: 20px;
}

.nbcal-front-title {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* ==================================================
   6. Admin: Multi-month Layout
================================================== */
.nbcal-multi-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.nbcal-month-unit {
    flex: 0 0 300px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

/* ==================================================
   7. Admin: Calendar Interactions
================================================== */
.nbcal-table.admin-mode td[data-date] {
    cursor: pointer;
}

.nbcal-table.admin-mode td[data-date]:hover .nbcal-circle {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.nbcal-table.admin-mode td.is-holiday:hover .nbcal-circle {
    background-color: #ff6b81;
}

/* ==================================================
   8. Admin: Circle Selector (Badges)
================================================== */
.nbcal-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Hide the native radio input; style the label as a badge */
.nbcal-badge-label input[type="radio"] {
    display: none;
}

.nbcal-badge {
    display: inline-block;
    padding: 4px 12px;
    border: 2px solid var(--circle-color);
    border-radius: 20px;
    color: var(--circle-color);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
}

.nbcal-badge-label input[type="radio"]:checked+.nbcal-badge {
    background-color: var(--circle-color);
    color: #fff;
}

.nbcal-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* ==================================================
   9. Admin: Circle Config Cards
================================================== */
.nbcal-config-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.nbcal-config-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nbcal-hidden-card {
    display: none;
}

.nbcal-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #ececec;
    font-weight: 600;
}

.nbcal-card-body {
    padding: 12px 16px;
    flex: 1 1 auto;
}

.nbcal-input-group {
    margin-bottom: 10px;
}

.nbcal-input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.nbcal-input-group input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
}

/* Card footer (save/delete button area) */
.nbcal-card-footer {
    background: #fcfcfc;
    padding: 10px 15px;
    border-top: 1px solid #ccd0d4;
    text-align: right;
    border-radius: 0 0 4px 4px;
}

.nbcal-card-footer .button {
    font-size: 12px;
    padding: 0 10px;
    min-height: 28px;
    line-height: 26px;
}

/* ==================================================
   10. Responsive
================================================== */
@media screen and (max-width: 1200px) {
    .nbcal-config-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 782px) {
    .nbcal-config-cards {
        grid-template-columns: 1fr;
    }
}