/* ==========================================================================
   StreamSecure - Sleek Dark Mode Stylesheet (style.css)
   ========================================================================== */

:root {
  --bg-primary: #090a0f;
  --bg-surface: #11131a;
  --bg-elevated: #181b24;
  --bg-overlay: rgba(9, 10, 15, 0.85);

  --border-subtle: #202433;
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-red: #f43f5e;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 5-Minute Preview Countdown Banner */
.preview-timer-banner {
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.6), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-timer-banner.banner-expired {
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.6), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
.banner-content {
  max-width: 1440px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.preview-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 1.5s infinite;
}
.banner-expired .preview-pulse-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}
.countdown-badge {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #fff;
  font-family: monospace;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 1px;
}
.banner-expired .countdown-badge {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef08a;
}
.preview-note {
  color: #94a3b8;
  font-size: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand h1 span {
  font-size: 0.75rem;
  background: var(--accent-red);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 700;
}

.live-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-red);
  animation: pulse 1.8s infinite;
}

.admin-dot {
  background-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  min-width: 220px;
}

.search-box input:focus {
  border-color: var(--border-focus);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #fff;
}
.btn-primary:hover { background-color: #2563eb; }

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { background-color: #232836; }

.btn-accent {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
}
.btn-accent:hover { opacity: 0.92; }

.btn-danger {
  background-color: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.btn-block { width: 100%; }

/* Toolbar */
.toolbar-container {
  max-width: 1440px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-pills {
  display: flex;
  gap: 0.5rem;
}

.pill {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.pill.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.grid-stats {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Video Grid */
.grid-container {
  max-width: 1440px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* Stream Card */
.stream-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.stream-card:hover {
  border-color: #2e3549;
  transform: translateY(-2px);
}

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.stream-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlays */
.overlay-shield {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 10;
}

.shield-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.ppv-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.ppv-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.paused-overlay {
  background: rgba(15, 12, 10, 0.92);
}

.paused-tag {
  background: var(--accent-amber);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Stream Card Info */
.card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-live { background: rgba(244, 63, 94, 0.2); color: var(--accent-red); }
.badge-ppv { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.badge-paused { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.badge-cat { background: var(--bg-elevated); color: var(--text-secondary); }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-large { max-width: 800px; }

.modal-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.price-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.payment-methods {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pay-option {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
}

/* Forms */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group input,
.input-group select,
.input-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--border-focus);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Admin Dashboard Specific */
.admin-container {
  max-width: 1440px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
}

.stat-lbl {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-table th {
  background: var(--bg-elevated);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 200;
  font-size: 0.875rem;
  font-weight: 600;
}

.hidden { display: none !important; }

/* Login */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.security-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-header p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.login-footer {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--text-muted);
}
