/* ============================================================
   Smart Events Calendar — Frontend Styles v2
   ============================================================ */

:root {
  --sec-primary:    #6366f1;
  --sec-primary-dk: #4f46e5;
  --sec-purple:     #8b5cf6;
  --sec-surface:    #ffffff;
  --sec-bg:         #f5f6ff;
  --sec-border:     #e5e7f0;
  --sec-text:       #1e293b;
  --sec-muted:      #64748b;
  --sec-shadow-sm:  0 2px 8px rgba(99,102,241,.10);
  --sec-shadow:     0 6px 30px rgba(99,102,241,.14);
  --sec-shadow-lg:  0 20px 60px rgba(0,0,0,.18);
  --sec-radius:     18px;
  --sec-radius-sm:  11px;
  --sec-ease:       cubic-bezier(.4,0,.2,1);
  --sec-spring:     cubic-bezier(.34,1.56,.64,1);
}

.sec-widget *, .sec-full-calendar *, .sec-modal * { box-sizing: border-box; }

/* WIDGET */
.sec-widget {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--sec-bg);
  border-radius: var(--sec-radius);
  padding: 30px 28px 24px;
  max-width: 920px;
  box-shadow: var(--sec-shadow);
  border: 1px solid var(--sec-border);
  -webkit-font-smoothing: antialiased;
}
.sec-widget__header { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-widget__icon { font-size: 26px; flex-shrink: 0; }
.sec-widget__title {
  flex: 1; font-size: 20px !important; font-weight: 800 !important;
  color: var(--sec-text) !important; margin: 0 !important; padding: 0 !important;
  line-height: 1.2 !important; letter-spacing: -.3px;
}

/* CALENDAR BUTTON */
.sec-btn-calendar {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px;
  background: linear-gradient(135deg, var(--sec-primary), var(--sec-purple));
  color: #fff !important; border: none; border-radius: 50px; font-size: 13.5px;
  font-weight: 700; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 4px 18px rgba(99,102,241,.38); white-space: nowrap; font-family: inherit;
}
.sec-btn-calendar:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(99,102,241,.48); }

/* TODAY BADGE */
.sec-today-section { margin-bottom: 24px; }
.sec-today-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff;
  padding: 7px 18px; border-radius: 50px; font-size: 12px; font-weight: 800;
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: .8px;
  box-shadow: 0 4px 16px rgba(244,63,94,.35);
}
.sec-pulse {
  width: 8px; height: 8px; background: #fff; border-radius: 50%; flex-shrink: 0;
  animation: secPulse 1.6s ease-in-out infinite;
}
@keyframes secPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.6)} }

.sec-events-row--today { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* TODAY CARD */
.sec-card--today {
  background: var(--sec-surface); border-radius: var(--sec-radius); overflow: hidden;
  cursor: pointer; box-shadow: var(--sec-shadow-sm);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
  animation: secFadeUp .5s both; position: relative;
  border: 1.5px solid transparent;
  border-left: 5px solid var(--event-color, var(--sec-primary));
}
.sec-card--today:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 16px 44px rgba(0,0,0,.14); border-color: var(--event-color, var(--sec-primary)); }
.sec-card__banner { position: relative; height: 110px; overflow: hidden; }
.sec-card__banner img { width:100%; height:100%; object-fit:cover; transition: transform .45s; }
.sec-card--today:hover .sec-card__banner img { transform: scale(1.07); }
.sec-card__banner-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent); }
.sec-card__body { padding: 14px 16px 16px; }
.sec-card__type-badge { font-size: 10.5px; font-weight: 800; color: var(--event-color, var(--sec-primary)); text-transform: uppercase; letter-spacing: .9px; margin-bottom: 5px; }
.sec-card__title { font-size: 14.5px !important; font-weight: 700 !important; color: var(--sec-text) !important; margin: 0 0 9px !important; line-height: 1.35 !important; }
.sec-card__meta { display: flex; flex-direction: column; gap: 3px; }
.sec-meta-item { font-size: 12px; color: var(--sec-muted); }
.sec-card__arrow { position: absolute; bottom: 14px; right: 14px; font-size: 17px; color: var(--event-color, var(--sec-primary)); opacity: 0; transition: opacity .25s, transform .25s; }
.sec-card--today:hover .sec-card__arrow { opacity: 1; transform: translateX(4px); }

/* UPCOMING LIST */
.sec-upcoming-section { margin-top: 8px; }
.sec-section-label { font-size: 11px; font-weight: 800; color: var(--sec-muted); text-transform: uppercase; letter-spacing: 1.1px; margin-bottom: 10px; }
.sec-events-list { display: flex; flex-direction: column; gap: 8px; }

.sec-list-item {
  display: flex; align-items: stretch; background: var(--sec-surface);
  border-radius: var(--sec-radius-sm); overflow: hidden; cursor: pointer;
  box-shadow: var(--sec-shadow-sm);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, border-color .2s;
  animation: secFadeUp .45s both; border: 1.5px solid var(--sec-border);
}
.sec-list-item:hover { transform: translateX(5px); box-shadow: 0 6px 22px rgba(0,0,0,.1); border-color: var(--event-color, var(--sec-primary)); }
.sec-list-item__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 62px; padding: 10px 0; background: var(--event-color, var(--sec-primary));
  color: #fff; text-align: center; gap: 1px;
}
.sec-date-day   { font-size: 22px; font-weight: 900; line-height: 1; }
.sec-date-month { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; opacity: .85; }
.sec-date-weekday { font-size: 9.5px; opacity: .68; }
.sec-list-item__line { width: 3px; align-self: stretch; opacity: .35; flex-shrink: 0; }
.sec-list-item__info { flex: 1; padding: 11px 14px; }
.sec-list-item__top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.sec-type-pill { font-size: 10.5px; font-weight: 700; padding: 2px 10px; border-radius: 50px; white-space: nowrap; }
.sec-list-time { font-size: 11.5px; color: var(--sec-muted); }
.sec-list-item__title { font-size: 13.5px !important; font-weight: 700 !important; color: var(--sec-text) !important; margin: 0 0 3px !important; line-height: 1.3 !important; }
.sec-list-item__sub { display: flex; gap: 12px; flex-wrap: wrap; }
.sec-list-item__sub span { font-size: 11.5px; color: var(--sec-muted); }
.sec-list-item__arrow { padding: 0 14px; font-size: 22px; color: var(--sec-muted); display: flex; align-items: center; transition: color .2s, transform .2s; flex-shrink: 0; }
.sec-list-item:hover .sec-list-item__arrow { color: var(--event-color, var(--sec-primary)); transform: translateX(3px); }

/* EMPTY STATE */
.sec-empty { text-align: center; padding: 52px 20px; color: var(--sec-muted); }
.sec-empty span { font-size: 52px; display: block; margin-bottom: 14px; }
.sec-empty p { font-size: 15px; }

@keyframes secFadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }

/* MODAL OVERLAY */
.sec-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,15,30,.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 999999; display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none; transition: opacity .28s;
}
.sec-modal-overlay.is-open { opacity: 1; pointer-events: all; }

/* MODAL BOX */
.sec-modal {
  background: var(--sec-surface); border-radius: var(--sec-radius);
  max-width: 620px; width: 100%; max-height: 92vh; overflow-y: auto;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(40px) scale(.95);
  transition: transform .38s cubic-bezier(.34,1.56,.64,1);
  scrollbar-width: thin; scrollbar-color: #dde1f0 transparent;
}
.sec-modal::-webkit-scrollbar { width: 5px; }
.sec-modal::-webkit-scrollbar-thumb { background: #d1d5e8; border-radius: 3px; }
.sec-modal-overlay.is-open .sec-modal { transform: translateY(0) scale(1); }
.sec-modal--calendar { max-width: 860px; }

/* MODAL CLOSE */
.sec-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: rgba(255,255,255,.92); border: none; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.12); color: #374151; line-height: 1; padding: 0;
  transition: background .2s, transform .25s cubic-bezier(.34,1.56,.64,1), color .2s;
}
.sec-modal__close:hover { background: #f43f5e; color: #fff; transform: rotate(90deg) scale(1.1); }

/* LOADING */
.sec-loading { display: flex; align-items: center; justify-content: center; padding: 64px; }
.sec-loading span { width: 38px; height: 38px; border: 3.5px solid var(--sec-border); border-top-color: var(--sec-primary); border-radius: 50%; animation: secSpin .75s linear infinite; }
@keyframes secSpin { to { transform: rotate(360deg); } }

/* EVENT DETAIL */
.sec-detail { color: var(--sec-text); font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; }
.sec-detail__image { position: relative; height: 210px; overflow: hidden; border-radius: var(--sec-radius) var(--sec-radius) 0 0; }
.sec-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.sec-detail__image-overlay { position: absolute; inset: 0; }
.sec-detail__image-badge {
  position: absolute; bottom: 14px; left: 14px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  padding: 5px 14px; border-radius: 50px; font-size: 12.5px; font-weight: 700;
  color: var(--event-color, var(--sec-primary)); box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.sec-detail__body { padding: 26px 28px 28px; }
.sec-detail__top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.sec-detail__type-icon { font-size: 42px; }
.sec-detail__title { font-size: 23px !important; font-weight: 800 !important; color: var(--sec-text) !important; margin: 0 !important; line-height: 1.3 !important; letter-spacing: -.3px; }
.sec-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 50px; font-size: 12.5px; font-weight: 700; width: fit-content; }
.sec-badge--today  { background: #fef2f2; color: #e11d48; }
.sec-badge--soon   { background: #fff7ed; color: #ea580c; }
.sec-badge--week   { background: #f0fdf4; color: #16a34a; }
.sec-badge--future { background: #f0f9ff; color: #0284c7; }
.sec-badge--past   { background: #f8fafc; color: #94a3b8; }
.sec-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.sec-detail__item { display: flex; align-items: flex-start; gap: 10px; background: var(--sec-bg); padding: 13px; border-radius: var(--sec-radius-sm); border: 1px solid var(--sec-border); }
.sec-detail__item-icon { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.sec-detail__item-label { display: block; font-size: 10.5px; font-weight: 800; color: var(--sec-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }
.sec-detail__item-value { display: block; font-size: 13.5px; font-weight: 600; color: var(--sec-text); }
.sec-detail__description { background: var(--sec-bg); border-radius: var(--sec-radius-sm); padding: 16px; margin-bottom: 20px; border: 1px solid var(--sec-border); }
.sec-detail__description h4 { font-size: 13px !important; font-weight: 800 !important; margin: 0 0 9px !important; color: var(--sec-text) !important; }
.sec-detail__desc-text { font-size: 13.5px; line-height: 1.75; color: var(--sec-muted); }
.sec-detail__actions { text-align: center; }
.sec-btn-link { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; color: #fff !important; text-decoration: none !important; border-radius: 50px; font-size: 14.5px; font-weight: 700; transition: transform .25s, box-shadow .25s; box-shadow: 0 4px 18px rgba(0,0,0,.2); }
.sec-btn-link:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.28); }

/* FULL CALENDAR */
.sec-full-calendar {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--sec-surface); border-radius: var(--sec-radius);
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
.sec-inline-calendar .sec-full-calendar { box-shadow: var(--sec-shadow); border: 1px solid var(--sec-border); }
.sec-inline-calendar { max-width: 960px; transition: opacity .25s; }

.sec-cal__header { display: flex; align-items: center; padding: 22px 24px; background: linear-gradient(135deg, var(--sec-primary) 0%, var(--sec-purple) 100%); color: #fff; gap: 12px; }
.sec-cal__title { flex: 1; text-align: center; }
.sec-cal__title h3 { font-size: 20px !important; font-weight: 800 !important; margin: 0 !important; color: #fff !important; letter-spacing: -.2px; }

.sec-cal__nav {
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.3);
  color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
  font-family: inherit; flex-shrink: 0; line-height: 1; padding: 0;
}
.sec-cal__nav:hover { background: rgba(255,255,255,.35); transform: scale(1.12); }
.sec-cal__nav:active { transform: scale(.95); }

.sec-cal__grid-header { display: grid; grid-template-columns: repeat(7, 1fr); background: #f1f4ff; border-bottom: 1.5px solid var(--sec-border); }
.sec-cal__dow { text-align: center; padding: 11px 4px; font-size: 11px; font-weight: 800; color: var(--sec-muted); text-transform: uppercase; letter-spacing: .7px; }
.sec-cal__dow:first-child, .sec-cal__dow:last-child { color: var(--sec-primary); }

.sec-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--sec-border); }
.sec-cal__cell { background: var(--sec-surface); min-height: 88px; padding: 8px 6px; position: relative; transition: background .18s; }
.sec-cal__cell--empty { background: #fafbff; }
.sec-cal__cell--past { background: #fafafa; }
.sec-cal__cell--past .sec-cal__day-num { color: #c8cdd8; }
.sec-cal__cell--today { background: linear-gradient(145deg, #f0f1ff, #faf0ff); }
.sec-cal__cell--today .sec-cal__day-num { background: var(--sec-primary); color: #fff !important; width: 27px; height: 27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 2px 8px rgba(99,102,241,.4); }
.sec-cal__cell--has-events { cursor: pointer; }
.sec-cal__cell--has-events:hover { background: #f5f6ff; }
.sec-cal__day-num { font-size: 12.5px; font-weight: 700; color: var(--sec-text); margin-bottom: 5px; display: block; }
.sec-cal__events-dots { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.sec-cal__ev-pill { display: block; font-size: 10px; font-weight: 600; color: #fff; padding: 2.5px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; max-width: 100%; transition: opacity .15s, transform .15s; line-height: 1.4; }
.sec-cal__ev-pill:hover { opacity: .82; transform: scale(1.02); }
.sec-cal__more { font-size: 10px; font-weight: 700; color: var(--sec-muted); padding: 1px 4px; cursor: pointer; }
.sec-cal__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 20px; background: #f8f9ff; border-top: 1px solid var(--sec-border); }
.sec-cal__legend span { font-size: 11.5px; color: var(--sec-muted); }

/* RESPONSIVE */
@media (max-width: 680px) {
  .sec-widget { padding: 16px; }
  .sec-events-row--today { grid-template-columns: 1fr; }
  .sec-detail__grid { grid-template-columns: 1fr; }
  .sec-cal__cell { min-height: 56px; padding: 5px 3px; }
  .sec-cal__ev-pill { display: none; }
  .sec-cal__cell--has-events::after { content: ''; display: block; width: 6px; height: 6px; background: var(--sec-primary); border-radius: 50%; margin: 4px auto 0; }
  .sec-cal__header { padding: 16px; }
  .sec-cal__title h3 { font-size: 16px !important; }
  .sec-cal__nav { width: 36px; height: 36px; font-size: 18px; }
}
