@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #1c1c1d;
  --bg-secondary: #252526;
  --bg-glass: #39393A; /* Primary grey for panels */
  --border-glass: #2a2a2b; /* Grid separator line */
  --border-glass-glow: rgba(218, 116, 34, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #868688;
  
  --accent-cyan: #DA7422; /* Orange Accent */
  --accent-purple: #f38a3a;
  --accent-gradient: linear-gradient(135deg, #DA7422 0%, #f99c54 100%);
  --accent-glow: rgba(218, 116, 34, 0.15);

  --status-pending: #cbd5e1;
  --status-pending-bg: rgba(255, 255, 255, 0.05);
  --status-processing: #fbbf24;
  --status-processing-bg: rgba(251, 191, 36, 0.15);
  --status-success: #34d399;
  --status-success-bg: rgba(52, 211, 153, 0.15);
  --status-error: #f87171;
  --status-error-bg: rgba(248, 113, 113, 0.15);
  
  --shadow-glow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-neon: 0 0 10px rgba(218, 116, 34, 0.2);
}

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

body {
  background: radial-gradient(circle at top left, #1e1b18 0%, #0d0a08 100%);
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-glass);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Panel - Sharp corners, no border, gaps act as borders */
.glass-panel {
  background: var(--bg-glass);
  border: none;
  border-radius: 0px;
  box-shadow: none;
}

/* Main Layout (Seamless Grid of Tiles - Single Column) */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px; /* 1px separator lines */
  background: var(--border-glass); /* Background color acts as the separator line */
  width: 100%;
}



.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  border-left: 2px solid var(--accent-cyan);
  padding-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Top Bar Styling */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 0px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 0%;
  background-color: var(--text-muted);
}

.status-dot.connected {
  background-color: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
  animation: pulse 2s infinite;
}

.status-dot.error {
  background-color: var(--status-error);
  box-shadow: 0 0 6px var(--status-error);
}

.now-playing-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  background: rgba(218, 116, 34, 0.05);
  border: 1px solid rgba(218, 116, 34, 0.1);
  padding: 4px 12px;
}

.ticker-label {
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.ticker-text {
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.btn-skip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 0px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.btn-skip:hover {
  background: var(--status-error-bg);
  border-color: var(--status-error);
  color: var(--text-primary);
}

.btn-settings {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-settings:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-settings svg {
  transition: transform 0.3s ease;
}

.btn-settings:hover svg {
  transform: rotate(30deg);
}

/* Form Styling (Modal inside) */
.form-group {
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23cbd5e1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* Range Input */
.range-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  min-width: 40px;
  text-align: right;
}

input[type="range"] {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 0px;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 4px var(--accent-cyan);
}

/* Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 0px;
  transition: .2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  border-radius: 0px;
  transition: .2s;
}

input:checked + .slider {
  background: var(--accent-gradient);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* Button */
.btn-primary {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  border-radius: 0px;
  padding: 10px;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Content Area Layout */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 1px; /* 1px separator between main area tiles */
  background: var(--border-glass);
  height: 100%;
  overflow: hidden;
}

/* Drag & Drop Upload Zone */
.upload-zone {
  padding: 24px;
  text-align: center;
  cursor: pointer;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.upload-zone:hover {
  background: rgba(255, 255, 255, 0.02);
}

.upload-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(218, 116, 34, 0.03);
}

.upload-icon {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.upload-zone:hover .upload-icon {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.upload-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

.upload-zone:hover .upload-icon svg {
  stroke: var(--accent-cyan);
}

.upload-text h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.upload-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Upload Queue Panel */
.queue-card {
  padding: 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-glass);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.queue-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 0px;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.queue-item {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-item-details {
  flex: 1;
  min-width: 0;
}

.queue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.queue-item-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 0px;
  text-transform: uppercase;
}

.status-badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}
.status-badge-processing {
  background: var(--status-processing-bg);
  color: var(--status-processing);
}
.status-badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
}
.status-badge-error {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-bg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 0px;
  transition: width 0.2s ease;
}

.progress-percent {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  min-width: 24px;
  text-align: right;
}

.cancel-upload {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 0px;
  transition: all 0.2s;
}

.cancel-upload:hover {
  color: var(--status-error);
}

/* File Manager Card */
.file-manager-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.file-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.file-search-container {
  position: relative;
  width: 200px;
}

.file-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0px;
  padding: 5px 8px 5px 26px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
}

.file-search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.file-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Path / Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.1);
  padding: 4px 10px;
  border-radius: 0px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.breadcrumb-item {
  cursor: pointer;
}

.breadcrumb-item:hover {
  color: var(--accent-cyan);
}

.breadcrumb-separator {
  color: var(--text-muted);
}

/* File List Table Container */
.file-table-container {
  background: rgba(0, 0, 0, 0.1);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table th {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  background: var(--bg-glass);
  z-index: 10;
}

.file-table td {
  padding: 10px 12px;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.file-row {
  transition: background-color 0.1s;
}

.file-row:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.file-icon {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
}

.file-icon.folder {
  color: var(--accent-purple);
}

/* File Badges for Format & Codec */
.badge-format {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.65rem;
  padding: 2px 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-codec {
  display: inline-block;
  background: rgba(218, 116, 34, 0.08);
  border: 1px solid rgba(218, 116, 34, 0.2);
  color: var(--accent-cyan);
  font-size: 0.65rem;
  padding: 2px 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.file-action-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 0px;
  transition: all 0.1s;
  display: flex;
  align-items: center;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.action-btn.play-btn:hover {
  color: var(--status-success);
}

.action-btn.download-btn:hover {
  color: #38bdf8;
}

.action-btn.convert-btn:hover {
  color: var(--accent-cyan);
}

.action-btn.delete-btn:hover {
  color: var(--status-error);
}

.empty-files {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-files svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-muted);
  margin-bottom: 8px;
}

/* Settings Modal Backdrop & Content Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 580px;
  max-width: 90%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass-glow);
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

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

.modal-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

/* Lock Screen Overlay */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-card {
  padding: 30px;
  width: 380px;
  max-width: 90%;
  text-align: center;
  border: 1px solid var(--border-glass-glow);
  background: var(--bg-glass);
}

.lock-card h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 600;
}

.lock-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Audio Player Overlay */
.player-overlay {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 320px;
  z-index: 1000;
  display: none;
  padding: 12px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass-glow);
  background: var(--bg-glass);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.player-title {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.player-close:hover {
  color: var(--text-primary);
}

.player-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-track-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

audio.custom-player-element {
  width: 100%;
  height: 32px;
  border-radius: 0px;
  background: var(--bg-primary);
}

/* Keyframe animations */
@keyframes pulse {
  0% {
    transform: scale(0.96);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(0.96);
    opacity: 0.8;
  }
}

/* Live Stream Player Volume Range Styling */
#streamVolume::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.15);
  height: 4px;
  border-radius: 2px;
}
#streamVolume::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #DA7422;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: -3px;
  transition: background 0.2s;
}
#streamVolume::-webkit-slider-thumb:hover {
  background: #10b981;
}
