/* ==========================================================================
   MU ONLINE PREMIUM GLOBAL EVENT TIMER WIDGET - CSS SYSTEM
   Design: Dark Fantasy / Glassmorphism / Neon Border / High Fidelity Gaming
   Version: 1.1.0 (Production Ready - Premium Graphics)
   ========================================================================== */

:root {
  --met-bg-gradient: linear-gradient(135deg, rgba(var(--theme-primary-darker-rgb, 10, 0, 7), 0.96) 0%, rgba(var(--theme-primary-dark-rgb, 20, 0, 15), 0.99) 100%);
  --met-card-border: 1px solid rgba(255, 255, 255, 0.08);
  --met-neon-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.85), 0 0 15px rgba(var(--theme-primary-rgb), 0.15);
  --met-glow-active: 0 0 25px rgba(43, 175, 74, 0.55);
  --met-glow-warning: 0 0 25px rgba(252, 196, 25, 0.55);
  --met-font-family: 'Montserrat', 'Roboto', sans-serif;
  --met-color-success: #2baf4a;
  --met-color-warning: #fcc419;
  --met-color-danger: #e03131;
}

/* Base Widget Container */
#mu-event-timer-widget {
  position: fixed;
  bottom: 160px;
  right: 24px;
  width: 350px;
  max-width: calc(100vw - 48px);
  z-index: 99990;
  font-family: var(--met-font-family);
  color: #f8f9fa;
  user-select: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(0);
  opacity: 1;
}

/* Animations on Entrance */
#mu-event-timer-widget.met-showing {
  animation: metFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes metFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Glassmorphism Panel style */
.met-glass-panel {
  background: var(--met-bg-gradient);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--met-card-border);
  border-radius: 16px;
  box-shadow: var(--met-neon-shadow);
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Top dynamic border glow */
.met-glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ColorTemplate, var(--theme-primary)), var(--ColorSecondary, #c0c0c0), transparent);
  z-index: 5;
}

/* Header Section */
.met-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
}

.met-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ColorSecondary, #c0c0c0);
  text-shadow: 0 0 8px rgba(192, 192, 192, 0.3);
}

.met-title i {
  font-size: 12px;
  animation: metSpin 8s linear infinite;
}

@keyframes metSpin {
  100% { transform: rotate(360deg); }
}

.met-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.met-btn-ctrl {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.met-btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.met-btn-ctrl.met-btn-close:hover {
  background: rgba(224, 49, 49, 0.2);
  color: #ff8787;
  border-color: rgba(224, 49, 49, 0.4);
}

/* Main Featured Event Panel */
.met-featured {
  background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.05) 0%, rgba(0, 0, 0, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.met-featured.met-has-banner {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.met-featured-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #050505;
  z-index: 1;
  display: none;
}

.met-featured.met-has-banner .met-featured-overlay {
  display: block;
}

.met-featured-content {
  position: relative;
  z-index: 2;
  padding: 18px;
}

.met-feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: var(--ColorTemplate, var(--theme-primary));
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(var(--theme-primary-rgb), 0.4);
}

.met-feat-layout {
  display: flex;
  align-items: center;
  gap: 16px;
}

.met-feat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ColorSecondary, #c0c0c0);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  position: relative;
}

/* Glowing dot in icon */
.met-feat-icon-wrap::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--met-color-success);
  display: none;
}

.met-feat-info {
  flex: 1;
}

.met-feat-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  line-height: 1.2;
}

.met-feat-schedule {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  margin-bottom: 6px;
}

.met-feat-schedule span {
  color: var(--ColorSecondary, #c0c0c0);
}

.met-feat-desc {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin-top: 10px;
  font-style: italic;
  font-weight: 500;
}

/* Big Countdown Display */
.met-countdown {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.met-time-val {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  font-family: 'Roboto', monospace;
  letter-spacing: -0.5px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.met-time-unit {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-right: 6px;
}

/* Visual Progress Bar */
.met-progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
  position: relative;
}

.met-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ColorTemplate, var(--theme-primary)), var(--ColorSecondary, #c0c0c0));
  border-radius: 2px;
  transition: width 1s linear;
}

/* Premium Dynamic Category Tabs */
.met-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.met-tabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.met-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: uppercase;
}

.met-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.met-tab-btn.active {
  background: rgba(192, 192, 192, 0.1);
  border-color: var(--ColorSecondary, #c0c0c0);
  color: var(--ColorSecondary, #c0c0c0);
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.15);
  text-shadow: 0 0 5px rgba(192, 192, 192, 0.2);
}

/* Events List Section */
.met-list-section {
  padding: 10px 18px 14px;
  max-height: 200px;
  min-height: 80px;
  overflow-y: auto;
}

/* Scrollbar styling */
.met-list-section::-webkit-scrollbar {
  width: 4px;
}
.met-list-section::-webkit-scrollbar-track {
  background: transparent;
}
.met-list-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.met-list-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.met-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.met-row:last-child {
  border-bottom: none;
}

.met-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.met-row-icon {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  width: 18px;
  text-align: center;
  transition: color 0.2s;
}

.met-row-name {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.met-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.met-row-schedule {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'Roboto', monospace;
}

.met-row-timer {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Roboto', monospace;
  min-width: 65px;
  text-align: right;
}

/* Empty State */
.met-empty-list {
  padding: 24px 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-style: italic;
}

/* Row Hover state */
.met-row:hover {
  background: rgba(255, 255, 255, 0.01);
  padding-left: 4px;
  padding-right: 4px;
}
.met-row:hover .met-row-icon {
  color: var(--ColorSecondary, #c0c0c0);
}
.met-row:hover .met-row-name {
  color: #fff;
}

/* Footer Section with Times and Toggles */
.met-footer {
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.met-clocks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.met-clock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
}

.met-clock-row i {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.25);
}

.met-clock-row span.met-clock-lbl {
  width: 65px;
}

.met-clock-row span.met-clock-val {
  font-family: 'Roboto', monospace;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.met-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.met-btn-toggle {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.met-btn-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.met-btn-toggle.active {
  color: var(--ColorSecondary, #c0c0c0);
  border-color: rgba(192, 192, 192, 0.25);
  background: rgba(192, 192, 192, 0.05);
}

/* WARNING / CRITICAL STATE (< 5 Minutes) */
#mu-event-timer-widget.met-warning .met-glass-panel {
  border-color: rgba(192, 192, 192, 0.4);
  box-shadow: var(--met-neon-shadow), var(--met-glow-warning);
}

#mu-event-timer-widget.met-warning .met-feat-badge {
  background: var(--met-color-warning);
  color: #000;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(252, 196, 25, 0.4);
  animation: metFlash 1s ease infinite alternate;
}

#mu-event-timer-widget.met-warning .met-time-val {
  color: var(--met-color-warning);
  text-shadow: 0 0 12px rgba(252, 196, 25, 0.5);
  animation: metPulseScale 1s infinite alternate;
}

#mu-event-timer-widget.met-warning .met-progress-bar {
  background: linear-gradient(90deg, #fd7e14, #fcc419);
}

/* ACTIVE STATE (Event is live!) */
#mu-event-timer-widget.met-active .met-glass-panel {
  border-color: rgba(43, 175, 74, 0.5);
  box-shadow: var(--met-neon-shadow), var(--met-glow-active);
}

#mu-event-timer-widget.met-active .met-feat-badge {
  background: var(--met-color-success);
  color: #fff;
  box-shadow: 0 0 12px rgba(43, 175, 74, 0.5);
  animation: metFlash 0.6s ease infinite alternate;
}

#mu-event-timer-widget.met-active .met-time-val {
  color: var(--met-color-success);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(43, 175, 74, 0.6);
  animation: metFlash 0.8s infinite alternate;
}

#mu-event-timer-widget.met-active .met-feat-icon-wrap {
  border-color: rgba(43, 175, 74, 0.4);
  color: var(--met-color-success);
  box-shadow: 0 0 15px rgba(43, 175, 74, 0.15);
  animation: metShake 0.5s infinite;
}

#mu-event-timer-widget.met-active .met-feat-icon-wrap::after {
  display: block;
}

#mu-event-timer-widget.met-active .met-progress-bar {
  background: linear-gradient(90deg, #2baf4a, #8ce99a);
  animation: metProgressStripes 1s linear infinite;
}

/* ACTIVE ROW IN LIST */
.met-row.met-row-active .met-row-timer {
  color: var(--met-color-success);
  font-weight: 900;
  text-shadow: 0 0 8px rgba(43, 175, 74, 0.4);
  animation: metFlash 1s infinite alternate;
}
.met-row.met-row-active .met-row-icon {
  color: var(--met-color-success);
  animation: metShake 0.5s infinite;
}

.met-row.met-row-warning .met-row-timer {
  color: var(--met-color-warning);
  text-shadow: 0 0 8px rgba(252, 196, 25, 0.4);
}

/* MINIMIZED STATE (Sleek Horizontal Capsule) */
#mu-event-timer-widget.met-minimized {
  width: 280px;
}

#mu-event-timer-widget.met-minimized .met-glass-panel {
  border-radius: 24px;
}

#mu-event-timer-widget.met-minimized .met-header {
  padding: 8px 14px;
  background: transparent;
  border-bottom: none;
}

#mu-event-timer-widget.met-minimized .met-title {
  font-size: 10px;
  letter-spacing: 1.5px;
}

#mu-event-timer-widget.met-minimized .met-controls {
  gap: 4px;
}

#mu-event-timer-widget.met-minimized .met-featured,
#mu-event-timer-widget.met-minimized .met-tabs,
#mu-event-timer-widget.met-minimized .met-list-section,
#mu-event-timer-widget.met-minimized .met-footer {
  display: none !important;
}

/* Sleek minimizer inline show */
.met-min-content {
  display: none;
  padding: 0 14px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#mu-event-timer-widget.met-minimized .met-min-content {
  display: flex;
}

.met-min-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.met-min-icon {
  font-size: 13px;
  color: var(--ColorSecondary, #c0c0c0);
}

.met-min-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.met-min-timer {
  font-size: 11px;
  font-weight: 900;
  font-family: 'Roboto', monospace;
  color: var(--ColorSecondary, #c0c0c0);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Minimized Warning Override */
#mu-event-timer-widget.met-minimized.met-warning .met-min-timer {
  color: var(--met-color-warning);
  border-color: rgba(252, 196, 25, 0.3);
  box-shadow: 0 0 8px rgba(252, 196, 25, 0.2);
  animation: metFlash 1s infinite alternate;
}

/* Minimized Active Override */
#mu-event-timer-widget.met-minimized.met-active .met-min-timer {
  color: #fff;
  background: var(--met-color-success);
  border-color: var(--met-color-success);
  box-shadow: 0 0 10px rgba(43, 175, 74, 0.4);
  animation: metFlash 0.6s infinite alternate;
}

/* FLOATING LAUNCHER REOPEN BUTTON (When completely closed) */
#met-reopen-btn {
  position: fixed !important;
  bottom: 230px !important;
  right: 28px !important;
  z-index: 99989 !important;
  
  /* Initial hidden state */
  transform: scale(0) rotate(-45deg) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#met-reopen-btn.visible {
  transform: scale(1) rotate(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#met-reopen-btn.visible:hover {
  transform: scale(1.08) rotate(0) !important;
}

/* KEYFRAMES ANIMATIONS */
@keyframes metFlash {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes metPulseScale {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

@keyframes metShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

@keyframes metProgressStripes {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 480px) {
  #mu-event-timer-widget {
    bottom: 150px;
    right: 16px;
    width: calc(100vw - 32px);
    max-width: 320px;
  }
  
  #met-reopen-btn {
    bottom: 228px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
  
  .met-featured-content {
    padding: 14px;
  }
  
  .met-feat-layout {
    gap: 12px;
  }
  
  .met-feat-icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  
  .met-time-val {
    font-size: 20px;
  }
  
  .met-tabs {
    padding: 8px 14px;
  }
  
  .met-tab-btn {
    padding: 4px 8px;
    font-size: 9px;
  }
  
  .met-list-section {
    padding: 10px 14px 12px;
    max-height: 150px;
  }
  
  .met-footer {
    padding: 8px 14px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .met-toggles {
    width: 100%;
    justify-content: space-between;
  }
}


