/* PabloRec - Main Stylesheet */

:root[data-theme="light"] {
  --bg-gradient: radial-gradient(
    circle at 10% 20%,
    rgba(242, 235, 243, 1) 0%,
    rgba(227, 240, 248, 1) 90%
  );
  --bg-blob-1: rgba(99, 102, 241, 0.15);
  --bg-blob-2: rgba(236, 72, 153, 0.15);
  --panel-bg: rgba(255, 255, 255, 0.45);
  --panel-border: rgba(255, 255, 255, 0.6);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.2);
  --accent-secondary: #06b6d4;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --shadow-sm:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  --slider-track: #e2e8f0;
  --card-item-bg: rgba(255, 255, 255, 0.6);
  --card-item-hover: rgba(255, 255, 255, 0.9);
  --visualizer-bg: rgba(248, 250, 252, 0.6);
  --visualizer-wave: #4f46e5;
  --badge-bg: rgba(79, 70, 229, 0.1);
  --badge-text: #4f46e5;
}

:root[data-theme="dark"] {
  --bg-gradient: radial-gradient(
    circle at 10% 20%,
    rgba(15, 23, 42, 1) 0%,
    rgba(9, 11, 28, 1) 90%
  );
  --bg-blob-1: rgba(99, 102, 241, 0.12);
  --bg-blob-2: rgba(236, 72, 153, 0.1);
  --panel-bg: rgba(15, 23, 42, 0.55);
  --panel-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #06b6d4;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --warning: #f59e0b;
  --shadow-sm:
    0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --slider-track: #334155;
  --card-item-bg: rgba(30, 41, 59, 0.4);
  --card-item-hover: rgba(30, 41, 59, 0.7);
  --visualizer-bg: rgba(15, 23, 42, 0.7);
  --visualizer-wave: #6366f1;
  --badge-bg: rgba(99, 102, 241, 0.15);
  --badge-text: #818cf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem;
}

/* Animated background blobs */
.bg-blobs {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: float 20s infinite alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--bg-blob-1);
  top: -10%;
  left: -10%;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--bg-blob-2);
  bottom: -15%;
  right: -10%;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 50px) scale(1.1);
  }
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 10;
}

/* Header styling */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.logo {
  font-family: "Outfit", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-secondary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s infinite;
}

/* Theme Switcher */
.theme-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 0.2s ease,
    background-color 0.2s;
}

.theme-btn:hover {
  transform: scale(1.1);
  background: var(--card-item-hover);
}

.theme-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Main Glass Dashboard */
.dashboard {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  box-shadow: var(--shadow-glass);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

@media (max-width: 868px) {
  .dashboard {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
}

/* Sections & Panels */
.panel-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Card Grid (Settings) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 550px) and (max-width: 868px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.setting-card {
  background: var(--card-item-bg);
  border: 1px solid var(--panel-border);
  padding: 1.2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition:
    transform 0.2s ease,
    background-color 0.2s;
}

.setting-card:hover {
  background: var(--card-item-hover);
  transform: translateY(-2px);
}

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

.setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: -0.25rem;
}

/* Dropdowns */
select {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 30px;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toggle Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch input:disabled + .slider-switch {
  opacity: 0.6;
  cursor: not-allowed;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--slider-track);
  transition: 0.3s;
  border-radius: 24px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

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

input:checked + .slider-switch:before {
  transform: translateX(20px);
}

/* Filter sliders block */
.filters-collapsible {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.25rem;
  border-top: 1px dashed var(--panel-border);
  padding-top: 0.85rem;
}

.filter-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-val {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--slider-track);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Visualizer and Status Display Panel */
.display-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  background: var(--card-item-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  min-height: 380px;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--badge-bg);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--badge-text);
  letter-spacing: 0.2px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

.status-indicator.recording {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse-danger 1.5s infinite;
}

.status-indicator.paused {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

@keyframes pulse-danger {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

/* Timer */
.timer-display {
  font-family: "JetBrains Mono", monospace;
  font-size: 2.75rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin: 1rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Audio Visualizer Canvas */
.visualizer-container {
  position: relative;
  width: 100%;
  height: 130px;
  background: var(--visualizer-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Button group */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 16px var(--danger-glow);
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-secondary {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--card-item-hover);
}

.recording-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

/* Preview Modal Overlay */
.preview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.preview-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-modal {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 1.5rem;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.preview-modal-overlay.active .preview-modal {
  transform: translateY(0);
}

.preview-video-container {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
}

.preview-video {
  width: 100%;
  max-height: 100%;
}

.filename-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filename-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--card-item-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.25rem 0.75rem;
}

.filename-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.filename-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 0.25rem;
  outline: none;
  flex-grow: 1;
  width: 100%;
}

.file-extension {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 0.5rem;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Toasts notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  max-width: 320px;
  width: 100%;
}

.toast {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.info {
  border-left: 4px solid var(--accent);
}

.toast-icon {
  margin-top: 1px;
  flex-shrink: 0;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%) translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

.toast-close {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  margin-left: auto;
  padding: 2px;
  display: flex;
  align-items: center;
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Creator Profile Section */
.creator-section {
  margin-top: 0.5rem;
  width: 100%;
}

.creator-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition:
    transform 0.2s ease,
    background-color 0.2s;
}

.creator-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.creator-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.creator-link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}

.creator-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
</style>