.setup-wrapper {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
    left: 0;
	overflow: auto;
}

.pane-wrapper {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	padding: .25rem;
	overflow: auto;
}

/* --- CSS VARIABLES --- */
:root {
    --bg-color: #eff4f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #64748b;
    --accent-blue: #2196F3;
    --accent-blue-hover: #1976D2;
    --accent-blue-soft: rgba(33, 150, 243, 0.15);
    --file-item-bg: #e8f0fe;
    --file-item-hover: #d0e1fd;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-blue: #60a5fa;
    --accent-blue-hover: #93c5fd;
    --accent-blue-soft: rgba(96, 165, 250, 0.2);
    --file-item-bg: #334155;
    --file-item-hover: #3d4b5f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* --- GLOBAL STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    /* Smooth transition for theme switching and interactions */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, 
                transform 0.2s ease, box-shadow 0.3s ease, height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
	margin: 0;
	padding: 0;
	overflow: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

canvas {
	display: block;
    transition: none;
}

a {
    color: var(--accent-blue);
}

a:hover {
    color: var(--accent-blue-hover);
}

.screen-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: auto;
}

.upload-card {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 10;
}

/* --- DROP ZONE EFFECTS --- */
.drop-zone {
    width: 100%;
    height: 300px;
    border: 2px dashed var(--accent-blue);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
    position: relative;
}

/* Hover effect for the drop zone itself */
.drop-zone:hover {
    background-color: var(--accent-blue-soft);
    border-color: var(--accent-blue-hover);
}

/* Visual feedback when dragging a file over the zone */
.drop-zone.dragging {
    background-color: var(--accent-blue-soft);
    border-style: solid;
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 var(--accent-blue-soft); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.drop-zone.compact {
    height: 120px;
    margin-bottom: 15px;
}

.upload-icon {
    font-size: 50px;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.drop-zone:hover .upload-icon {
    transform: scale(1.1);
}

.drop-zone.compact .upload-icon { font-size: 30px; }

/* --- ACTION BAR BUTTONS --- */
.action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.primary-btn, .secondary-btn {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn { 
    background: var(--accent-blue); 
    color: white; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.primary-btn:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--accent-blue-soft);
}

.secondary-btn { 
    background: transparent; 
    border: 1px solid var(--text-muted); 
    color: var(--text-muted); 
}

.secondary-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* --- FILE LIST ITEMS --- */
.file-item {
    background: var(--file-item-bg);
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-item:last-child {
    margin-bottom: 0;
}

/* Highlight the row on hover */
.file-item:hover {
    background: var(--file-item-hover);
}

.file-thumbnail {
    width: 70px;
    height: 40px;
    object-fit: cover; /* Ensures the video covers the thumbnail area without stretching */
    border-radius: 4px;
    background: #000;
    margin-right: 15px;
    pointer-events: none; /* Prevents the video itself from stealing hover events from the parent item */
}

.file-name {
    flex-grow: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- ICON INTERACTIONS --- */
.action-group {
    display: flex;
    gap: 12px;
}

.move-icon, .close-icon {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
}

.move-icon:hover {
    color: var(--accent-blue);
    transform: scale(1.2);
}

.close-icon:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: none;
}

.loading-spinner {
  width: 180px;
  height: 180px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.loading-spinner span {
  display: block;
  width: 180px;
  height: 180px;
  border: 5px solid transparent;
  border-radius: 50%;
  border-right-color: rgba(255, 255, 255, 0.7);
  animation: spinner-anim 0.8s linear infinite;
}

.loading-spinner p {  
  color: #fff;
  text-align: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: spinner-text 0.4s alternate infinite;
  font-weight: bold;
}

@keyframes spinner-anim {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@keyframes spinner-text {
  from { top: 50%; }
  to { top: 45%; }
}

/* --- ANIMATIONS --- */
.removing {
    animation: fadeOutShrink 0.4s forwards ease-in;
    pointer-events: none;
}

@keyframes fadeOutShrink {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-30px); max-height: 0; margin: 0; padding: 0; }
}

.text-center {
    text-align: center;
}

.flex-0 {
    flex: 0;
}

/* --- AUDIO STATUS INDICATOR --- */
.audio-warning-toast {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.1em;
    font-weight: 800;
    backdrop-filter: blur(12px);
    pointer-events: auto;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reconnect-btn {
    background: #f87171;
    color: #450a0a;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.2s ease;
}

.reconnect-btn:hover {
    background: white;
    transform: scale(1.05);
}

@keyframes toastSlideIn {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}