/* wa_account_storage.css */
/* Modern Dark Luxury styling for WhatsApp Account Storage Quota & Eviction UI */

.wa-storage-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: waStorageFadeIn 0.2s ease-out;
  box-sizing: border-box;
}

@keyframes waStorageFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.wa-storage-modal {
  background: #111827;
  border: 1px solid rgba(245, 203, 92, 0.3);
  border-radius: 14px;
  width: 100%;
  max-width: 1040px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 20px rgba(245, 203, 92, 0.08);
  color: #f3f4f6;
  font-family: inherit;
  overflow: hidden;
  box-sizing: border-box;
}

/* Header */
.wa-storage-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #162032;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.wa-storage-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wa-storage-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5cb5c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.wa-storage-account-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.wa-storage-account-select {
  background: #0d131f;
  border: 1px solid rgba(245, 203, 92, 0.35);
  border-radius: 8px;
  color: #f3f4f6;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wa-storage-account-select:focus {
  border-color: #f5cb5c;
  box-shadow: 0 0 0 2px rgba(245, 203, 92, 0.2);
}

.wa-storage-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.wa-storage-badge-partial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.wa-storage-badge-override {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.wa-storage-badge-default {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.3);
}

.wa-storage-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.wa-storage-close-btn:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}

/* Body */
.wa-storage-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.wa-storage-body::-webkit-scrollbar {
  width: var(--gr-scrollbar-size-thin, 6px);
}
.wa-storage-body::-webkit-scrollbar-track {
  background: var(--gr-scrollbar-track, #0e0d12);
}
.wa-storage-body::-webkit-scrollbar-thumb {
  background: var(--gr-scrollbar-thumb, rgba(244, 217, 34, 0.34));
  border-radius: 9999px;
}
.wa-storage-body::-webkit-scrollbar-thumb:hover {
  background: var(--gr-scrollbar-thumb-hover, rgba(244, 217, 34, 0.62));
}
@media (forced-colors: active) {
  .wa-storage-body {
    scrollbar-color: auto !important;
  }
}

/* Metric Cards */
.wa-storage-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.wa-storage-card {
  background: #162032;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-storage-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-storage-card-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f3f4f6;
  font-family: monospace;
}

.wa-storage-card-sub {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Progress bar */
.wa-storage-progress-section {
  background: #162032;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-storage-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.wa-storage-progress-track {
  position: relative;
  height: 12px;
  background: #0d131f;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-storage-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.wa-storage-fill-green {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.wa-storage-fill-yellow {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.wa-storage-fill-red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.wa-storage-watermarks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #6b7280;
}

/* Section styling */
.wa-storage-section {
  background: #162032;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-storage-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f5cb5c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.wa-storage-section-desc {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.4;
}

/* Quota Override Form */
.wa-storage-override-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wa-storage-input-wrap {
  display: flex;
  align-items: center;
  background: #0d131f;
  border: 1px solid rgba(245, 203, 92, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  gap: 6px;
}

.wa-storage-input {
  background: transparent;
  border: none;
  color: #f3f4f6;
  font-size: 0.9rem;
  font-weight: 600;
  width: 90px;
  outline: none;
  font-family: monospace;
}

.wa-storage-unit {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 600;
}

.wa-storage-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  min-height: 38px;
}

.wa-storage-btn-primary {
  background: #f5cb5c;
  color: #111827;
  border-color: #f5cb5c;
}

.wa-storage-btn-primary:hover:not(:disabled) {
  background: #ffd84a;
  box-shadow: 0 0 10px rgba(245, 203, 92, 0.35);
}

.wa-storage-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
  border-color: rgba(255, 255, 255, 0.12);
}

.wa-storage-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.wa-storage-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wa-storage-feedback {
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}

.wa-storage-feedback-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: block;
}

.wa-storage-feedback-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: block;
}

/* Stores table */
.wa-storage-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wa-storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.wa-storage-table th {
  background: #0d131f;
  color: #9ca3af;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wa-storage-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

.wa-storage-table tr:last-child td {
  border-bottom: none;
}

.wa-storage-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Coverage Panel */
.wa-storage-uncovered-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-storage-uncovered-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0d131f;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.wa-storage-uncovered-name {
  font-family: monospace;
  color: #fbbf24;
  font-weight: 600;
}

.wa-storage-uncovered-reason {
  color: #9ca3af;
  margin-left: 10px;
  flex: 1;
}

.wa-storage-uncovered-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Eviction Preview */
.wa-storage-preview-banner {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-storage-item-protected {
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.wa-storage-item-eligible {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .wa-storage-backdrop {
    padding: 8px;
  }
  .wa-storage-modal {
    max-height: 96vh;
    border-radius: 10px;
  }
  .wa-storage-header {
    padding: 12px 14px;
  }
  .wa-storage-body {
    padding: 12px;
    gap: 14px;
  }
  .wa-storage-metrics-grid {
    grid-template-columns: 1fr;
  }
  .wa-storage-override-row {
    flex-direction: column;
    align-items: stretch;
  }
  .wa-storage-input-wrap {
    justify-content: space-between;
  }
  .wa-storage-btn {
    justify-content: center;
  }
  .wa-storage-uncovered-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .wa-storage-uncovered-reason {
    margin-left: 0;
  }
}
