/* ScheduleMaker Lite - Frontend v0.5.3
   Aesthetic: Refined, authoritative, dignified — regimental club meets modern membership site
   Palette: Deep navy, warm slate, brass gold accent
   Typography: Georgia serif headings, clean system sans for body
*/

/* ── Variables ────────────────────────────────────────────────────────────────── */
:root {
    --scheli-accent:     var(--scheli-navy); /* override with theme colour if needed */
    --scheli-navy:       #1a2744;
    --scheli-navy-mid:   #243158;
    --scheli-slate:      #4a5568;
    --scheli-slate-light:#718096;
    --scheli-gold:       #b8963e;
    --scheli-gold-light: #d4af6a;
    --scheli-cream:      #f8f6f1;
    --scheli-white:      #ffffff;
    --scheli-border:     #ddd8ce;
    --scheli-shadow:     0 2px 16px rgba(26,39,68,0.12);
    --scheli-radius:     6px;
}

.scheli-calendar {
    font-size: 16px;
    color: var(--scheli-navy);
    max-width: 900px;
    margin: 0 auto;
}

/* ── Controls bar ─────────────────────────────────────────────────────────────── */
.scheli-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--scheli-accent);
    flex-wrap: wrap;
    gap: 12px;
}

.scheli-view-toggle {
    display: flex;
    background: var(--scheli-cream);
    border: 1px solid var(--scheli-border);
    border-radius: var(--scheli-radius);
    overflow: hidden;
}

.scheli-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--scheli-slate);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
}

.scheli-view-btn:hover {
    background: var(--scheli-border);
    color: var(--scheli-navy);
}

.scheli-view-btn.active {
    background: var(--scheli-accent);
    color: var(--scheli-white);
}

.scheli-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scheli-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--scheli-accent);
    border-radius: 20px;
    background: transparent;
    color: var(--scheli-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.scheli-nav-btn:hover {
    background: var(--scheli-accent);
    color: var(--scheli-white);
    border-color: var(--scheli-accent);
}

.scheli-nav-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--scheli-navy);
    min-width: 140px;
    text-align: center;
    letter-spacing: 0.01em;
}

/* ── Utility ──────────────────────────────────────────────────────────────────── */
.scheli-hidden { display: none !important; }

.scheli-empty {
    text-align: center;
    color: var(--scheli-slate-light);
    padding: 40px 0;
    font-style: italic;
}

.scheli-login-notice {
    padding: 16px;
    background: var(--scheli-cream);
    border-left: 4px solid var(--scheli-gold);
    border-radius: var(--scheli-radius);
}

/* ── Month group heading ──────────────────────────────────────────────────────── */
.scheli-month-group { margin-bottom: 32px; }

.scheli-month-heading {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--scheli-gold);
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--scheli-border);
}

/* ── List card ────────────────────────────────────────────────────────────────── */
.scheli-list-card {
    display: flex;
    background: var(--scheli-white);
    border: 1px solid var(--scheli-border);
    border-radius: var(--scheli-radius);
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.18s ease;
    box-shadow: 0 1px 4px rgba(26,39,68,0.06);
}

.scheli-list-card:hover {
    border-color: var(--scheli-navy);
    box-shadow: var(--scheli-shadow);
    transform: translateY(-1px);
}

.scheli-card-thumb {
    width: 72px;
    min-height: 72px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.scheli-card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
}

.scheli-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 36px;
    flex-shrink: 0;
}

.scheli-card-day-num {
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    color: var(--scheli-navy);
}

.scheli-card-day-name {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--scheli-slate-light);
    margin-top: 2px;
}

.scheli-card-info {
    flex: 1;
    min-width: 0;
}

.scheli-card-cat {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--scheli-gold);
    font-weight: 600;
    margin-bottom: 3px;
}

.scheli-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--scheli-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheli-card-time {
    font-size: 14px;
    color: var(--scheli-slate-light);
}

.scheli-card-arrow {
    font-size: 22px;
    color: var(--scheli-border);
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.scheli-list-card:hover .scheli-card-arrow {
    color: var(--scheli-gold);
}

/* ── Month grid ───────────────────────────────────────────────────────────────── */
.scheli-month-grid {
    background: var(--scheli-white);
    border: 1px solid var(--scheli-border);
    border-radius: var(--scheli-radius);
    overflow: hidden;
}

.scheli-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--scheli-accent);
}

.scheli-grid-daylabel {
    padding: 10px 0;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.scheli-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--scheli-border);
}

.scheli-grid-cell {
    min-height: 80px;
    padding: 8px 6px 6px;
    border-right: 1px solid var(--scheli-border);
    border-bottom: 1px solid var(--scheli-border);
    vertical-align: top;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.scheli-grid-cell:nth-child(7n) { border-right: none; }

.scheli-grid-empty { background: var(--scheli-cream); }

.scheli-grid-num {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--scheli-slate);
    margin-bottom: 4px;
}

.scheli-today .scheli-grid-num {
    background: var(--scheli-accent);
    color: var(--scheli-white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.scheli-grid-event {
    display: block;
    font-size: 11px;
    background: var(--scheli-accent);
    color: var(--scheli-white);
    border-radius: 3px;
    padding: 2px 5px;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease;
    line-height: 1.4;
    max-width: 100%;
    box-sizing: border-box;
}

.scheli-grid-event:hover {
    background: var(--scheli-gold);
}

/* ── Modal overlay ────────────────────────────────────────────────────────────── */
.scheli-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 39, 68, 0.78);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: scheliFadeIn 0.2s ease;
}

@keyframes scheliFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.scheli-modal {
    background: var(--scheli-white);
    border-radius: 10px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000000;
    box-shadow: 0 20px 60px rgba(26,39,68,0.45);
    animation: scheliSlideUp 0.22s ease;
    /* Ensure no float context bleeds into content */
    overflow-x: hidden;
}

@keyframes scheliSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.scheli-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--scheli-navy);
    font-size: 18px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.scheli-modal-close:hover { background: rgba(26,39,68,0.22); }

.scheli-modal-loading {
    padding: 60px;
    text-align: center;
    color: var(--scheli-slate-light);
}

/* ── Modal hero image ─────────────────────────────────────────────────────────── */
.scheli-modal-hero-wrap {
    position: relative;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    line-height: 0;
}

.scheli-modal-hero {
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 10px 10px 0 0;
}

/* Email button floated bottom-right of hero */
.scheli-share-float {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.92);
    color: var(--scheli-accent);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.scheli-share-float:hover {
    background: var(--scheli-accent);
    color: #fff;
    border-color: var(--scheli-accent);
}

/* No-image fallback header */
.scheli-modal-noimage-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 16px 0;
}

.scheli-share-float--noimage {
    position: static;
    backdrop-filter: none;
    background: transparent;
    border-color: var(--scheli-accent);
    box-shadow: none;
}

/* ── Modal content ────────────────────────────────────────────────────────────── */
.scheli-modal-content {
    padding: 24px 28px 28px;
}

.scheli-modal-cats {
    margin-bottom: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.scheli-cat-badge {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--scheli-gold);
    background: rgba(184,150,62,0.1);
    border: 1px solid rgba(184,150,62,0.3);
    border-radius: 3px;
    padding: 2px 8px;
}

.scheli-modal-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--scheli-navy);
    margin: 0 0 20px;
    line-height: 1.3;
}

.scheli-modal-meta {
    background: var(--scheli-cream);
    border-radius: var(--scheli-radius);
    padding: 16px 18px;
    margin-bottom: 20px;
    border-left: 3px solid var(--scheli-gold);
}

.scheli-modal-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    font-size: 14px;
    color: var(--scheli-navy);
    border-bottom: 1px solid var(--scheli-border);
}

.scheli-modal-meta-row:last-child { border-bottom: none; }

.scheli-modal-meta-row--secondary {
    opacity: 0.85;
}

.scheli-meta-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.scheli-venue-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.scheli-venue-addr {
    display: block;
    font-size: 13px;
    color: var(--scheli-slate-light);
}

.scheli-venue-label {
    display: block;
    font-size: 11px;
    color: var(--scheli-slate-light);
    font-style: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.scheli-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--scheli-accent);
    text-decoration: none;
    margin-top: 3px;
    transition: opacity 0.15s ease;
}

.scheli-directions-link:hover {
    opacity: 0.75;
    text-decoration: none;
}

.scheli-modal-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--scheli-slate);
    background: #fdfcf8;
    border: 1px solid var(--scheli-border);
    border-radius: var(--scheli-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.scheli-modal-desc p { margin: 0 0 14px !important; }
.scheli-modal-desc p:last-child { margin-bottom: 0 !important; }
.scheli-modal-desc br { display: block; margin-bottom: 6px; }

/* ── scheli-link (meeting URL display) ──────────────────────────────────────────── */
.scheli-link {
    color: var(--scheli-accent);
    font-size: 13px;
    word-break: break-all;
}

/* ── Email share modal ────────────────────────────────────────────────────────── */
.scheli-email-modal {
    max-width: 460px;
    padding: 28px;
}

.scheli-email-modal h3 {
    font-size: 20px;
    font-weight: 400;
    color: var(--scheli-navy);
    margin: 0 0 20px;
}

.scheli-email-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.scheli-email-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--scheli-border);
    border-radius: var(--scheli-radius);
    font-size: 14px;
    color: var(--scheli-navy);
}

.scheli-email-input:focus {
    outline: none;
    border-color: var(--scheli-navy);
}

.scheli-email-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--scheli-radius);
    background: transparent;
    border: 1px dashed var(--scheli-border);
    color: var(--scheli-slate);
    cursor: pointer;
    margin-top: 2px;
    align-self: flex-start;
    transition: all 0.15s ease;
}

.scheli-email-add:hover {
    border-color: var(--scheli-navy);
    color: var(--scheli-navy);
}

.scheli-email-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.scheli-btn-primary {
    background: var(--scheli-accent);
    color: var(--scheli-white);
    border: none;
    padding: 10px 24px;
    border-radius: var(--scheli-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.scheli-btn-primary:hover { background: var(--scheli-accent-hover, var(--scheli-navy)); }

.scheli-email-status {
    font-size: 13px;
    color: var(--scheli-slate);
}

.scheli-email-status.success { color: #2d7d46; }
.scheli-email-status.error   { color: #c0392b; }

/* ── Past events in month grid ───────────────────────────────────────────────── */
.scheli-grid-past .scheli-grid-num {
    color: var(--scheli-border);
}

.scheli-grid-event--past {
    background: transparent !important;
    border: 1px solid var(--scheli-border);
    color: var(--scheli-slate-light);
    opacity: 0.65;
}

.scheli-grid-event--past:hover {
    opacity: 1;
    border-color: var(--scheli-accent);
    color: var(--scheli-accent);
}

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .scheli-card-thumb    { width: 56px; }
    .scheli-card-day-num  { font-size: 20px; }
    .scheli-card-title    { font-size: 14px; }
    .scheli-modal-hero    { height: 200px; }
    .scheli-share-float  { bottom: 10px; right: 10px; padding: 6px 12px; font-size: 12px; }
    .scheli-modal-content { padding: 16px 18px 20px; }
    .scheli-modal-title   { font-size: 20px; }
    .scheli-grid-cell     { min-height: 56px; padding: 4px 3px 3px; }
    .scheli-grid-event    { font-size: 10px; padding: 2px 3px; }
}

/* ── Search / filter bar ──────────────────────────────────────────────────────── */
.scheli-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.scheli-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}

.scheli-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--scheli-slate-light);
    pointer-events: none;
}

.scheli-search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--scheli-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--scheli-navy);
    background: var(--scheli-white);
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.scheli-search-input:focus {
    outline: none;
    border-color: var(--scheli-accent);
}

.scheli-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--scheli-accent);
    border-radius: 20px;
    background: var(--scheli-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.scheli-search-btn:hover {
    background: var(--scheli-accent-hover, var(--scheli-navy));
    border-color: var(--scheli-accent-hover, var(--scheli-navy));
}

.scheli-cat-select {
    padding: 8px 12px;
    border: 1px solid var(--scheli-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--scheli-navy);
    background: var(--scheli-white);
    cursor: pointer;
    transition: border-color 0.15s ease;
    flex-shrink: 0;
}

.scheli-cat-select:focus {
    outline: none;
    border-color: var(--scheli-accent);
}

.scheli-search-clear {
    padding: 7px 14px;
    border: 1px solid var(--scheli-border);
    border-radius: 20px;
    background: var(--scheli-white);
    color: var(--scheli-slate);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.scheli-search-clear:hover {
    border-color: var(--scheli-accent);
    color: var(--scheli-accent);
}

.scheli-search-results {
    margin-bottom: 8px;
}

/* ── SVG icon alignment ───────────────────────────────────────────────────────── */
.scheli-type-icon,
.scheli-meta-icon svg,
.scheli-meta-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: var(--scheli-accent);
}

.scheli-card-time .scheli-type-icon {
    margin-right: 3px;
    color: var(--scheli-slate-light);
}


/* ── Lite upgrade notices ─────────────────────────────────────────────────────── */
.scheli-lite-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f6fc;
    border: 1px dashed #72aee6;
    border-radius: 4px;
    font-size: 12px;
    color: #2271b1;
}

.scheli-lite-notice a {
    color: #2271b1;
    font-weight: 600;
}

.scheli-lite-search-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: 20px;
    font-size: 13px;
    color: #2271b1;
    margin-bottom: 16px;
}

.scheli-lite-search-notice a {
    font-weight: 600;
    color: #2271b1;
}

.scheli-view-btn.scheli-lite-pro-btn {
    color: #999;
    font-style: italic;
    cursor: default;
    text-decoration: none;
}

.scheli-share-float--lite {
    background: rgba(255,255,255,0.85);
    color: #999;
    font-size: 11px;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

.scheli-card-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scheli-modal-error { padding: 40px; text-align: center; color: #718096; }
.scheli-is-hidden { display: none; }
.scheli-private-badge {
    display: inline-block;
    margin: 0 0 4px;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid rgba(26,39,68,0.22);
    background: rgba(26,39,68,0.06);
    color: var(--scheli-navy);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.scheli-cat-badge.scheli-private-badge {
    margin: 0;
}