/* ==========================================================================
   CCC Google Calendar – Frontend Styles
   ========================================================================== */

:root {
  --ccc-gc-accent: #1a73e8;
  --ccc-gc-accent-light: #e8f0fe;
  --ccc-gc-text: #202124;
  --ccc-gc-text-muted: #5f6368;
  --ccc-gc-border: #e8eaed;
  --ccc-gc-bg: #f8f9fa;
  --ccc-gc-white: #ffffff;
  --ccc-gc-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ccc-gc-shadow-hover: 0 6px 20px rgba(26, 115, 232, 0.15);
  --ccc-gc-radius: 12px;
  --ccc-gc-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --ccc-gc-transition: 0.25s ease;
}

/* Widget wrapper */
.ccc-gc-widget {
  font-family: var(--ccc-gc-font);
  color: var(--ccc-gc-text);
}

/* Widget Title */
.ccc-gc-widget-title {
  position: relative;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  color: var(--ccc-gc-text);
}

.ccc-gc-widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--ccc-gc-accent);
}

/* Events list */
.ccc-gc-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── LAYOUT: LIST ────────────────────────────────────────────────────────── */
.ccc-gc-layout--list .ccc-gc-event,
.ccc-gc-layout--compact .ccc-gc-event {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--ccc-gc-white);
  border-radius: var(--ccc-gc-radius);
  padding: 16px;
  box-shadow: var(--ccc-gc-shadow);
  border: 1px solid var(--ccc-gc-border);
  transition: box-shadow var(--ccc-gc-transition), transform var(--ccc-gc-transition);
}

.ccc-gc-layout--list .ccc-gc-event:hover,
.ccc-gc-layout--compact .ccc-gc-event:hover {
  box-shadow: var(--ccc-gc-shadow-hover);
  transform: translateY(-2px);
}

/* ── LAYOUT: CARDS ───────────────────────────────────────────────────────── */
.ccc-gc-layout--cards .ccc-gc-events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.ccc-gc-layout--cards .ccc-gc-event {
  display: flex;
  flex-direction: column;
  background: var(--ccc-gc-white);
  border-radius: var(--ccc-gc-radius);
  overflow: hidden;
  box-shadow: var(--ccc-gc-shadow);
  border: 1px solid var(--ccc-gc-border);
  transition: box-shadow var(--ccc-gc-transition), transform var(--ccc-gc-transition);
}

.ccc-gc-layout--cards .ccc-gc-event:hover {
  box-shadow: var(--ccc-gc-shadow-hover);
  transform: translateY(-4px);
}

.ccc-gc-layout--cards .ccc-gc-event-date-badge {
  width: 100%;
  height: 6px;
  border-radius: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.ccc-gc-layout--cards .ccc-gc-date-day,
.ccc-gc-layout--cards .ccc-gc-date-month {
  display: none;
}

.ccc-gc-layout--cards .ccc-gc-event-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── COMPACT ─────────────────────────────────────────────────────────────── */
.ccc-gc-layout--compact .ccc-gc-event {
  padding: 10px 14px;
  border-radius: 8px;
}

.ccc-gc-layout--compact .ccc-gc-event-desc {
  display: none;
}

/* ── DATE BADGE ──────────────────────────────────────────────────────────── */
.ccc-gc-event-date-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: var(--ccc-gc-accent);
  color: #fff;
  line-height: 1;
  text-align: center;
}

.ccc-gc-date-day {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.ccc-gc-date-month {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.9;
  display: block;
}

/* ── EVENT BODY ──────────────────────────────────────────────────────────── */
.ccc-gc-event-body {
  flex: 1;
  min-width: 0;
}

.ccc-gc-event-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ccc-gc-text);
}

.ccc-gc-event-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ccc-gc-transition);
}

.ccc-gc-event-title a:hover {
  color: var(--ccc-gc-accent);
}

/* Meta */
.ccc-gc-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
}

.ccc-gc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--ccc-gc-text-muted);
}

.ccc-gc-meta-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Description */
.ccc-gc-event-desc {
  font-size: 0.875rem;
  color: var(--ccc-gc-text-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link button */
.ccc-gc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--ccc-gc-accent);
  color: var(--ccc-gc-accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ccc-gc-transition), color var(--ccc-gc-transition);
  align-self: flex-start;
}

.ccc-gc-link:hover {
  background: var(--ccc-gc-accent);
  color: #fff;
}

/* ── STATES ──────────────────────────────────────────────────────────────── */
.ccc-gc-empty {
  padding: 24px;
  text-align: center;
  color: var(--ccc-gc-text-muted);
  font-size: 0.9rem;
  border: 2px dashed var(--ccc-gc-border);
  border-radius: var(--ccc-gc-radius);
}

.ccc-gc-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.ccc-gc-notice--warning {
  background: #fff8e1;
  color: #f57c00;
  border: 1px solid #ffe082;
}

.ccc-gc-notice--error {
  background: #fce8e6;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ── LOADING SKELETON ────────────────────────────────────────────────────── */
.ccc-gc-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ccc-gc-skeleton-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--ccc-gc-white);
  border-radius: var(--ccc-gc-radius);
  border: 1px solid var(--ccc-gc-border);
}

.ccc-gc-skeleton-badge,
.ccc-gc-skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: ccc-gc-shimmer 1.5s infinite;
  border-radius: 6px;
}

.ccc-gc-skeleton-badge {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 10px;
}

.ccc-gc-skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.ccc-gc-skeleton-line { height: 14px; }
.ccc-gc-skeleton-line--title { width: 70%; height: 18px; }
.ccc-gc-skeleton-line--short { width: 40%; }

@keyframes ccc-gc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ccc-gc-layout--cards .ccc-gc-events-list {
    grid-template-columns: 1fr;
  }

  .ccc-gc-layout--list .ccc-gc-event {
    flex-direction: column;
  }

  .ccc-gc-event-date-badge {
    width: 100%;
    height: auto;
    flex-direction: row;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
  }

  .ccc-gc-date-day { font-size: 1.2rem; }
  .ccc-gc-date-month { font-size: 0.75rem; }
}
