/*
 * StreamFlow v2.1 - Live Streaming Lewat VPS
 * 
 * Custom Features & UI Components
 * Created by: Bang Tutorial
 * GitHub: https://github.com/bangtutorial

 * © 2026 Bang Tutorial - All rights reserved
 */

@font-face {
  font-family: 'tabler-icons';
  src: url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@2.30.0/fonts/tabler-icons.woff2') format('woff2');
  font-display: block;
  font-weight: normal;
  font-style: normal;
}

.ti {
  font-family: 'tabler-icons' !important;
  visibility: visible !important;
  opacity: 1;
}

.sidebar-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 4rem;
  width: 4rem;
  margin: 0 auto;
  margin-bottom: 0.75rem;
  color: white;
  border-radius: 0.75rem;
  transition-property: all;
  transition-timing-function: linear;
  transition-duration: 300ms;
  cursor: pointer;
}

.sidebar-icon:hover {
  background-color: var(--primary-color);
  color: white;
  border-radius: 0.75rem;
}

.sidebar-tooltip {
  position: absolute;
  width: auto;
  padding: 0.5rem;
  margin: 0.5rem;
  min-width: max-content;
  left: 5rem;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  color: white;
  background-color: #121212;
  font-size: 0.75rem;
  font-weight: bold;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 100ms;
  transform: scale(0);
  transform-origin: left;
}

.sidebar-icon:hover .sidebar-tooltip {
  transform: scale(1);
}

:root {
  --primary-color: #10b981;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Theme overrides (Emerald) */
.bg-primary { background-color: #10b981 !important; }
.text-primary { color: #34d399 !important; }
.border-primary { border-color: #10b981 !important; }
.hover\:bg-blue-600:hover { background-color: #059669 !important; }
.hover\:text-blue-400:hover { color: #34d399 !important; }
.focus\:ring-primary:focus { --tw-ring-color: #10b981 !important; }
.focus\:border-primary:focus { border-color: #10b981 !important; }

.modal-overlay {
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease-in-out;
}

.modal-container {
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.2s ease-in-out;
}

.modal-overlay.active {
  opacity: 1;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
  opacity: 1;
}

[onclick^="setVideoOrientation"] {
  position: relative;
  overflow: hidden;
}

[onclick^="setVideoOrientation"]:before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

[onclick^="setVideoOrientation"].bg-primary:before {
  opacity: 0.1;
}

[onclick^="setVideoOrientation"]:hover:before {
  opacity: 0.05;
}

[onclick^="setVideoOrientation"] i {
  transition: transform 0.2s ease-in-out;
}

[onclick^="setVideoOrientation"]:active i {
  transform: scale(0.9);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #374151;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #6b7280 #374151;
}

/* Spin Animation - Use Tailwind's built-in or define if needed */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ti.animate-spin {
  animation: spin 1s linear infinite !important;
  display: inline-block;
}

@media (max-width: 768px) {
  .page-toolbar,
  .filter-toolbar,
  .action-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .page-toolbar > *,
  .filter-toolbar > *,
  .action-toolbar > * {
    width: 100% !important;
  }

  .modal-container {
    margin: 0.75rem;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
    border-radius: 1rem;
  }
  
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-form-group {
    margin-bottom: 1rem;
  }
  
  .modal-input {
    padding: 0.875rem;
    font-size: 16px;
  }

  .main-content-shell {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 5rem !important;
    padding-bottom: 5.5rem !important;
  }

  .bottom-nav-item {
    min-width: 0;
    flex: 1;
  }

  .bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .bottom-nav-item i {
    font-size: 1.15rem;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-stack,
  .mobile-stack > * {
    width: 100% !important;
  }

  .mobile-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .mobile-card {
    border-radius: 1rem !important;
    padding: 1rem !important;
  }

  .mobile-full-btn,
  .mobile-full-btn button,
  .mobile-full-btn a {
    width: 100% !important;
  }
}

html.is-mobile body {
  -webkit-tap-highlight-color: transparent;
}

html.is-mobile .desktop-only {
  display: none !important;
}

html.is-desktop .mobile-only {
  display: none !important;
}

html.is-mobile input,
html.is-mobile select,
html.is-mobile textarea,
html.is-mobile button {
  font-size: 16px;
}

html.is-mobile .overflow-x-auto,
html.is-mobile .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html.is-mobile .auth-page input,
html.is-mobile .auth-page select,
html.is-mobile .auth-page textarea {
  min-height: 48px;
  border-radius: 0.875rem;
}

html.is-mobile .auth-page .g-recaptcha {
  transform-origin: left top;
}

html.is-mobile .settings-tab,
html.is-mobile .modal-tab {
  white-space: nowrap;
  border-radius: 0.85rem 0.85rem 0 0;
}

html.is-mobile .settings-content .sm\:max-w-md,
html.is-mobile .settings-content .sm\:max-w-lg,
html.is-mobile .settings-content .sm\:max-w-xl {
  max-width: 100% !important;
}

html.is-mobile .modal-container .grid,
html.is-mobile .modal-container .flex-col.sm\:flex-row {
  gap: 0.875rem !important;
}

html.is-mobile .modal-container button,
html.is-mobile .modal-container a,
html.is-mobile .modal-container input,
html.is-mobile .modal-container select,
html.is-mobile .modal-container textarea {
  min-height: 46px;
}

@media (max-width: 420px) {
  html.is-mobile .auth-page .g-recaptcha {
    transform: scale(0.92);
  }
}

/* =========================
   Modern UI Foundation v3
   ========================= */
:root {
  --bg-main: #0b1220;
  --bg-soft: #111827;
  --bg-card: #0f172a;
  --line-soft: rgba(148, 163, 184, 0.18);
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --accent: #10b981;
  --accent-2: #14b8a6;
}

body {
  background: radial-gradient(circle at top right, rgba(16,185,129,0.08), transparent 30%), var(--bg-main);
  color: var(--text-main);
}

.bg-dark-900 { background-color: #0b1220 !important; }
.bg-dark-800 { background-color: #111827 !important; }
.bg-dark-700 { background-color: #1f2937 !important; }
.border-gray-700 { border-color: var(--line-soft) !important; }
.text-gray-400 { color: var(--text-muted) !important; }

.rounded-xl,
.rounded-2xl,
.rounded-3xl {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
}

.bg-primary,
button.bg-primary,
a.bg-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  border: none;
}

.bg-primary:hover,
button.bg-primary:hover,
a.bg-primary:hover {
  filter: brightness(1.06);
}

input,
select,
textarea {
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(16,185,129,.65) !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,.14);
}

.glass-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(15,23,42,.8));
  backdrop-filter: blur(8px);
}

/* =========================
   Finishing Pass Components
   ========================= */
table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

tbody tr {
  transition: background .14s ease;
}

tbody tr:hover {
  background: rgba(148, 163, 184, 0.06);
}

.modal-container,
[role="dialog"] {
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(15,23,42,.94)) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.45) !important;
}

.badge,
.status-badge {
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.btn,
button,
a[class*="rounded"] {
  transition: transform .08s ease, filter .16s ease, box-shadow .16s ease;
}

button:active,
.btn:active,
a[class*="rounded"]:active {
  transform: translateY(1px);
}

.empty-state,
.no-data,
[data-empty="true"] {
  border: 1px dashed rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 1rem;
}

/* Neutral dark correction (no cool-blue tint) */
.bg-dark-900 { background-color: #12141d !important; }
.bg-dark-800 { background-color: #181b27 !important; }
.bg-dark-700 { background-color: #202433 !important; }

.card,
.stream-card,
.bg-gray-800,
[class*="bg-slate-900"] {
  background-color: #1a1e2b !important;
}

.border-gray-700,
.border-slate-700 {
  border-color: rgba(148, 163, 184, 0.16) !important;
}

.text-gray-500,
.text-slate-500 {
  color: #9aa3b2 !important;
}
