/* ==================== FLOATING CARDS WIDGET ==================== */

/* ============================================
   CSS VARIABLES - Light Theme (Default)
   ============================================ */
.fc-widget {
  --fc-bg: #ffffff;
  --fc-bg-glass: rgba(255, 255, 255, 0.95);
  --fc-surface: #f8fafc;
  --fc-border: rgba(0, 0, 0, 0.06);
  --fc-text: #1e293b;
  --fc-text-secondary: #475569;
  --fc-text-muted: #64748b;
  --fc-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 20px rgba(0, 0, 0, 0.06);
  --fc-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  
  /* Icon background colors */
  --fc-yellow-bg: rgba(251, 191, 36, 0.15);
  --fc-yellow-text: #b45309;
  --fc-red-bg: rgba(239, 68, 68, 0.15);
  --fc-red-text: #dc2626;
  --fc-green-bg: rgba(34, 197, 94, 0.15);
  --fc-green-text: #16a34a;
  --fc-cyan-bg: rgba(6, 182, 212, 0.15);
  --fc-cyan-text: #0891b2;
  --fc-purple-bg: rgba(139, 92, 246, 0.15);
  --fc-purple-text: #7c3aed;
  --fc-pink-bg: rgba(236, 72, 153, 0.15);
  --fc-pink-text: #db2777;
  --fc-orange-bg: rgba(249, 115, 22, 0.15);
  --fc-orange-text: #c2410c;
  --fc-blue-bg: rgba(59, 130, 246, 0.15);
  --fc-blue-text: #2563eb;
  --fc-teal-bg: rgba(20, 184, 166, 0.15);
  --fc-teal-text: #0d9488;
  --fc-indigo-bg: rgba(99, 102, 241, 0.15);
  --fc-indigo-text: #4f46e5;
  --fc-gray-bg: rgba(100, 116, 139, 0.15);
  --fc-gray-text: #475569;
  --fc-rose-bg: rgba(244, 63, 94, 0.15);
  --fc-rose-text: #e11d48;
}

/* ============================================
   WIDGET CONTAINER
   ============================================ */
.fc-widget {
  /* Sizing defaults (can be overridden via config) */
  --fc-card-width: 170px;
  --fc-card-height: auto;
  --fc-card-padding: 10px 14px;
  --fc-card-spacing: 68px;
  --fc-icon-size: 36px;
  --fc-title-size: 13px;
  --fc-subtitle-size: 11px;
  --fc-container-height: 440px;
  
  position: relative;
  width: 100%;
  height: var(--fc-container-height);
}

/* ============================================
   CARDS - Light Theme Default (Solid)
   ============================================ */
.fc-card {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--fc-card-padding);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  max-width: var(--fc-card-width);
  height: var(--fc-card-height);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.fc-card:hover {
  transform: translateY(-5px);
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 50 !important;
}

/* Card links - remove default anchor styling */
a.fc-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.fc-card .fc-icon {
  width: var(--fc-icon-size);
  height: var(--fc-icon-size);
  min-width: var(--fc-icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: calc(var(--fc-icon-size) * 0.44);
}

.fc-card .fc-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 2px;
}

.fc-card .fc-title {
  font-size: var(--fc-title-size);
  font-weight: 600;
  color: var(--fc-text);
  line-height: 1.25;
}

.fc-card .fc-sub {
  font-size: var(--fc-subtitle-size);
  font-weight: 400;
  color: var(--fc-text-muted);
  line-height: 1.35;
}

/* ============================================
   ICON COLOR CLASSES
   ============================================ */
.fc-yellow { background: var(--fc-yellow-bg); color: var(--fc-yellow-text); }
.fc-red { background: var(--fc-red-bg); color: var(--fc-red-text); }
.fc-green { background: var(--fc-green-bg); color: var(--fc-green-text); }
.fc-cyan { background: var(--fc-cyan-bg); color: var(--fc-cyan-text); }
.fc-purple { background: var(--fc-purple-bg); color: var(--fc-purple-text); }
.fc-pink { background: var(--fc-pink-bg); color: var(--fc-pink-text); }
.fc-orange { background: var(--fc-orange-bg); color: var(--fc-orange-text); }
.fc-blue { background: var(--fc-blue-bg); color: var(--fc-blue-text); }
.fc-teal { background: var(--fc-teal-bg); color: var(--fc-teal-text); }
.fc-indigo { background: var(--fc-indigo-bg); color: var(--fc-indigo-text); }
.fc-gray { background: var(--fc-gray-bg); color: var(--fc-gray-text); }
.fc-rose { background: var(--fc-rose-bg); color: var(--fc-rose-text); }

/* ============================================
   CARD POSITIONING - Left Column (6 cards)
   Uses --fc-card-spacing for vertical distance
   ============================================ */
.fc-card:nth-child(1) { top: 0; left: 140px; z-index: 10; animation: fcFloat 6s ease-in-out infinite; }
.fc-card:nth-child(2) { top: calc(var(--fc-card-spacing) * 1); left: 160px; z-index: 9; animation: fcFloat 7s ease-in-out infinite 0.3s; }
.fc-card:nth-child(3) { top: calc(var(--fc-card-spacing) * 2); left: 135px; z-index: 8; animation: fcFloat 5.5s ease-in-out infinite 0.6s; }
.fc-card:nth-child(4) { top: calc(var(--fc-card-spacing) * 3); left: 155px; z-index: 7; animation: fcFloat 6.5s ease-in-out infinite 0.9s; }
.fc-card:nth-child(5) { top: calc(var(--fc-card-spacing) * 4); left: 130px; z-index: 6; animation: fcFloat 5.8s ease-in-out infinite 1.2s; }
.fc-card:nth-child(6) { top: calc(var(--fc-card-spacing) * 5); left: 150px; z-index: 5; animation: fcFloat 6s ease-in-out infinite 1.5s; }

/* Right Column (6 cards) */
.fc-card:nth-child(7) { top: 5px; right: 140px; z-index: 10; animation: fcFloat 5s ease-in-out infinite 0.15s; }
.fc-card:nth-child(8) { top: calc(var(--fc-card-spacing) * 1 + 5px); right: 160px; z-index: 9; animation: fcFloat 6.2s ease-in-out infinite 0.45s; }
.fc-card:nth-child(9) { top: calc(var(--fc-card-spacing) * 2 + 5px); right: 135px; z-index: 8; animation: fcFloat 5.8s ease-in-out infinite 0.75s; }
.fc-card:nth-child(10) { top: calc(var(--fc-card-spacing) * 3 + 5px); right: 155px; z-index: 7; animation: fcFloat 6.8s ease-in-out infinite 1.05s; }
.fc-card:nth-child(11) { top: calc(var(--fc-card-spacing) * 4 + 5px); right: 130px; z-index: 6; animation: fcFloat 5.5s ease-in-out infinite 1.35s; }
.fc-card:nth-child(12) { top: calc(var(--fc-card-spacing) * 5 + 5px); right: 145px; z-index: 5; animation: fcFloat 5.7s ease-in-out infinite 1.65s; }

/* ============================================
   ANIMATION
   ============================================ */
@keyframes fcFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.fc-theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 10px;
  color: var(--fc-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.fc-theme-toggle:hover {
  background: var(--fc-surface);
  color: var(--fc-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Icon visibility */
.fc-theme-toggle .fc-icon-dark { display: none; }
.fc-theme-toggle .fc-icon-light { display: block; }

/* ============================================
   RESPONSIVE - Large screens
   Only apply default responsive sizing if no custom sizing is set
   ============================================ */
@media (max-width: 1199px) {
  .fc-widget:not(.fc-custom-size) { 
    --fc-card-width: 145px;
    --fc-card-padding: 8px 10px;
    --fc-icon-size: 30px;
    --fc-title-size: 11px;
    --fc-subtitle-size: 9px;
    --fc-container-height: 420px;
  }
  .fc-card:nth-child(1) { left: 90px; }
  .fc-card:nth-child(2) { left: 105px; }
  .fc-card:nth-child(3) { left: 85px; }
  .fc-card:nth-child(4) { left: 100px; }
  .fc-card:nth-child(5) { left: 80px; }
  .fc-card:nth-child(6) { left: 95px; }
  .fc-card:nth-child(7) { right: 90px; }
  .fc-card:nth-child(8) { right: 105px; }
  .fc-card:nth-child(9) { right: 85px; }
  .fc-card:nth-child(10) { right: 100px; }
  .fc-card:nth-child(11) { right: 80px; }
  .fc-card:nth-child(12) { right: 95px; }
}

/* ============================================
   RESPONSIVE - Tablet / Mobile
   ============================================ */
@media (max-width: 991px) {
  .fc-widget {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .fc-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    max-width: 100%;
    animation: none !important;
  }
  .fc-card:hover { transform: translateY(-3px); }
  .fc-theme-toggle {
    position: relative;
    grid-column: span 2;
    width: 100%;
    height: auto;
    padding: 8px;
    justify-content: center;
    gap: 8px;
  }
  .fc-theme-toggle::after {
    content: 'Toggle theme';
    font-size: 12px;
    color: var(--fc-text-muted);
  }
}

@media (max-width: 575px) {
  .fc-widget { grid-template-columns: 1fr; }
  .fc-theme-toggle { grid-column: span 1; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .fc-card { animation: none !important; }
}

/* ============================================
   DARK THEME - Variables
   ============================================ */
.fc-widget[data-theme="dark"] {
  --fc-text: #f1f5f9;
  --fc-text-secondary: #cbd5e1;
  --fc-text-muted: #94a3b8;
  
  /* Brighter icon backgrounds for dark mode */
  --fc-yellow-bg: rgba(251, 191, 36, 0.2);
  --fc-yellow-text: #fbbf24;
  --fc-red-bg: rgba(239, 68, 68, 0.2);
  --fc-red-text: #f87171;
  --fc-green-bg: rgba(34, 197, 94, 0.2);
  --fc-green-text: #4ade80;
  --fc-cyan-bg: rgba(6, 182, 212, 0.2);
  --fc-cyan-text: #22d3ee;
  --fc-purple-bg: rgba(139, 92, 246, 0.2);
  --fc-purple-text: #a78bfa;
  --fc-pink-bg: rgba(236, 72, 153, 0.2);
  --fc-pink-text: #f472b6;
  --fc-orange-bg: rgba(249, 115, 22, 0.2);
  --fc-orange-text: #fb923c;
  --fc-blue-bg: rgba(59, 130, 246, 0.2);
  --fc-blue-text: #60a5fa;
  --fc-teal-bg: rgba(20, 184, 166, 0.2);
  --fc-teal-text: #2dd4bf;
  --fc-indigo-bg: rgba(99, 102, 241, 0.2);
  --fc-indigo-text: #818cf8;
  --fc-gray-bg: rgba(148, 163, 184, 0.15);
  --fc-gray-text: #cbd5e1;
  --fc-rose-bg: rgba(244, 63, 94, 0.2);
  --fc-rose-text: #fb7185;
}

/* ============================================
   DARK THEME - Glassmorphism Card Styles
   ============================================ */
.fc-widget[data-theme="dark"] .fc-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  ) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.fc-widget[data-theme="dark"] .fc-card:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.08) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.fc-widget[data-theme="dark"] .fc-card .fc-icon {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fc-widget[data-theme="dark"] .fc-theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.15);
}

.fc-widget[data-theme="dark"] .fc-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.fc-widget[data-theme="dark"] .fc-theme-toggle .fc-icon-dark { display: block; }
.fc-widget[data-theme="dark"] .fc-theme-toggle .fc-icon-light { display: none; }
