/* ============================================
   Board New Item Types - CSS
   Types: Calendar(40), Chart(41), Checklist(42),
          Map(43), File(44), Quote(45),
          Countdown(46), Divider(47)
   ============================================ */

/* ===== SHARED ===== */
.Item_Calendar, .Item_Chart, .Item_Checklist,
.Item_Map, .Item_File, .Item_Quote,
.Item_Countdown, .Item_Divider {
  overflow: hidden;
  border-radius: 8px;
}

/* ===== CALENDAR (40) ===== */
.new-item-calendar-widget {
  height: 100%;
  overflow-y: auto;
}
.calendar-header { user-select: none; }
.cal-nav-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-color, #ccc); font-size: 0.9rem;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.cal-nav-btn:hover { background: rgba(220,20,60,0.15); color: #dc143c; }
.cal-month-label { font-size: 0.95rem; color: var(--text-color, #eee); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 0.65rem; font-weight: 600;
  color: var(--text-muted, #888); margin-bottom: 2px;
}
.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.cal-day {
  text-align: center; font-size: 0.75rem;
  padding: 3px 0; border-radius: 4px; position: relative;
  color: var(--text-color, #ccc); cursor: default;
}
.cal-day.empty { visibility: hidden; }
.cal-day.today {
  background: rgba(220,20,60,0.2); color: #dc143c; font-weight: 700;
}
.cal-day.has-event { font-weight: 600; }
.cal-dot {
  display: block; width: 4px; height: 4px; border-radius: 50%;
  background: #dc143c; margin: 1px auto 0;
}
.cal-event-item {
  padding: 4px 8px; margin-bottom: 3px; border-radius: 4px;
  background: rgba(220,20,60,0.08); font-size: 0.75rem;
}
.cal-event-item small { color: var(--text-muted, #888); margin-right: 6px; }

/* ===== CHART (41) ===== */
.new-item-chart-widget { overflow: hidden; }
.chart-title { font-size: 0.95rem; color: var(--text-color, #eee); }
.chart-svg-container { min-height: 0; }
.chart-svg-pie, .chart-svg-bar { width: 100%; height: auto; }
.chart-legend { font-size: 0.7rem; }
.chart-legend-item {
  display: flex; align-items: center; gap: 4px;
  color: var(--text-muted, #aaa);
}
.chart-legend-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* ===== CHECKLIST (42) ===== */
.new-item-checklist-widget { height: 100%; overflow-y: auto; }
.checklist-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-color, #eee); margin: 0;
}
.checklist-progress { display: flex; align-items: center; gap: 8px; }
.checklist-progress-bar {
  flex-grow: 1; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.1); overflow: hidden;
}
.checklist-progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #dc143c, #ff4066);
  transition: width 0.4s ease;
}
.checklist-progress-text {
  font-size: 0.7rem; color: var(--text-muted, #888); white-space: nowrap;
}
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  transition: background 0.2s; margin-bottom: 2px;
}
.checklist-item:hover { background: rgba(220,20,60,0.06); }
.checklist-checkbox { display: none; }
.checklist-checkmark {
  width: 22px; height: 22px; border-radius: 5px;
  border: 2px solid rgba(220,20,60,0.4); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: transparent;
}
.checklist-item.checked .checklist-checkmark {
  background: #dc143c; border-color: #dc143c; color: #fff;
}
.checklist-checkmark i { font-size: 0.65rem; }
.checklist-text {
  font-size: 0.85rem; color: var(--text-color, #ddd);
  transition: opacity 0.2s;
}
.checklist-item.checked .checklist-text {
  text-decoration: line-through; opacity: 0.5;
}

/* ===== MAP (43) ===== */
.new-item-map-widget { overflow: hidden; border-radius: 8px; }
.map-iframe-container { min-height: 120px; }
.map-info { border-top: 1px solid rgba(255,255,255,0.08); }
.map-title { font-size: 0.9rem; color: var(--text-color, #eee); }
.map-title i { margin-right: 4px; }
.map-desc { font-size: 0.75rem; }

/* ===== FILE (44) ===== */
.new-item-file-widget { border-radius: 8px; }
.file-icon-lg { font-size: 2.5rem; flex-shrink: 0; }
.file-name {
  font-size: 0.95rem; color: var(--text-color, #eee);
  word-break: break-word;
}
.file-meta { display: flex; gap: 8px; align-items: center; }
.file-type-badge {
  background: rgba(220,20,60,0.15); color: #dc143c;
  padding: 1px 6px; border-radius: 3px; font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.5px;
}
.file-download-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #dc143c, #b01030);
  color: #fff; display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.file-download-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(220,20,60,0.4);
  color: #fff;
}

/* ===== QUOTE (45) ===== */
.new-item-quote-widget { overflow: hidden; }

/* Classic style */
.quote-style-classic .quote-text-block { position: relative; text-align: center; }
.quote-style-classic .quote-mark {
  font-size: 3rem; line-height: 1; font-family: Georgia, serif;
  color: #dc143c; opacity: 0.6;
}
.quote-style-classic .quote-mark.open { position: absolute; top: -10px; left: 5px; }
.quote-style-classic .quote-mark.close { position: absolute; bottom: -20px; right: 5px; }
.quote-style-classic .quote-text {
  font-size: 1.05rem; font-style: italic; line-height: 1.5;
  color: var(--text-color, #eee); margin: 0; padding: 0 25px;
}

/* Modern style */
.quote-style-modern {
  border-left: 4px solid #dc143c; padding-left: 16px !important;
}
.quote-style-modern .quote-text {
  font-size: 1rem; line-height: 1.5;
  color: var(--text-color, #eee); margin: 0;
}

/* Card style */
.quote-style-card { text-align: center; }
.quote-author-img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid #dc143c;
}
.quote-style-card .quote-text {
  font-size: 0.95rem; font-style: italic; line-height: 1.5;
  color: var(--text-color, #eee); margin: 0;
}

.quote-attribution {
  font-size: 0.8rem; color: var(--text-muted, #999);
  display: flex; flex-direction: column; align-items: flex-end;
}
.quote-author { font-weight: 600; color: #dc143c; }
.quote-source { font-style: italic; opacity: 0.7; }

/* ===== COUNTDOWN (46) ===== */
.new-item-countdown-widget { overflow: hidden; }
.countdown-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-color, #eee);
}
.countdown-display { align-items: center; }
.countdown-unit { text-align: center; }
.countdown-value {
  display: block; font-size: 2rem; font-weight: 800;
  color: #dc143c; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-label {
  display: block; font-size: 0.6rem; text-transform: uppercase;
  color: var(--text-muted, #888); letter-spacing: 1px; margin-top: 2px;
}
.countdown-sep {
  font-size: 1.5rem; font-weight: 700; color: rgba(220,20,60,0.4);
  margin-top: -8px;
}
.countdown-expired-text {
  font-size: 1.1rem; font-weight: 700;
  color: #dc143c; animation: countdownPulse 2s infinite;
}
@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Flip style */
.countdown-style-flip .countdown-value {
  background: rgba(220,20,60,0.1); border-radius: 6px;
  padding: 6px 10px; font-size: 1.8rem;
  min-width: 50px;
}

/* ===== DIVIDER (47) ===== */
.new-item-divider-widget { width: 100%; }
.divider-line-left, .divider-line-right {
  height: 2px; background: rgba(255,255,255,0.15);
}
.divider-label {
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  color: var(--text-muted, #999); text-transform: uppercase;
  letter-spacing: 1px;
}
.divider-icon {
  font-size: 1.1rem; color: #dc143c;
}

/* Dashed */
.divider-style-dashed .divider-line-left,
.divider-style-dashed .divider-line-right {
  height: 0; border-top: 2px dashed rgba(255,255,255,0.2);
}

/* Gradient */
.divider-style-gradient .divider-line-left {
  background: linear-gradient(90deg, transparent, #dc143c);
}
.divider-style-gradient .divider-line-right {
  background: linear-gradient(90deg, #dc143c, transparent);
}

/* Icon center */
.divider-style-icon-center .divider-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(220,20,60,0.15);
  display: flex; align-items: center; justify-content: center;
}

/* ===== NEW ITEM TYPE TABS IN CREATE MODAL ===== */
.new-item-types-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px; padding-top: 4px;
}
.new-item-types-label {
  font-size: 0.65rem; text-transform: uppercase;
  color: var(--text-muted, #666); letter-spacing: 1px;
  padding: 4px 12px; font-weight: 600;
}
.tab-btn .new-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 0.5rem; background: #dc143c;
  color: #fff; padding: 1px 4px; border-radius: 3px;
  font-weight: 700; line-height: 1.2;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .countdown-value { font-size: 1.4rem; }
  .chart-title { font-size: 0.85rem; }
  .quote-style-classic .quote-text { font-size: 0.9rem; }
  .file-icon-lg { font-size: 2rem; }
  .cal-day { font-size: 0.65rem; padding: 2px 0; }
}


/* ==================== CAROUSEL ITEM (type=48) ==================== */
.Item_Carousel { overflow: hidden; border-radius: 8px; }
.carousel-widget { background: var(--card-bg, #1a1a2e); }
.carousel-item-title { font-size: 0.9rem; color: var(--text-color, #e0e0e0); padding: 6px 10px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carousel-slides-container { border-radius: 0 0 8px 8px; }
.carousel-slides-track { will-change: transform; }
.carousel-slide { position: relative; display: flex; align-items: center; justify-content: center; background: var(--card-bg, #1a1a2e); }
.carousel-slide-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-slide-link { display: block; width: 100%; height: 100%; text-decoration: none; color: inherit; }
.carousel-slide-caption { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff; padding: 20px 12px 8px; font-size: 0.85rem; text-align: center; }
.carousel-slide-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted, #888); gap: 8px; font-size: 0.85rem; }
.carousel-gradient-0 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.carousel-gradient-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: #fff; }
.carousel-gradient-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: #fff; }
.carousel-gradient-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: #fff; }
.carousel-gradient-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: #fff; }
.carousel-control { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; z-index: 2; transition: background 0.2s, opacity 0.2s; opacity: 0.7; }
.carousel-control:hover { background: rgba(220,20,60,0.8); opacity: 1; }
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }
.carousel-indicators-bar { background: var(--card-bg, #1a1a2e); }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted, #555); cursor: pointer; transition: background 0.3s, transform 0.2s; }
.carousel-dot.active { background: var(--accent-color, #dc143c); transform: scale(1.3); }
.carousel-dot:hover { background: var(--accent-color, #dc143c); }
/* Light theme overrides */
[data-theme="light"] .carousel-widget, 
.light-theme .carousel-widget { background: #fff; }
[data-theme="light"] .carousel-item-title, 
.light-theme .carousel-item-title { color: #333; }
[data-theme="light"] .carousel-indicators-bar, 
.light-theme .carousel-indicators-bar { background: #fff; }
[data-theme="light"] .carousel-slide-placeholder, 
.light-theme .carousel-slide-placeholder { color: #999; }

/* Video slides */
.carousel-video-wrapper { width: 100%; height: 100%; position: relative; }
.carousel-video-wrapper iframe { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }

/* Slide counter */
.carousel-counter { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; z-index: 3; pointer-events: none; }

/* Fullscreen button */
.carousel-fullscreen-btn { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; z-index: 3; opacity: 0; transition: opacity 0.3s, background 0.2s; }
.carousel-slides-container:hover .carousel-fullscreen-btn { opacity: 0.8; }
.carousel-fullscreen-btn:hover { background: rgba(220,20,60,0.8); opacity: 1; }

/* Fullscreen mode */
.Item_Carousel:fullscreen { background: #000; border-radius: 0; }
.Item_Carousel:fullscreen .carousel-widget { background: #000; }
.Item_Carousel:fullscreen .carousel-slide-img { object-fit: contain; }
.Item_Carousel:fullscreen .carousel-control { width: 48px; height: 48px; font-size: 20px; }

/* Thumbnail strip */
.carousel-thumbnails { background: var(--card-bg, #1a1a2e); scrollbar-width: thin; }
.carousel-thumb { width: 48px; height: 36px; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; transition: border-color 0.2s, opacity 0.2s; opacity: 0.6; }
.carousel-thumb.active { border-color: var(--accent-color, #dc143c); opacity: 1; }
.carousel-thumb:hover { opacity: 1; }
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--text-muted, #555); color: #fff; font-size: 10px; }

/* Ken Burns effect */
.carousel-ken-burns .ken-burns-slide.carousel-slide-active .carousel-slide-img {
  animation: kenBurnsZoom 12s ease-in-out infinite alternate;
}
@keyframes kenBurnsZoom {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(-2%, -1%); }
}

/* Zoom transition */
.carousel-transition-zoom .carousel-slide { transition: opacity 0.6s ease, transform 0.6s ease; }

/* Flip transition */
.carousel-transition-flip .carousel-slides-track { perspective: 1200px; }
.carousel-transition-flip .carousel-slide { transition: opacity 0.6s ease, transform 0.6s ease; backface-visibility: hidden; }

/* Shadow presets */
.Item_Carousel { --carousel-shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --carousel-shadow-md: 0 4px 12px rgba(0,0,0,0.4); --carousel-shadow-lg: 0 8px 30px rgba(0,0,0,0.5); }

/* Focus outline for keyboard nav */
.carousel-widget:focus { outline: 2px solid var(--accent-color, #dc143c); outline-offset: 2px; }
.carousel-widget:focus:not(:focus-visible) { outline: none; }

/* Arrow visibility on hover */
.carousel-slides-container .carousel-control { opacity: 0; }
.carousel-slides-container:hover .carousel-control { opacity: 0.8; }

/* Light theme additions */
[data-theme="light"] .carousel-thumbnails, .light-theme .carousel-thumbnails { background: #fff; }
[data-theme="light"] .carousel-counter, .light-theme .carousel-counter { background: rgba(0,0,0,0.5); }
[data-theme="light"] .carousel-thumb-placeholder, .light-theme .carousel-thumb-placeholder { background: #ccc; color: #666; }
