/**
 * TimeFrame Studio - Professional Styles
 * Developed by Ross Dynamics LLC
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
.elks-cal {
    --elks-bg: #f8f9fa;
    --elks-surface: #ffffff;
    --elks-border: #e2e8f0;
    --elks-border-light: #f1f5f9;
    --elks-text: #1e293b;
    --elks-text-muted: #64748b;
    --elks-text-light: #94a3b8;
    --elks-primary: #0f172a;
    --elks-primary-hover: #1e293b;
    --elks-accent: #3b82f6;
    --elks-accent-hover: #2563eb;
    --elks-success: #10b981;
    --elks-danger: #ef4444;
    --elks-danger-hover: #dc2626;
    --elks-special: #8b5cf6;
    --elks-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --elks-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --elks-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --elks-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --elks-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --elks-radius: 8px;
    --elks-radius-lg: 12px;
    --elks-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--elks-text);
    background: var(--elks-bg);
    min-height: 100vh;
    box-sizing: border-box;
}

.elks-cal *, .elks-cal *::before, .elks-cal *::after {
    box-sizing: inherit;
}

/* ============================================
   Login Screen
   ============================================ */
.elks-cal-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
}

.elks-cal-login-box {
    background: var(--elks-surface);
    padding: 48px;
    border-radius: var(--elks-radius-lg);
    box-shadow: var(--elks-shadow-xl);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--elks-border);
}

.elks-cal-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.elks-cal-login-icon {
    width: 48px;
    height: 48px;
    color: var(--elks-primary);
    margin-bottom: 16px;
}

.elks-cal-login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--elks-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
}

.elks-cal-login-header p {
    color: var(--elks-text-muted);
    margin: 0;
    font-size: 14px;
}

.elks-cal-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.elks-cal-input-group {
    display: flex;
    gap: 12px;
}

.elks-cal-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    font-size: 15px;
    color: var(--elks-text);
    background: var(--elks-surface);
    transition: border-color var(--elks-transition), box-shadow var(--elks-transition);
}

.elks-cal-input-group input:focus {
    outline: none;
    border-color: var(--elks-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.elks-cal-input-group input::placeholder {
    color: var(--elks-text-light);
}

.elks-cal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--elks-danger);
    padding: 12px 16px;
    border-radius: var(--elks-radius);
    font-size: 13px;
    text-align: center;
}

/* ============================================
   Buttons
   ============================================ */
.elks-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--elks-radius);
    border: none;
    cursor: pointer;
    transition: all var(--elks-transition);
    white-space: nowrap;
}

.elks-cal-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.elks-cal-btn-primary {
    background: var(--elks-primary);
    color: #ffffff;
}

.elks-cal-btn-primary:hover {
    background: var(--elks-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--elks-shadow-md);
}

.elks-cal-btn-secondary {
    background: var(--elks-surface);
    color: var(--elks-text);
    border: 1px solid var(--elks-border);
}

.elks-cal-btn-secondary:hover {
    background: var(--elks-bg);
    border-color: var(--elks-text-light);
}

.elks-cal-btn-ghost {
    background: transparent;
    color: var(--elks-text-muted);
    padding: 8px 14px;
}

.elks-cal-btn-ghost:hover {
    background: var(--elks-bg);
    color: var(--elks-text);
}

.elks-cal-btn-danger {
    background: var(--elks-danger);
    color: #ffffff;
}

.elks-cal-btn-danger:hover {
    background: var(--elks-danger-hover);
}

.elks-cal-btn-full {
    width: 100%;
}

.elks-cal-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.elks-cal-btn-sm svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Main App Layout
   ============================================ */
.elks-cal-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--elks-bg);
}

/* Compact Toolbar */
.elks-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--elks-surface);
    border-bottom: 1px solid var(--elks-border);
    box-shadow: var(--elks-shadow-sm);
    flex-wrap: wrap;
}

.elks-cal-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elks-cal-logo {
    width: 24px;
    height: 24px;
    color: var(--elks-primary);
}

.elks-cal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--elks-text);
    letter-spacing: -0.025em;
}

.elks-cal-toolbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.elks-cal-toolbar-project {
    margin-left: auto;
}

.elks-cal-project-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--elks-bg);
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--elks-text);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-project-btn:hover {
    border-color: var(--elks-text-light);
    background: var(--elks-surface);
}

.elks-cal-project-btn svg {
    width: 14px;
    height: 14px;
    color: var(--elks-text-muted);
}

.elks-cal-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elks-cal-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    background: var(--elks-surface);
    color: var(--elks-text-muted);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-btn-icon:hover {
    background: var(--elks-bg);
    color: var(--elks-text);
    border-color: var(--elks-text-light);
}

.elks-cal-btn-icon svg {
    width: 18px;
    height: 18px;
}

.elks-cal-select-compact {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--elks-text);
    background: var(--elks-surface);
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    cursor: pointer;
}

.elks-cal-select-compact:hover {
    border-color: var(--elks-text-light);
}

.elks-cal-btn-compact {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--elks-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-btn-compact:hover {
    background: var(--elks-bg);
    color: var(--elks-text);
}

/* Projects Dropdown */
.elks-cal-projects-dropdown {
    background: var(--elks-surface);
    border-bottom: 1px solid var(--elks-border);
    padding: 12px 16px;
    max-height: 250px;
    overflow-y: auto;
}

.elks-cal-projects-dropdown .elks-cal-projects-list {
    margin-bottom: 8px;
}

/* ============================================
   Project Panel (legacy - kept for projects list)
   ============================================ */
.elks-cal-project-label {
    font-size: 13px;
    color: var(--elks-text-muted);
}

.elks-cal-project-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--elks-text);
}

.elks-cal-projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.elks-cal-projects-list:empty::before {
    content: "No saved projects yet.";
    color: var(--elks-text-light);
    font-style: italic;
    padding: 12px;
    text-align: center;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
    display: block;
}

.elks-cal-project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
    border: 1px solid var(--elks-border-light);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-project-item:hover {
    border-color: var(--elks-accent);
    background: #f8fafc;
}

.elks-cal-project-item.active {
    border-color: var(--elks-accent);
    background: #eff6ff;
}

.elks-cal-project-item-info {
    flex: 1;
    min-width: 0;
}

.elks-cal-project-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--elks-text);
}

.elks-cal-project-item-date {
    font-size: 11px;
    color: var(--elks-text-light);
    margin-top: 2px;
}

.elks-cal-project-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--elks-text-light);
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-project-item-delete:hover {
    background: #fef2f2;
    color: var(--elks-danger);
}

.elks-cal-project-item-delete svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Calendar Wrapper (for size preview)
   ============================================ */
.elks-cal-wrapper {
    transition: max-width var(--elks-transition);
    margin: 0 auto;
}

.elks-cal-wrapper.preview-letter-portrait {
    max-width: 680px;
}

.elks-cal-wrapper.preview-letter-landscape {
    max-width: 880px;
}

.elks-cal-wrapper.preview-tabloid-portrait {
    max-width: 750px;
}

.elks-cal-wrapper.preview-tabloid-landscape {
    max-width: 1100px;
}

.elks-cal-wrapper.preview-screen-landscape {
    max-width: 1200px;
}

.elks-cal-wrapper.preview-screen-portrait {
    max-width: 600px;
}

/* Navigation Buttons (compact toolbar) */
.elks-cal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    background: var(--elks-surface);
    color: var(--elks-text);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-nav-btn:hover {
    background: var(--elks-bg);
    border-color: var(--elks-text-light);
}

.elks-cal-nav-btn svg {
    width: 16px;
    height: 16px;
}

.elks-cal-month-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elks-cal-select {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--elks-text);
    background: var(--elks-surface);
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: border-color var(--elks-transition);
}

.elks-cal-select:hover {
    border-color: var(--elks-text-light);
}

.elks-cal-select:focus {
    outline: none;
    border-color: var(--elks-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ============================================
   Calendar Grid
   ============================================ */
.elks-cal-container {
    flex: 1;
    padding: 24px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.elks-cal-grid {
    background: var(--elks-surface);
    border-radius: var(--elks-radius-lg);
    box-shadow: var(--elks-shadow);
    border: 1px solid var(--elks-border);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.elks-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    overflow: visible;
    flex: 1;
}

.elks-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--elks-primary);
    color: #ffffff;
}

.elks-cal-weekday {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.elks-cal-day {
    min-height: 100px;
    border-right: 1px solid var(--elks-border-light);
    border-bottom: 1px solid var(--elks-border-light);
    padding: 8px;
    cursor: pointer;
    transition: background var(--elks-transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.elks-cal-day:nth-child(7n) {
    border-right: none;
}

.elks-cal-day:hover {
    background: #f8fafc;
}

.elks-cal-day.elks-cal-day-empty {
    background: #fafafa;
    cursor: default;
}

.elks-cal-day.elks-cal-day-empty:hover {
    background: #fafafa;
}

.elks-cal-day-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--elks-text);
    margin-bottom: 6px;
}

.elks-cal-day-empty .elks-cal-day-number {
    color: var(--elks-text-light);
}

.elks-cal-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: visible;
}

.elks-cal-event {
    font-size: 11px;
    padding: 3px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--elks-text);
    border-left: 2px solid var(--elks-text-light);
}

.elks-cal-event-time {
    font-weight: 600;
    color: var(--elks-text-muted);
}

.elks-cal-event.elks-cal-event-recurring {
    background: #f8f8f8;
    border-left-color: #666666;
}

/* Recurring event span bar (B&W friendly) */
.elks-cal-recurring-span {
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    background: #f0f0f0;
    border-top: 1px solid #999999;
    border-bottom: 1px solid #999999;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 10px;
    color: #333333;
    z-index: 4;
}

.elks-cal-recurring-span.span-start {
    left: 4px;
    border-left: 1px solid #999999;
}

.elks-cal-recurring-span.span-end {
    right: 4px;
    border-right: 1px solid #999999;
}

.elks-cal-recurring-span.span-only-label {
    /* First cell in row shows the label */
}

.elks-cal-recurring-span.span-continuation {
    /* Continuation cells are empty */
}

/* Special/Holiday Events */
.elks-cal-event.elks-cal-event-special {
    background: #faf5ff;
    border-left-color: var(--elks-special);
    font-weight: 600;
}

/* Multi-day Event Bar */
.elks-cal-event-bar {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 20px;
    background: var(--elks-accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    border-radius: 4px;
}

/* Spanning bars extend beyond cell using calculated width */
.elks-cal-event-bar.bar-spanning {
    right: auto;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.elks-cal-event-bar.bar-single {
    border-radius: 4px;
    left: 4px;
    right: 4px;
    width: auto;
}

.elks-cal-day-more {
    font-size: 11px;
    color: var(--elks-accent);
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================
   Modal
   ============================================ */
.elks-cal-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.elks-cal-modal.active {
    display: flex;
}

.elks-cal-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
}

.elks-cal-modal-content {
    position: absolute;
    background: var(--elks-surface);
    border-radius: var(--elks-radius-lg);
    box-shadow: var(--elks-shadow-xl);
    width: calc(100% - 40px);
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 200ms ease-out;
}

.elks-cal-modal-content:not(.dragged) {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.elks-cal-modal-large {
    max-width: 640px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.elks-cal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--elks-border);
    cursor: move;
    user-select: none;
}

.elks-cal-modal-header:active {
    cursor: grabbing;
}

.elks-cal-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--elks-text);
    margin: 0;
}

.elks-cal-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--elks-text-muted);
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-modal-close:hover {
    background: var(--elks-bg);
    color: var(--elks-text);
}

.elks-cal-modal-close svg {
    width: 20px;
    height: 20px;
}

.elks-cal-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.elks-cal-modal-description {
    color: var(--elks-text-muted);
    font-size: 14px;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Events List in Modal */
.elks-cal-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.elks-cal-events-list:empty::before {
    content: "No events for this day. Add one below.";
    color: var(--elks-text-light);
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
}

.elks-cal-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
    border: 1px solid var(--elks-border-light);
}

.elks-cal-event-item.event-special {
    background: #faf5ff;
    border-color: #e9d5ff;
}

.elks-cal-event-item.event-multiday {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.elks-cal-event-item-info {
    flex: 1;
    min-width: 0;
}

.elks-cal-event-item-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--elks-text-muted);
}

.elks-cal-event-item-name {
    font-size: 14px;
    color: var(--elks-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elks-cal-event-item-dates {
    font-size: 11px;
    color: var(--elks-text-light);
    margin-top: 2px;
}

.elks-cal-event-item-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 6px;
    border-radius: 4px;
    background: #dcfce7;
    color: #166534;
}

.elks-cal-event-item-badge.badge-special {
    background: #f3e8ff;
    color: #7c3aed;
}

.elks-cal-event-item-badge.badge-multiday {
    background: #dbeafe;
    color: #1d4ed8;
}

.elks-cal-event-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--elks-text-light);
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-event-delete:hover {
    background: #fef2f2;
    color: var(--elks-danger);
}

.elks-cal-event-delete svg {
    width: 16px;
    height: 16px;
}

/* Add Event Form */
.elks-cal-add-event,
.elks-cal-add-recurring {
    padding-top: 20px;
    border-top: 1px solid var(--elks-border);
}

.elks-cal-add-event h3,
.elks-cal-add-recurring h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--elks-text);
    margin: 0 0 16px 0;
}

.elks-cal-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.elks-cal-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.elks-cal-form-group-grow {
    flex: 1;
}

.elks-cal-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--elks-text-muted);
}

.elks-cal-form-group input,
.elks-cal-form-group textarea {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    color: var(--elks-text);
    background: var(--elks-surface);
    transition: border-color var(--elks-transition), box-shadow var(--elks-transition);
    font-family: inherit;
}

.elks-cal-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.elks-cal-form-group input:focus,
.elks-cal-form-group textarea:focus {
    outline: none;
    border-color: var(--elks-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.elks-cal-form-group input::placeholder,
.elks-cal-form-group textarea::placeholder {
    color: var(--elks-text-light);
}

.elks-cal-form-hint {
    font-size: 12px;
    color: var(--elks-text-light);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

/* Color picker */
.elks-cal-form-group input[type="color"] {
    padding: 2px;
    width: 50px;
    height: 38px;
    cursor: pointer;
}

/* Date input */
.elks-cal-form-group input[type="date"] {
    padding: 8px 12px;
}

/* Form section title */
.elks-cal-form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--elks-text);
    margin: 20px 0 12px 0;
    padding-top: 16px;
    border-top: 1px solid var(--elks-border-light);
}

/* Typography row */
.elks-cal-typography-row {
    align-items: flex-end;
}

.elks-cal-typography-row .elks-cal-form-group {
    flex: 1;
}

/* Day Checkboxes */
.elks-cal-days-checkboxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.elks-cal-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.elks-cal-checkbox input {
    display: none;
}

.elks-cal-checkbox span {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--elks-border);
    border-radius: var(--elks-radius);
    color: var(--elks-text-muted);
    background: var(--elks-surface);
    transition: all var(--elks-transition);
}

.elks-cal-checkbox input:checked + span {
    background: var(--elks-primary);
    border-color: var(--elks-primary);
    color: #ffffff;
}

.elks-cal-checkbox:hover span {
    border-color: var(--elks-text-light);
}

/* Day Background Section */
.elks-cal-day-bg-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--elks-border-light);
    margin-bottom: 12px;
}

.elks-cal-form-row-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.elks-cal-form-row-inline label {
    font-size: 13px;
    font-weight: 500;
    color: var(--elks-text);
    white-space: nowrap;
}

.elks-cal-btn-text {
    background: none;
    border: none;
    color: var(--elks-text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
}

.elks-cal-btn-text:hover {
    color: var(--elks-error);
}

/* Recurring List */
.elks-cal-recurring-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.elks-cal-recurring-list:empty::before {
    content: "No recurring events defined.";
    color: var(--elks-text-light);
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
}

.elks-cal-recurring-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--elks-bg);
    border-radius: var(--elks-radius);
    border: 1px solid var(--elks-border-light);
}

.elks-cal-recurring-item-info {
    flex: 1;
    min-width: 0;
}

.elks-cal-recurring-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--elks-text);
}

.elks-cal-recurring-item-details {
    font-size: 12px;
    color: var(--elks-text-muted);
    margin-top: 2px;
}

.elks-cal-recurring-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--elks-success);
    border-radius: var(--elks-radius);
    cursor: pointer;
    transition: all var(--elks-transition);
}

.elks-cal-recurring-toggle:hover {
    background: #f0fdf4;
}

.elks-cal-recurring-toggle.inactive {
    color: var(--elks-text-light);
}

.elks-cal-recurring-toggle.inactive:hover {
    background: var(--elks-bg);
}

.elks-cal-recurring-toggle svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Loading Spinner
   ============================================ */
.elks-cal-loading {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.elks-cal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--elks-border);
    border-top-color: var(--elks-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Footer
   ============================================ */
.elks-cal-footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid var(--elks-border);
    background: var(--elks-surface);
}

.elks-cal-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--elks-text-light);
}

.elks-cal-footer strong {
    color: var(--elks-text-muted);
    font-weight: 600;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .elks-cal-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .elks-cal-header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .elks-cal-project-panel {
        padding: 12px 16px;
    }

    .elks-cal-project-current {
        flex-wrap: wrap;
    }

    .elks-cal-preview-inline {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .elks-cal-nav {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .elks-cal-weekday {
        font-size: 10px;
        padding: 10px 4px;
    }

    .elks-cal-day {
        min-height: 100px;
        padding: 6px;
    }

    .elks-cal-day-number {
        font-size: 13px;
    }

    .elks-cal-event {
        font-size: 9px;
        padding: 2px 4px;
    }

    .elks-cal-container {
        padding: 12px;
    }

    .elks-cal-modal-content {
        max-height: 95vh;
    }

    .elks-cal-form-row {
        flex-direction: column;
    }

    .elks-cal-typography-row {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ============================================
   Form Spacer
   ============================================ */
.elks-cal-form-spacer {
    height: 16px;
}

/* ============================================
   Export Modal Extras
   ============================================ */
.elks-cal-select-full {
    width: 100%;
    padding: 12px 14px;
}

.elks-cal-checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.elks-cal-checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.elks-cal-checkbox-inline span {
    font-size: 14px;
    color: var(--elks-text);
}

.elks-cal-form-group-small {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.elks-cal-form-group-small input {
    width: 60px;
    padding: 8px 10px;
    text-align: center;
}

.elks-cal-input-suffix {
    font-size: 13px;
    color: var(--elks-text-muted);
}

.elks-cal-color-label {
    font-size: 13px;
    color: var(--elks-text-muted);
    margin-left: 8px;
}

/* ============================================
   Print Styles (for debugging)
   ============================================ */
@media print {
    .elks-cal-header,
    .elks-cal-nav,
    .elks-cal-footer,
    .elks-cal-modal,
    .elks-cal-project-panel {
        display: none !important;
    }

    .elks-cal-container {
        padding: 0;
    }

    .elks-cal-grid {
        box-shadow: none;
        border: 1px solid #000;
    }
}
