/* =========================================================
   Viera Community Events Calendar — Public Styles
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --vec-primary:     #1a6b3c;
  --vec-primary-dk:  #145530;
  --vec-accent:      #f0a500;
  --vec-accent-lt:   #fff8e7;
  --vec-bg:          #f7f9f5;
  --vec-white:       #ffffff;
  --vec-border:      #dde8e2;
  --vec-text:        #1e2d26;
  --vec-text-muted:  #5a7566;
  --vec-radius:      10px;
  --vec-shadow:      0 2px 12px rgba(26,107,60,0.10);
  --vec-shadow-lg:   0 8px 36px rgba(26,107,60,0.16);
  --vec-font-head:   'Playfair Display', Georgia, serif;
  --vec-font-body:   'Inter', system-ui, sans-serif;
}

/* ── Wrapper ── */
.vec-calendar-wrap {
  font-family: var(--vec-font-body);
  color: var(--vec-text);
  background: var(--vec-white);
  border: 1px solid var(--vec-border);
  border-radius: var(--vec-radius);
  overflow: hidden;
  box-shadow: var(--vec-shadow);
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Header ── */
.vec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--vec-primary);
  color: #fff;
  gap: 12px;
  flex-wrap: wrap;
}
.vec-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--vec-font-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.vec-logo svg { width: 32px; height: 32px; flex-shrink: 0; }

.vec-header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vec-current-label {
  font-family: var(--vec-font-head);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  min-width: 160px;
  text-align: center;
}
.vec-nav-arrow {
  cursor: pointer;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: background .15s;
  user-select: none;
}
.vec-nav-arrow:hover { background: rgba(255,255,255,0.3); }
.vec-today-btn {
  background: var(--vec-accent);
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
.vec-today-btn:hover { filter: brightness(1.08); }

.vec-view-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 3px;
}
.vec-view-btn {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.vec-view-btn.active, .vec-view-btn:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── Filters ── */
.vec-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--vec-bg);
  border-bottom: 1px solid var(--vec-border);
  flex-wrap: wrap;
}
.vec-search-wrap {
  display: flex;
  align-items: center;
  background: var(--vec-white);
  border: 1px solid var(--vec-border);
  border-radius: 8px;
  padding: 0 10px;
  gap: 6px;
  min-width: 200px;
}
.vec-search-wrap svg { width: 16px; height: 16px; color: var(--vec-text-muted); flex-shrink: 0; }
.vec-search-wrap input {
  border: none;
  outline: none;
  padding: 7px 0;
  font-size: .88rem;
  width: 100%;
  background: transparent;
  font-family: var(--vec-font-body);
}

.vec-category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vec-cat-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--vec-white);
  border: 1px solid var(--vec-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .80rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  color: var(--vec-text-muted);
}
.vec-cat-btn.active, .vec-cat-btn:hover {
  background: var(--vec-primary);
  border-color: var(--vec-primary);
  color: #fff;
}
.vec-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Loading ── */
.vec-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--vec-text-muted);
}
.vec-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--vec-border);
  border-top-color: var(--vec-primary);
  border-radius: 50%;
  animation: vec-spin .7s linear infinite;
  margin-bottom: 12px;
}
@keyframes vec-spin { to { transform: rotate(360deg); } }

/* ── MONTH VIEW ── */
.vec-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.vec-month-day-header {
  padding: 8px 10px;
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--vec-text-muted);
  text-align: center;
  background: var(--vec-bg);
  border-right: 1px solid var(--vec-border);
  border-bottom: 1px solid var(--vec-border);
}
.vec-month-day-header:last-child { border-right: none; }

.vec-month-cell {
  min-height: 110px;
  padding: 6px;
  border-right: 1px solid var(--vec-border);
  border-bottom: 1px solid var(--vec-border);
  vertical-align: top;
  cursor: default;
  transition: background .12s;
}
.vec-month-cell:nth-child(7n) { border-right: none; }
.vec-month-cell:hover { background: #f0f7f3; }
.vec-month-cell.other-month { background: #fbfcfb; }
.vec-month-cell.other-month .vec-cell-num { color: #ccc; }
.vec-month-cell.today { background: var(--vec-accent-lt); }
.vec-cell-num {
  font-size: .82rem;
  font-weight: 600;
  color: var(--vec-text-muted);
  margin-bottom: 4px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.vec-month-cell.today .vec-cell-num {
  background: var(--vec-accent);
  color: #1a1a1a;
}

.vec-event-pill {
  display: block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter .12s;
  background: var(--vec-primary);
}
.vec-event-pill:hover { filter: brightness(1.15); }
.vec-event-more {
  font-size: .70rem;
  color: var(--vec-text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.vec-event-more:hover { color: var(--vec-primary); }

/* ── LIST VIEW (JS-rendered) ── */
.vec-list-day {
  border-bottom: 1px solid var(--vec-border);
}
.vec-list-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--vec-bg);
  font-size: .85rem;
  font-weight: 600;
  color: var(--vec-text-muted);
  border-bottom: 1px solid var(--vec-border);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.vec-list-day-badge {
  background: var(--vec-primary);
  color: #fff;
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.vec-list-day-badge.today { background: var(--vec-accent); color: #1a1a1a; }

.vec-list-event-row {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  align-items: flex-start;
  border-bottom: 1px solid #eef2ee;
  cursor: pointer;
  transition: background .12s;
}
.vec-list-event-row:last-child { border-bottom: none; }
.vec-list-event-row:hover { background: #f4f9f6; }

.vec-list-event-color-bar {
  width: 4px;
  border-radius: 4px;
  min-height: 40px;
  flex-shrink: 0;
  align-self: stretch;
}
.vec-list-event-time {
  font-size: .78rem;
  color: var(--vec-text-muted);
  min-width: 64px;
  padding-top: 2px;
  flex-shrink: 0;
}
.vec-list-event-info { flex: 1; }
.vec-list-event-title {
  font-weight: 600;
  font-size: .95rem;
  margin: 0 0 4px;
  line-height: 1.3;
}
.vec-list-event-venue {
  font-size: .80rem;
  color: var(--vec-text-muted);
}
.vec-list-event-cat {
  display: inline-block;
  font-size: .70rem;
  font-weight: 600;
  border-radius: 3px;
  padding: 1px 6px;
  margin-top: 4px;
}
.vec-list-event-thumb {
  width: 64px; height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── WEEK VIEW ── */
.vec-week-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  font-size: .78rem;
}
.vec-week-day-head {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid var(--vec-border);
  border-bottom: 1px solid var(--vec-border);
  background: var(--vec-bg);
}
.vec-week-day-head.today { background: var(--vec-accent-lt); }
.vec-week-day-head .day-name { text-transform: uppercase; font-size: .68rem; color: var(--vec-text-muted); }
.vec-week-day-head .day-num { font-size: 1.2rem; font-weight: 700; }
.vec-week-day-head.today .day-num {
  background: var(--vec-accent);
  color: #1a1a1a;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.vec-time-gutter {
  border-right: 1px solid var(--vec-border);
  font-size: .68rem;
  color: var(--vec-text-muted);
  text-align: right;
  padding-right: 6px;
  padding-top: 4px;
  background: var(--vec-bg);
  border-bottom: 1px solid #eef2ee;
}
.vec-week-cell {
  border-right: 1px solid var(--vec-border);
  border-bottom: 1px solid #eef2ee;
  min-height: 48px;
  position: relative;
  padding: 2px;
}
.vec-week-cell:nth-child(7n+1) { border-right: none; }
.vec-week-pill {
  display: block;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: .72rem;
  color: #fff;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── STATIC list view (PHP template) ── */
.vec-list-wrap { padding: 0; }
.vec-list-month-header {
  font-family: var(--vec-font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--vec-primary);
  padding: 18px 20px 8px;
  border-bottom: 2px solid var(--vec-border);
}
.vec-list-item {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--vec-border);
  align-items: flex-start;
}
.vec-list-item:hover { background: #f4f9f6; }
.vec-date-badge {
  flex-shrink: 0;
  width: 54px;
  text-align: center;
  background: var(--ev-color, var(--vec-primary));
  color: #fff;
  border-radius: 8px;
  padding: 6px 4px;
}
.vec-date-badge-month { display: block; font-size: .68rem; text-transform: uppercase; opacity: .85; }
.vec-date-badge-day   { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.vec-list-info { flex: 1; }
.vec-list-title { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.vec-list-title a { color: var(--vec-text); text-decoration: none; }
.vec-list-title a:hover { color: var(--vec-primary); }
.vec-list-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.vec-meta-chip {
  font-size: .75rem;
  background: var(--vec-bg);
  color: var(--vec-text-muted);
  border-radius: 20px;
  padding: 2px 10px;
  border: 1px solid var(--vec-border);
}
.vec-list-excerpt { font-size: .85rem; color: var(--vec-text-muted); margin: 0; line-height: 1.5; }
.vec-list-thumb img { width: 100px; height: 80px; object-fit: cover; border-radius: 8px; }
.vec-no-events { padding: 40px; text-align: center; color: var(--vec-text-muted); font-size: .95rem; }

/* ── EVENT MODAL ── */
.vec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: vec-fade-in .2s ease;
}
@keyframes vec-fade-in { from { opacity: 0; } to { opacity: 1; } }
.vec-modal {
  background: var(--vec-white);
  border-radius: 14px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--vec-shadow-lg);
  position: relative;
  animation: vec-slide-up .22s ease;
}
@keyframes vec-slide-up { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
.vec-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(0,0,0,0.08);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.vec-modal-close:hover { background: rgba(0,0,0,0.18); }
.vec-modal-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}
.vec-modal-body { padding: 24px; }
.vec-modal-cat-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
  color: #fff;
}
.vec-modal-title {
  font-family: var(--vec-font-head);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.25;
  color: var(--vec-text);
}
.vec-modal-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: .88rem;
  color: var(--vec-text);
}
.vec-modal-meta-icon { font-size: 1.1rem; flex-shrink: 0; }
.vec-modal-meta-label { font-weight: 600; display: block; font-size: .75rem; color: var(--vec-text-muted); }
.vec-modal-description { margin-top: 14px; border-top: 1px solid var(--vec-border); padding-top: 14px; font-size: .9rem; line-height: 1.6; color: var(--vec-text); }
.vec-modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.vec-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: filter .15s;
}
.vec-btn-primary { background: var(--vec-primary); color: #fff; }
.vec-btn-primary:hover { filter: brightness(1.12); color: #fff; }
.vec-btn-accent { background: var(--vec-accent); color: #1a1a1a; }
.vec-btn-accent:hover { filter: brightness(1.08); }
.vec-btn-outline { background: transparent; border: 1.5px solid var(--vec-border); color: var(--vec-text); }
.vec-btn-outline:hover { border-color: var(--vec-primary); color: var(--vec-primary); }

/* ── Mini Widget ── */
.vec-mini-list { list-style: none; margin: 0; padding: 0; }
.vec-mini-item { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.vec-mini-badge {
  background: var(--vec-primary);
  color: #fff;
  border-radius: 6px;
  width: 42px;
  text-align: center;
  padding: 4px;
  flex-shrink: 0;
}
.vec-mini-badge span { display: block; font-size: .62rem; text-transform: uppercase; }
.vec-mini-badge strong { display: block; font-size: 1.1rem; }
.vec-mini-info a { font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--vec-text); display: block; }
.vec-mini-info a:hover { color: var(--vec-primary); }
.vec-mini-info small { font-size: .75rem; color: var(--vec-text-muted); }
.vec-mini-more { display: inline-block; margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--vec-primary); text-decoration: none; }
.vec-mini-more:hover { text-decoration: underline; }
.vec-mini-empty { color: var(--vec-text-muted); font-size: .88rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .vec-header { padding: 10px 14px; }
  .vec-header-left { order: 1; width: 100%; }
  .vec-header-center { order: 3; width: 100%; justify-content: center; }
  .vec-header-right { order: 2; margin-left: auto; }
  .vec-current-label { min-width: 120px; font-size: 1rem; }
  .vec-month-cell { min-height: 60px; padding: 3px; }
  .vec-month-day-header { padding: 5px 3px; font-size: .65rem; }
  .vec-event-pill { font-size: .65rem; padding: 1px 4px; }
  .vec-filters { padding: 8px 12px; gap: 8px; }
  .vec-modal-body { padding: 16px; }
  .vec-modal-title { font-size: 1.2rem; }
  .vec-list-event-row { padding: 10px 14px; }
}

/* ── Multiple category badges in modal ────────────────── */
.vec-modal-cat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.vec-modal-cat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Multiple category tags in list rows ──────────────── */
.vec-list-event-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

/* ── Buy Tickets button — prominent accent ────────────── */
.vec-btn-tickets {
    background: var(--vec-accent, #f0a500) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 700;
    order: -1; /* Always first in the button row */
}
.vec-btn-tickets:hover {
    background: #d4900a !important;
    color: #fff !important;
}
.vec-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
