/* --- Custom Reset & Base Variables --- */
:root {
  --bg-dark: #07090e;
  --bg-card: rgba(13, 19, 33, 0.45);
  --bg-card-hover: rgba(20, 29, 51, 0.65);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(139, 61, 255, 0.25);
  
  /* Vibrant Curated Color Palette */
  --primary: #8b3dff; /* Canva Purple */
  --secondary: #00c4cc; /* Canva Turquoise */
  --accent-cyan: #39e3fe; /* Glowing Cyan */
  --accent-purple: #9a4dff;
  --text-primary: #f3f6f9;
  --text-muted: #798b9e;
  --text-highlight: #ffc837;
  
  --success: #00f2a1; /* Glowing Emerald */
  --danger: #ff2a5f; /* Coral Red */
  --warning: #ffb800; /* Neon Gold */
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

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

body {
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(139, 61, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(0, 196, 204, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4, .logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Header Section --- */
header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 9, 14, 0.8);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  color: #fff;
  font-weight: 800;
}

.logo-accent {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  font-size: 0.65rem;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Pill Badges --- */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.status-pill.connected {
  border-color: rgba(0, 242, 161, 0.25);
  color: var(--success);
  background: rgba(0, 242, 161, 0.05);
}

.status-pill.disconnected {
  border-color: rgba(255, 42, 95, 0.2);
  color: var(--danger);
  background: rgba(255, 42, 95, 0.03);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

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

.disconnected .pulse-dot {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(0, 242, 161, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 242, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 242, 161, 0); }
}

/* --- Icons --- */
.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* --- Developer Drawer --- */
.developer-drawer {
  background: rgba(11, 16, 28, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.developer-drawer.open {
  max-height: 800px;
  opacity: 1;
  padding: 30px 0;
}

.drawer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.drawer-header {
  margin-bottom: 20px;
}

.drawer-header h3 {
  color: var(--accent-cyan);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.drawer-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

.drawer-form {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.drawer-logs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-logs h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* --- Form Groups --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input[type="text"], input[type="password"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(57, 227, 254, 0.15);
}

.copy-input {
  display: flex;
  gap: 8px;
}

.copy-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}

/* --- Buttons --- */
button {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #fff;
  padding: 10px 20px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(139, 61, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 61, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 14px;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, var(--secondary), var(--accent-cyan));
  color: #050a14;
  padding: 12px 24px;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(0, 196, 204, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(57, 227, 254, 0.6);
}

.btn-accent:disabled {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-danger {
  background: rgba(255, 42, 95, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 42, 95, 0.2);
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-large {
  width: 100%;
}

.btn-glow-pulse {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 6px;
  box-shadow: 0 0 0 0 rgba(57, 227, 254, 0.6);
  animation: pulse-button 2s infinite;
  pointer-events: none;
}

@keyframes pulse-button {
  0% { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(57, 227, 254, 0.6); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(57, 227, 254, 0); }
  100% { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(57, 227, 254, 0); }
}

/* --- Console Logs --- */
.console-logs {
  background: #04060b;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #798b9e;
  height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

.log-line {
  line-height: 1.4;
}

.log-line.system { color: #5c6bc0; }
.log-line.info { color: #cfd8dc; }
.log-line.working { color: var(--accent-cyan); }
.log-line.success { color: var(--success); }
.log-line.error { color: var(--danger); }

/* --- Container & Layout --- */
.container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
  flex: 1;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

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

.card h2 {
  font-size: 1.3rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* --- TV Simulator Screens Grid --- */
.screens-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.screen-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.screen-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 20px rgba(139, 61, 255, 0.15);
}

.screen-header {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 8px;
}

.screen-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.screen-status.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.screen-name {
  color: #fff;
  flex: 1;
}

.screen-orientation {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Simulated TV Viewports */
.screen-viewport {
  background: #040507;
  border-radius: 8px;
  border: 4px solid #141722;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Landscape Viewport aspect 16:9 */
.screen-card.landscape .screen-viewport {
  aspect-ratio: 16/9;
  width: 100%;
}

/* Portrait Viewport aspect 9:16 */
.screen-card.portrait .screen-viewport {
  aspect-ratio: 9/16;
  width: 170px;
  margin-left: auto;
  margin-right: auto;
}

.viewport-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, #090a10, #111420);
}

.viewport-placeholder {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.viewport-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #040507;
  animation: fadeIn 0.5s ease-out;
}

.split-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 6px;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease-in-out;
}

.split-placeholder:hover {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.split-placeholder-icon {
  font-size: 1.1rem;
  margin-bottom: 2px;
  opacity: 0.6;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 8px;
}

.active-design-name {
  color: #fff;
  font-weight: 500;
}

/* --- Right Column: Canva Explorer / Studio --- */
.design-explorer {
  position: relative;
  overflow: hidden;
}

/* Auth Covered Page Overlay */
.auth-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 19, 33, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.auth-cover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 440px;
  gap: 20px;
}

.canva-glow-icon {
  font-size: 4rem;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(139, 61, 255, 0.4);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.auth-overlay h1 {
  font-size: 1.8rem;
  color: #fff;
}

.auth-overlay p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-help-text {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.3) !important;
}

/* Canva Design Grid */
.design-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  overflow-y: auto;
  max-height: 820px;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}

/* Custom Scrollbar */
.design-grid::-webkit-scrollbar, .console-logs::-webkit-scrollbar {
  width: 6px;
}
.design-grid::-webkit-scrollbar-thumb, .console-logs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.design-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.design-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(139, 61, 255, 0.2);
  box-shadow: 0 8px 24px rgba(139, 61, 255, 0.15);
}

.design-thumbnail {
  aspect-ratio: 8/9;
  background: #09090b;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.design-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.design-thumbnail-icon {
  font-size: 2rem;
  opacity: 0.25;
}

.design-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.design-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
}

.btn-sync {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.8rem;
  padding: 8px;
  width: 100%;
  border-radius: 6px;
}

.design-card:hover .btn-sync {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  color: #fff;
}

/* --- Sync Progressive Overlay Modal --- */
.progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.progress-modal {
  max-width: 440px;
  width: 100%;
  background: rgba(13, 19, 33, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 35px 25px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.progress-spinner {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  width: 70px;
  height: 70px;
  border: 4px solid rgba(255, 255, 255, 0.04);
  border-left-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
}

.spinner-icon {
  font-size: 2rem;
  animation: heartbeats 1.5s infinite ease-in-out;
}

@keyframes heartbeats {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.progress-modal h3 {
  font-size: 1.3rem;
  color: #fff;
}

.progress-modal p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin: 5px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 15px;
  margin-top: 8px;
}

.step-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-line::before {
  content: '○';
  color: var(--text-muted);
  font-weight: bold;
}

.step-line.active {
  color: var(--accent-cyan);
}
.step-line.active::before {
  content: '●';
  color: var(--accent-cyan);
  animation: flash 1s infinite alternate;
}

.step-line.completed {
  color: var(--success);
}
.step-line.completed::before {
  content: '✓';
  color: var(--success);
}

@keyframes flash {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* --- Pairing Screen Overlays --- */
.pairing-overlay, .pairing-overlay.hidden {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pairing-modal {
  max-width: 400px;
  width: 100%;
  background: rgba(13, 19, 33, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pairing-modal h3 {
  color: #fff;
  font-size: 1.25rem;
}

.pairing-modal p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pairing-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  font-weight: 800;
  text-align: center;
  color: var(--accent-cyan);
  width: 100%;
}

.pairing-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.pairing-actions button {
  flex: 1;
  padding: 10px;
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border-color);
  background: rgba(7, 9, 14, 0.4);
  padding: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .screen-card.portrait .screen-viewport {
    width: 200px;
  }
}

/* --- Split Screen & Design Selector Custom Styling --- */
.layout-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  align-self: flex-start;
  margin-top: 5px;
}

.layout-toggle-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
}

.layout-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 61, 255, 0.3);
}

.split-viewport-container {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 4px;
  background: #141722;
}

.split-half {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #090a10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.split-half-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-cyan);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.05em;
}

.split-half-label.right {
  left: auto;
  right: 6px;
  color: var(--secondary);
}

.screen-slots-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 5px;
}

.slot-control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.slot-name {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.btn-assign-slot {
  background: rgba(57, 227, 254, 0.1);
  border: 1px solid rgba(57, 227, 254, 0.2);
  color: var(--accent-cyan);
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 4px;
  font-weight: 600;
}

.btn-assign-slot:hover {
  background: var(--accent-cyan);
  color: #050a14;
}

/* Design Selector Modal */
.design-selector-modal {
  max-width: 650px !important;
  width: 100%;
  padding: 25px !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 1.2rem;
  color: #fff;
}

.selector-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 15px;
  padding-right: 4px;
}

.selector-design-grid::-webkit-scrollbar {
  width: 6px;
}
.selector-design-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.selector-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selector-card:hover {
  border-color: var(--primary);
  background: rgba(139, 61, 255, 0.05);
}

.selector-thumb {
  aspect-ratio: 8/9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
}

.selector-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selector-title {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Drag and Drop visual feedback styling */
.viewport-content.drag-hover, .split-half.drag-hover {
  outline: 3px dashed var(--accent-cyan) !important;
  outline-offset: -6px;
  background: rgba(0, 242, 254, 0.1) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3) !important;
  transition: all 0.25s ease-in-out;
}

.design-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
  border-color: var(--accent-cyan);
}

/* Unified Setup Modal Toggle Button Styles */
.setup-toggle-btn {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.setup-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.setup-toggle-btn.active {
  background: rgba(0, 242, 254, 0.1) !important;
  color: var(--accent-cyan) !important;
  border-color: rgba(0, 242, 254, 0.3) !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15) !important;
}

.studio-content:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* --- Switch Toggle Styles --- */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

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

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

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
  border-radius: 50%;
}

.switch-toggle input:checked + .slider-round {
  background-color: rgba(0, 242, 161, 0.15);
  border-color: rgba(0, 242, 161, 0.3);
}

.switch-toggle input:checked + .slider-round:before {
  transform: translateX(22px);
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* --- Schedule Period Card Styles --- */
.schedule-period-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.schedule-period-card.active-period {
  border-color: rgba(139, 61, 255, 0.35);
  box-shadow: 0 8px 30px rgba(139, 61, 255, 0.12), inset 0 1px 0 rgba(139, 61, 255, 0.1);
  background: rgba(13, 19, 33, 0.6);
}

.period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.period-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
}

.active-period .period-dot {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 1.5s infinite;
}

.period-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.active-period-badge {
  background: rgba(0, 242, 161, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 242, 161, 0.2);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.period-time-inputs {
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.time-input {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  font-family: 'Inter', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  width: 100%;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
}

.time-input::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

.time-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.period-screens-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-screen-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
}

.schedule-screen-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.schedule-screen-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-slot-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  transition: var(--transition);
}

.schedule-slot-box.drag-hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.schedule-slot-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.03);
  text-transform: uppercase;
}

.schedule-slot-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
  margin-left: 6px;
  min-width: 0;
}

.schedule-slot-media-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.schedule-slot-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.schedule-slot-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-schedule-clear {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-schedule-clear:hover {
  color: var(--danger);
  background: rgba(255, 42, 95, 0.1);
}

.schedule-slot-empty {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
  flex: 1;
  text-align: right;
}

.btn-schedule-assign {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-schedule-assign:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(139, 61, 255, 0.3);
}

.schedule-layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 6px;
}

.schedule-layout-toolbar span {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.schedule-layout-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
}

.schedule-layout-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.schedule-layout-btn.active {
  background: rgba(139, 61, 255, 0.15);
  color: var(--accent-purple);
  border-color: rgba(139, 61, 255, 0.3);
}

/* --- Lock Screen Keypad Overlay --- */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-in-out, visibility 0.5s;
}

.lock-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-card {
  background: rgba(13, 19, 33, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.lock-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 8px;
}

.lock-status {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 35px;
}

.pin-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease-in-out;
}

.pin-dots .dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
}

.key-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.2s ease-in-out;
  outline: none;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.key-btn:active {
  transform: scale(0.95);
  background: rgba(255, 77, 0, 0.2);
}

.key-btn.key-action {
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.01);
  border-color: transparent;
}

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

#key-enter {
  color: var(--success);
}
#key-enter:hover {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.3);
}

#key-clear {
  color: var(--danger);
}
#key-clear:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.3);
}

/* --- Schedule Sets Tabs & Day Pills --- */
.sets-tabs {
  display: flex;
  gap: 8px;
}

.set-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.set-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.set-tab-btn.active {
  background: rgba(139, 61, 255, 0.12);
  color: var(--accent-purple);
  border-color: rgba(139, 61, 255, 0.35);
  box-shadow: 0 0 10px rgba(139, 61, 255, 0.1);
}

.day-pill-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
}

.day-pill-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.day-pill-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255, 77, 0, 0.2);
}

