/* Dashboard Customization Styles */

/* Customize button */
.dashboard-customize-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 40;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  color: white;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(232, 107, 74, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
}

.dashboard-customize-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(232, 107, 74, 0.45);
  background: linear-gradient(135deg, #D25A3A 0%, #C04A2A 100%);
}

.dashboard-customize-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232, 107, 74, 0.3);
}

.dashboard-customize-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Mobile: Icon only */
@media (max-width: 640px) {
  .dashboard-customize-btn {
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    justify-content: center;
    border-radius: 0.875rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .dashboard-customize-btn-text {
    display: none;
  }
}

/* Customize panel */
.dashboard-customize-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  max-width: 26rem;
  background: white;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-customize-panel.hidden {
  transform: translateX(100%);
}

/* Panel header */
.dashboard-customize-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  color: white;
  padding: 1.75rem;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.dashboard-customize-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.dashboard-customize-header p {
  font-size: 0.875rem;
  margin-top: 0.375rem;
  opacity: 0.9;
}

/* Close button */
.dashboard-customize-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.625rem;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-customize-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* Panel body */
.dashboard-customize-body {
  padding: 1.5rem;
}

/* Widget toggle item */
.dashboard-widget-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgb(249 250 251);
  border-radius: 0.875rem;
  margin-bottom: 0.75rem;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.dashboard-widget-toggle:hover {
  background: #C8F5C8;
  border-color: rgba(232, 107, 74, 0.3);
}

.dashboard-widget-info {
  flex: 1;
  margin-right: 1rem;
}

.dashboard-widget-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(17 24 39);
  margin: 0 0 0.25rem 0;
}

.dashboard-widget-info p {
  font-size: 0.75rem;
  color: rgb(107 114 128);
  margin: 0;
}

/* Toggle switch */
.dashboard-toggle-switch {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.dashboard-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dashboard-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgb(209 213 219);
  transition: 0.3s;
  border-radius: 9999px;
}

.dashboard-toggle-slider:before {
  position: absolute;
  content: "";
  height: 1.25rem;
  width: 1.25rem;
  left: 0.25rem;
  bottom: 0.25rem;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dashboard-toggle-switch input:checked + .dashboard-toggle-slider {
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
}

.dashboard-toggle-switch input:checked + .dashboard-toggle-slider:before {
  transform: translateX(1.25rem);
}

/* Panel footer */
.dashboard-customize-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid rgb(243 244 246);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 0.875rem;
  z-index: 10;
}

.dashboard-customize-footer button {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.dashboard-btn-primary {
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  color: white;
}

.dashboard-btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(232, 107, 74, 0.4);
  transform: translateY(-2px);
}

.dashboard-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dashboard-btn-secondary {
  background: rgb(243 244 246);
  color: rgb(55 65 81);
  border: 1px solid rgb(229 231 235);
}

.dashboard-btn-secondary:hover {
  background: rgb(229 231 235);
  border-color: rgb(209 213 219);
}

.dashboard-btn-danger {
  background: rgb(254 226 226);
  color: rgb(220 38 38);
  border: 1px solid rgb(254 202 202);
}

.dashboard-btn-danger:hover {
  background: rgb(254 202 202);
}

/* Overlay */
.dashboard-customize-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
  transition: opacity 0.3s;
}

.dashboard-customize-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Widget wrapper for customization */
.dashboard-widget-wrapper {
  transition: opacity 0.3s, max-height 0.3s;
}

.dashboard-widget-wrapper.hidden {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
}

/* Notification animations */
@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.animate-slide-in {
  animation: slide-in 0.3s ease-out;
}

.animate-fade-out {
  animation: fade-out 0.3s ease-out;
}

/* Widget categories */
.dashboard-widget-category {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.dashboard-widget-category h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(107 114 128);
  margin: 0 0 0.75rem 0;
  padding-left: 0.25rem;
}

/* Empty state */
.dashboard-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: rgb(107 114 128);
}

.dashboard-empty-state svg {
  margin: 0 auto 1rem;
  width: 3rem;
  height: 3rem;
  opacity: 0.5;
}

.dashboard-empty-state p {
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-customize-panel {
    max-width: 100%;
  }
}
