/* ============================================================
   EventKalender Pro – Frontend v2
   ============================================================ */

#ek-calendar {
    font-family: var(--ek-font);
    color: var(--ek-text);
    background: var(--ek-bg);
    border-radius: var(--ek-radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ── Toolbar ── */
.ek-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: var(--ek-toolbar);
    color: var(--ek-toolbar-text);
    flex-wrap: wrap;
}
.ek-nav { display: flex; align-items: center; gap: 8px; }

.ek-btn-nav {
    background: rgba(255,255,255,.18);
    border: none;
    color: var(--ek-toolbar-text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.ek-btn-nav:hover { background: rgba(255,255,255,.32); }
.ek-btn-nav svg { display: block; }

.ek-current-label {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    min-width: 170px;
    text-align: center;
    color: var(--ek-toolbar-text);
    white-space: nowrap;
}

.ek-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ek-select {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: var(--ek-toolbar-text);
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--ek-font);
}
.ek-select option { color: #1e293b; background: #fff; }

.ek-view-switcher {
    display: flex;
    background: rgba(255,255,255,.15);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
}
.ek-view-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.8);
    padding: 5px 13px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--ek-font);
    transition: background .12s, color .12s;
}
.ek-view-btn.active, .ek-view-btn:hover { background: rgba(255,255,255,.28); color: var(--ek-toolbar-text); }

.ek-ical-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: var(--ek-toolbar-text);
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.ek-ical-btn:hover { background: rgba(255,255,255,.28); color: var(--ek-toolbar-text); }

.ek-suggest-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.9);
    color: var(--ek-toolbar);
    border: none;
    padding: 5px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--ek-font);
    transition: background .15s;
}
.ek-suggest-toolbar-btn:hover { background: #fff; }

/* ── Content ── */
.ek-content { height: 560px; overflow-y: auto; box-sizing: border-box; width: 100%; }

/* ── Loading ── */
.ek-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; height: 100%; color: #94a3b8;
}
.ek-spinner {
    width: 32px; height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--ek-toolbar);
    border-radius: 50%;
    animation: ek-spin .7s linear infinite;
}
@keyframes ek-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   SPLIT LAYOUT
══════════════════════════════════════ */
.ek-split-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    width: 100%;
    height: 560px;
    overflow: hidden;
    box-sizing: border-box;
}

/* ── Sidebar ── */
.ek-sidebar {
    background: var(--ek-sidebar-bg);
    border-right: 1px solid #e8edf2;
    padding: 16px 14px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}
.ek-sidebar-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #94a3b8;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.ek-sidebar-event {
    padding: 10px 12px;
    border-radius: 9px;
    margin-bottom: 6px;
    background: var(--ek-bg);
    border: 1px solid #e8edf2;
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}
.ek-sidebar-event:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); transform: translateY(-1px); }
.ek-sidebar-event-header { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ek-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.ek-sidebar-date { font-size: 10px; color: #64748b; font-weight: 500; }
.ek-sidebar-event-title { font-size: 12px; font-weight: 700; color: var(--ek-text); line-height: 1.3; margin-bottom: 2px; }
.ek-sidebar-event-loc { font-size: 10px; color: #94a3b8; }
.ek-sidebar-empty { font-size: 13px; color: #94a3b8; text-align: center; padding: 24px 8px; }

/* ── Month Grid ── */
.ek-month-area { padding: 14px; overflow: hidden; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.ek-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}
.ek-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    padding: 4px 0;
}
.ek-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 3px;
    flex: 1; /* fills remaining height inside .ek-month-area */
    overflow: hidden;
}
.ek-day-cell {
    border-radius: 7px;
    background: #fafbfc;
    border: 1px solid #f0f4f8;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 5px;
    transition: background .12s;
    cursor: default;
    min-width: 0;
}
.ek-day-cell:hover { background: #f1f5f9; }
.ek-day-cell.other-month { opacity: .4; }
.ek-day-cell.today { background: #eff6ff; border-color: var(--ek-today); }
.ek-day-cell.today .ek-day-num {
    background: var(--ek-today);
    color: #fff;
    border-radius: 50%;
}
.ek-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ek-text);
    flex-shrink: 0;
    margin-bottom: 2px;
}
.ek-day-events { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
.ek-month-event {
    background: var(--ek-chip);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: none;
    text-align: left;
    width: 100%;
    font-family: var(--ek-font);
    line-height: 1.4;
    transition: opacity .12s;
}
.ek-month-event:hover { opacity: .82; }
.ek-more-events {
    font-size: 10px; color: #64748b; padding: 1px 4px;
    cursor: pointer; background: none; border: none;
    font-family: var(--ek-font); text-align: left;
}
.ek-more-events:hover { color: var(--ek-toolbar); }

/* ══════════════════════════════════════
   LIST VIEW
══════════════════════════════════════ */
.ek-list-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    align-items: stretch;
    box-sizing: border-box;
    width: 100%;
}
.ek-day-view  { padding: 16px; }
.ek-empty     { padding: 48px 20px; }
.ek-list-card {
    background: var(--ek-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--ek-radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .2s, transform .18s;
}
.ek-list-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.11); transform: translateY(-2px); }

.ek-card-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    flex-shrink: 0;
}
.ek-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.ek-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--ek-toolbar) 0%, var(--ek-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}
.ek-card-color-bar { height: 4px; width: 100%; flex-shrink: 0; }
.ek-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ek-card-date { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ek-toolbar); }
.ek-card-title { font-size: 15px; font-weight: 700; color: var(--ek-text); line-height: 1.3; margin: 0; }
.ek-card-excerpt { font-size: 12px; color: #64748b; line-height: 1.55; flex: 1; }
.ek-card-meta { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid #f1f5f9; }
.ek-card-meta-item { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #64748b; }
.ek-card-meta-item svg { flex-shrink: 0; color: var(--ek-toolbar); margin-top: 1px; }
.ek-meta-link { color: var(--ek-toolbar); text-decoration: none; font-weight: 500; }
.ek-meta-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   DAY VIEW
══════════════════════════════════════ */
.ek-day-view { }
.ek-day-view-header { font-size: 20px; font-weight: 700; margin-bottom: 18px; color: var(--ek-text); }
.ek-day-event-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-left: 4px solid var(--ek-toolbar);
    background: #f8fafc;
    border-radius: 0 10px 10px 0;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background .15s;
    align-items: flex-start;
}
.ek-day-event-item:hover { background: #eff6ff; }
.ek-day-event-thumb {
    width: 60px; height: 60px;
    object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.ek-day-event-time { font-size: 12px; font-weight: 700; color: var(--ek-toolbar); min-width: 70px; }
.ek-day-event-info { flex: 1; }
.ek-day-event-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.ek-day-event-loc { font-size: 12px; color: #64748b; }

/* ── Empty ── */
.ek-empty { text-align: center; padding: 48px 20px; color: #94a3b8; }
.ek-empty-icon { font-size: 40px; margin-bottom: 10px; }
.ek-empty h3 { font-size: 17px; color: #64748b; margin: 0 0 6px; }
.ek-empty p { font-size: 13px; margin: 0; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.ek-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.ek-modal.open { display: flex; }
.ek-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    animation: ek-fade-in .2s;
}
.ek-modal-panel {
    position: relative;
    background: var(--ek-bg);
    border-radius: var(--ek-radius);
    max-width: 580px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    animation: ek-slide-up .22s cubic-bezier(.22,.68,0,1.2);
}
@keyframes ek-fade-in  { from { opacity:0; } to { opacity:1; } }
@keyframes ek-slide-up { from { opacity:0; transform:translateY(24px) scale(.97); } to { opacity:1; transform:none; } }

.ek-modal-close {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: rgba(0,0,0,.18); border: none; width: 30px; height: 30px;
    border-radius: 50%; font-size: 18px; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s; font-family: var(--ek-font);
}
.ek-modal-close:hover { background: rgba(0,0,0,.38); }

.ek-modal-hero { position: relative; }
.ek-modal-hero-img {
    width: 100%; height: 210px; object-fit: cover;
    border-radius: var(--ek-radius) var(--ek-radius) 0 0; display: block;
}
.ek-modal-hero-placeholder {
    height: 120px;
    border-radius: var(--ek-radius) var(--ek-radius) 0 0;
}
.ek-modal-content { padding: 20px 22px 24px; }
.ek-modal-title { font-size: 20px; font-weight: 800; margin: 0 0 14px; color: var(--ek-text); line-height: 1.2; }

.ek-modal-meta { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.ek-modal-meta-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: #475569; }
.ek-modal-meta-icon { color: var(--ek-toolbar); flex-shrink: 0; margin-top: 1px; }
.ek-modal-meta-link { color: var(--ek-toolbar); text-decoration: none; font-weight: 500; }
.ek-modal-meta-link:hover { text-decoration: underline; }

.ek-modal-description {
    font-size: 13px; line-height: 1.7; color: #475569;
    padding-top: 14px; border-top: 1px solid #f1f5f9;
    white-space: pre-line;
}
.ek-modal-map { margin-top: 14px; border-radius: 10px; overflow: hidden; height: 190px; }
.ek-modal-map iframe { width: 100%; height: 100%; border: 0; }
.ek-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.ek-btn-primary {
    background: var(--ek-toolbar); color: var(--ek-toolbar-text);
    padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; display: inline-flex;
    align-items: center; gap: 6px; transition: opacity .15s; font-family: var(--ek-font);
}
.ek-btn-primary:hover { opacity: .88; color: var(--ek-toolbar-text); }
.ek-btn-secondary {
    background: #f1f5f9; color: #475569; padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex;
    align-items: center; gap: 6px; border: 1px solid #e2e8f0; transition: background .15s;
}
.ek-btn-secondary:hover { background: #e2e8f0; color: #334155; }

/* ══════════════════════════════════════
   SUGGEST POPUP MODAL
══════════════════════════════════════ */
.ek-suggest-modal {
    position: fixed; inset: 0; z-index: 100000;
    display: none; align-items: center; justify-content: center; padding: 16px;
}
.ek-suggest-modal.open { display: flex; }
.ek-suggest-modal .ek-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.ek-suggest-panel {
    position: relative;
    background: var(--ek-bg);
    border-radius: var(--ek-radius);
    max-width: 680px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    animation: ek-slide-up .22s cubic-bezier(.22,.68,0,1.2);
}
.ek-suggest-header {
    background: var(--ek-toolbar);
    color: var(--ek-toolbar-text);
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: var(--ek-radius) var(--ek-radius) 0 0;
}
.ek-suggest-header h3 { margin: 0; font-size: 16px; }
.ek-suggest-modal .ek-modal-close { position: static; background: rgba(255,255,255,.2); color: #fff; }
.ek-suggest-modal .ek-modal-close:hover { background: rgba(255,255,255,.35); }

.ek-suggest-body { padding: 20px; }

.ek-sf-section { margin-bottom: 16px; }
.ek-sf-section-title {
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .1em; color: #94a3b8;
    margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9;
}
.ek-sf-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ek-sf-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.ek-sf-full { flex: 1 1 100%; }
.ek-sf-field label { font-size: 11px; font-weight: 600; color: #374151; }
.ek-req { color: #ef4444; }
.ek-sf-field input,
.ek-sf-field textarea {
    border: 1px solid #e2e8f0; border-radius: 7px; padding: 8px 10px;
    font-size: 13px; font-family: var(--ek-font); color: #1e293b;
    background: #fafbfc; transition: border-color .15s;
    width: 100%; box-sizing: border-box;
}
.ek-sf-field input:focus, .ek-sf-field textarea:focus {
    outline: none; border-color: var(--ek-toolbar); background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ek-sf-field textarea { resize: vertical; }
.ek-sf-error {
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 7px;
    padding: 10px 14px; color: #dc2626; font-size: 12px; margin-bottom: 12px;
}
.ek-sf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ek-sf-hint { font-size: 11px; color: #94a3b8; }
.ek-sf-privacy { font-size: 10px; color: #94a3b8; margin: 0; }

.ek-suggest-success {
    text-align: center; padding: 40px 24px;
}
.ek-suggest-success-icon { font-size: 44px; margin-bottom: 12px; }
.ek-suggest-success h3 { font-size: 20px; color: #166534; margin: 0 0 8px; }
.ek-suggest-success p { color: #64748b; font-size: 13px; margin: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .ek-split-layout { grid-template-columns: 1fr; grid-template-rows: 160px 1fr; height: 680px; width: 100%; }
    .ek-sidebar { border-right: none; border-bottom: 1px solid #e2e8f0; height: 160px; flex-shrink: 0; overflow-y: auto; }
    .ek-month-area { height: auto; flex: 1; }
    .ek-content { height: 680px; }
}
@media (max-width: 640px) {
    .ek-toolbar { padding: 10px 12px; }
    .ek-toolbar-right { justify-content: center; gap: 6px; }
    .ek-current-label { min-width: unset; font-size: 15px; }
    .ek-day-num { width: 19px; height: 19px; font-size: 10px; }
    .ek-month-event { font-size: 9px; }
    .ek-list-grid { grid-template-columns: 1fr; }
    .ek-content { height: 700px; }
    .ek-split-layout { height: 540px; grid-template-rows: 130px 1fr; }
    .ek-modal-panel { border-radius: 14px 14px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 88vh; max-width: 100%; }
    .ek-modal { align-items: flex-end; padding: 0; }
    .ek-suggest-panel { border-radius: 14px 14px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 92vh; max-width: 100%; }
    .ek-suggest-modal { align-items: flex-end; padding: 0; }
}

/* ── Subscribe Dropdown ── */
.ek-subscribe-wrap { position: relative; }
.ek-subscribe-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.16);
    min-width: 240px;
    z-index: 9999;
    overflow: hidden;
    animation: ek-fade-in .15s ease;
}
.ek-subscribe-dropdown.open { display: block; }
.ek-subscribe-option,
.ek-subscribe-copy {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; text-decoration: none; color: #1e293b;
    border-bottom: 1px solid #f1f5f9; transition: background .12s; cursor: pointer;
}
.ek-subscribe-copy { border-bottom: none; }
.ek-subscribe-option:hover, .ek-subscribe-copy:hover { background: #f8fafc; }
.ek-sub-icon { font-size: 16px; width: 26px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ek-sub-label { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.ek-sub-label strong { font-size: 13px; font-weight: 600; color: #1e293b; }
.ek-sub-label small  { font-size: 11px; color: #94a3b8; }
.ek-copy-btn {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 4px 10px; font-size: 11px; font-weight: 600; color: #475569;
    cursor: pointer; font-family: var(--ek-font); white-space: nowrap;
    transition: background .12s, color .12s; flex-shrink: 0;
}
.ek-copy-btn:hover  { background: #e2e8f0; }
.ek-copy-btn.copied { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* ── Elementor Compatibility ── */
.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-widget-container,
.elementor-shortcode,
.elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}
.elementor-widget-shortcode #ek-calendar,
.elementor-widget-container #ek-calendar,
#ek-calendar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
}
