/**
 * Visitor Counter Widget Styles
 * Module: tvdelm_visitor_counter
 * File: tvdelm-visitor-counter.css
 */

/* ==========================================================================
   1. Main Container & Variants
   ========================================================================== */

.tvd-visitor-counter {
  width: 100%;
  max-width: 280px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 20px;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #edf2f7;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tvd-visitor-counter *,
.tvd-visitor-counter *::before,
.tvd-visitor-counter *::after {
  box-sizing: border-box;
}

/* Light variant (default) */
.tvd-visitor-counter.light {
  background-color: #ffffff;
  color: #2c3e50;
  border: 1px solid #edf2f7;
}

/* Dark variant */
.tvd-visitor-counter.dark {
  background-color: #121927;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   2. Title Styling
   ========================================================================== */

.tvd-vc-title {
  margin: 0 0 16px 0;
  font-size: 1.35em;
  font-weight: 800;
  color: #009ca6;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.3;
  position: relative;
  padding-bottom: 8px;
}

.tvd-vc-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: #f59e0b;
  border-radius: 2px;
}

.tvd-visitor-counter.dark .tvd-vc-title {
  color: #38bdf8;
}

/* ==========================================================================
   3. Total Box Display & Pulse Animation
   ========================================================================== */

.tvd-vc-total-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #182335;
  background: linear-gradient(145deg, #1e2c42 0%, #152030 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tvd-vc-total-box:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Green Pulsing Dot */
.tvd-vc-dot {
  width: 8px;
  height: 8px;
  background-color: #00e676;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(0, 230, 118, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
  }
}

/* Large Cyan/Teal Total Number */
.tvd-vc-total-number {
  color: #38bdf8;
  font-size: 2.2em;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   4. Stats List & Items
   ========================================================================== */

.tvd-vc-stats {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tvd-vc-stats li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  color: #2c7a7b;
  font-size: 0.95em;
  transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.tvd-vc-stats li:hover {
  background-color: rgba(44, 122, 123, 0.04);
  padding-left: 4px;
}

.tvd-vc-stats li:last-child {
  border-bottom: none;
}

.tvd-vc-label {
  flex: 1 1 auto;
  color: #2c7a7b;
  font-weight: 500;
}

.tvd-vc-value {
  margin-left: auto;
  font-weight: 700;
  color: #2c3e50;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Dark mode adjustments for stats list */
.tvd-visitor-counter.dark .tvd-vc-stats li {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #4fd1c5;
}

.tvd-visitor-counter.dark .tvd-vc-stats li:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.tvd-visitor-counter.dark .tvd-vc-label {
  color: #81e6d9;
}

.tvd-visitor-counter.dark .tvd-vc-value {
  color: #f8fafc;
}

/* ==========================================================================
   5. Icons (Inline SVG Backgrounds)
   ========================================================================== */

.tvd-vc-icon {
  width: 28px;
  height: 28px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.tvd-vc-stats li:hover .tvd-vc-icon {
  transform: scale(1.1);
}

.tvd-visitor-counter.dark .tvd-vc-icon {
  filter: brightness(1.3) saturate(1.1);
}

/* Today: Person icon (Teal #2c7a7b) */
.tvd-vc-icon-today {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

/* Yesterday: Person icon (Slightly different teal shade #319795) */
.tvd-vc-icon-yesterday {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23319795'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

/* Month: Calendar/document icon (Teal #2c7a7b) */
.tvd-vc-icon-month {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2zm-7 5h5v5h-5z'/%3E%3C/svg%3E");
}

/* Year: Calendar/document icon (Teal #2c7a7b) */
.tvd-vc-icon-year {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z'/%3E%3C/svg%3E");
}

/* Total: Group/people icon (Teal #2c7a7b) */
.tvd-vc-icon-total {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

/* Hits Today: Chart/bar icon (Teal #2c7a7b) */
.tvd-vc-icon-hits-today {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M4 9h4v11H4zm6-5h4v16h-4zm6 8h4v8h-4z'/%3E%3C/svg%3E");
}

/* Hits Total: Chart/bar icon (Teal #2c7a7b) */
.tvd-vc-icon-hits-total {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c7a7b'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z'/%3E%3C/svg%3E");
}

/* Online: Person with green status dot (Teal #2c7a7b + #00e676) */
.tvd-vc-icon-online {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232c7a7b' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3Ccircle cx='18' cy='6' r='3.5' fill='%2300e676' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* ==========================================================================
   6. Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
  .tvd-visitor-counter {
    max-width: 100%;
  }
}
