/* ============================================
   DESIGN SYSTEM & BASE STYLES
   ============================================ */
:root {
  --primary-color: #3b82f6;
  --primary-color-dark: #60a5fa;
  --primary-color-rgb: 59, 130, 246;
  --primary-color-dark-rgb: 96, 165, 250;
  --secondary-color: #8b5cf6;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #10b981;

  /* Light Mode Palette */
  --bg-color-light: #f7f7f8;
  --bg-secondary-light: #f0f1f3;
  --surface-color-light: #ffffff;
  --text-primary-light: #1a1a1a;
  --text-secondary-light: #6b7280;
  --border-color-light: #e5e7eb;

  /* Dark Mode Palette */
  --bg-color-dark: #171717;
  --bg-secondary-dark: #1f1f1f;
  --surface-color-dark: #262626;
  --text-primary-dark: #ffffff;
  --text-secondary-dark: #a3a3a3;
  --border-color-dark: #404040;

  /* Sizing & Spacing */
  --border-radius: 8px;
  --spacing-unit: 1rem;
  --sidebar-width: 260px;
  --sidebar-collapsed: 60px;
  --right-sidebar-width: 280px;
  --right-sidebar-collapsed: 70px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip to content link for keyboard users */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10000;
  font-weight: 500;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.dark-mode *:focus-visible,
.dark-mode button:focus-visible,
.dark-mode a:focus-visible,
.dark-mode input:focus-visible,
.dark-mode textarea:focus-visible,
.dark-mode [role="button"]:focus-visible,
.dark-mode [role="menuitem"]:focus-visible {
  outline-color: var(--primary-color-dark);
}

/* ============================================
   BASE RESET
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Asegurar que los botones sean clickeables en móvil */
button,
a,
[role="button"],
input[type="button"],
input[type="submit"] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevenir zoom en inputs en iOS */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color-light);
  color: var(--text-primary-light);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.4;
}

.dark-mode {
  background-color: var(--bg-color-dark);
  color: var(--text-primary-dark);
}

/* ============================================
   LAYOUT - SIDEBARS & MAIN CONTENT
   ============================================ */

/* Left Sidebar */
.left-sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface-color-light);
  border-right: 1px solid var(--border-color-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.dark-mode .left-sidebar {
  background-color: var(--surface-color-dark);
  border-right-color: var(--border-color-dark);
}

.left-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.left-sidebar.collapsed .sidebar-logo {
  font-size: 1.5rem;
  justify-content: center;
}

.left-sidebar.collapsed .logo-text {
  display: none;
}

.left-sidebar.collapsed .sidebar-header-top {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.left-sidebar.collapsed .new-timer-btn .text,
.left-sidebar.collapsed .sidebar-section-title,
.left-sidebar.collapsed .timer-item-name,
.left-sidebar.collapsed .user-name,
.left-sidebar.collapsed .sign-out-btn,
.left-sidebar.collapsed .user-info,
.left-sidebar.collapsed .sign-in-btn,
.left-sidebar.collapsed .program-name,
.left-sidebar.collapsed .program-count {
  display: none;
}

.left-sidebar.collapsed .new-timer-btn,
.left-sidebar.collapsed .sign-in-btn {
  justify-content: center;
}

.left-sidebar.collapsed .timer-item-content {
  justify-content: center;
}

.left-sidebar.collapsed .timer-item-menu {
  display: none;
}

.left-sidebar.collapsed .sidebar-section {
  visibility: hidden;
  padding: 0;
}

.left-sidebar.collapsed .sidebar-section * {
  display: none;
}

.left-sidebar.collapsed .user-profile {
  justify-content: center;
  padding: 0;
  margin: 0.5rem auto;
  background-color: transparent;
}

.left-sidebar.collapsed .user-photo {
  width: 36px;
  height: 36px;
}

.left-sidebar.collapsed .sign-in-btn {
  width: auto;
  margin: 0 auto;
  padding: 0.75rem;
}

.sidebar-header {
  padding: 0.75rem;
  position: relative;
  margin: 0;
  margin-top: 0;
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
}

.sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  padding-top: 1.5rem;
  margin: 0;
  margin-top: 0;
}

.left-toggle {
  transition: all 0.3s ease;
}

.left-toggle svg {
  transition: transform 0.3s ease;
}

.left-sidebar.collapsed .left-toggle svg {
  transform: rotate(180deg);
}

.sidebar-logo {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dark-mode .sidebar-logo {
  color: var(--text-primary-dark);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-primary-light);
  transition: all 0.2s ease;
}

.dark-mode .logo-icon svg {
  color: var(--text-primary-dark);
}

/* Control de visibilidad de iconos */
.panel-icon {
  display: none;
}

/* Cuando está colapsado, el micrófono es clickeable */
.left-sidebar.collapsed .logo-icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
}

.left-sidebar.collapsed .microphone-icon {
  display: block;
  width: 16px;
  height: 16px;
}

.left-sidebar.collapsed .panel-icon {
  display: none;
  width: 16px;
  height: 16px;
}

.left-sidebar.collapsed .logo-icon:hover .microphone-icon {
  display: none;
}

.left-sidebar.collapsed .logo-icon:hover .panel-icon {
  display: block;
}

.left-sidebar.collapsed .logo-icon:hover {
  background-color: var(--bg-color-light);
  border-radius: 6px;
  padding: 0.35rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-sidebar.collapsed .logo-icon:hover svg {
  color: var(--primary-color);
  width: 16px;
  height: 16px;
}

.dark-mode .left-sidebar.collapsed .logo-icon:hover {
  background-color: var(--bg-color-dark);
}

.dark-mode .left-sidebar.collapsed .logo-icon:hover svg {
  color: var(--primary-color-dark);
}

.logo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.sidebar-toggle {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-secondary-light);
  cursor: pointer;
  padding: 0.35rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 101;
}

/* Ocultar el botón original cuando está colapsado */
.left-sidebar.collapsed .sidebar-toggle {
  display: none;
}

.dark-mode .sidebar-toggle {
  color: var(--text-secondary-dark);
}

.sidebar-toggle:hover {
  background-color: var(--bg-color-light);
  color: var(--primary-color);
}

.dark-mode .sidebar-toggle:hover {
  background-color: var(--bg-color-dark);
  color: var(--primary-color-dark);
}

.sidebar-toggle .collapse-icon {
  display: none;
}

.left-sidebar.collapsed .sidebar-toggle .expand-icon {
  display: none;
}

.left-sidebar.collapsed .sidebar-toggle .collapse-icon {
  display: block;
}



.new-timer-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-primary-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  width: 100%;
}

.dark-mode .new-timer-btn {
  color: var(--text-primary-dark);
}

.new-timer-btn:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .new-timer-btn:hover {
  background-color: var(--bg-color-dark);
}

.new-timer-btn .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.left-sidebar:not(.collapsed) .new-timer-btn .icon {
  display: inline;
}

.left-sidebar.collapsed .new-timer-btn {
  justify-content: center;
  padding: 0.75rem;
  margin: 0;
  width: 100%;
}

.left-sidebar.collapsed .new-timer-btn .icon {
  display: inline;
}

/* Stopwatch button */
.new-stopwatch-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-primary-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  width: 100%;
}

.dark-mode .new-stopwatch-btn {
  color: var(--text-primary-dark);
}

.new-stopwatch-btn:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .new-stopwatch-btn:hover {
  background-color: var(--bg-color-dark);
}

.new-stopwatch-btn .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.left-sidebar.collapsed .new-stopwatch-btn {
  justify-content: center;
  padding: 0.75rem;
  margin: 0;
  width: 100%;
}

.left-sidebar.collapsed .new-stopwatch-btn .icon {
  display: inline;
}

.left-sidebar.collapsed .new-stopwatch-btn .text,
.left-sidebar.collapsed .new-timer-btn .text {
  display: none;
}

.left-sidebar.collapsed .sidebar-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  min-height: 0;
  margin: 0;
  margin-top: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.search-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary-light);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .search-btn {
  color: var(--text-secondary-dark);
}

.search-btn:hover {
  background-color: var(--bg-color-light);
  color: var(--primary-color);
}

.dark-mode .search-btn:hover {
  background-color: var(--bg-color-dark);
  color: var(--primary-color-dark);
}

.new-program-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-primary-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  width: 100%;
}

.dark-mode .new-program-btn {
  color: var(--text-primary-dark);
}

.new-program-btn:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .new-program-btn:hover {
  background-color: var(--bg-color-dark);
}

.new-program-btn .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.left-sidebar.collapsed .new-program-btn {
  display: none;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-secondary-light);
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
  letter-spacing: 0.5px;
}

.dark-mode .sidebar-section-title {
  color: var(--text-secondary-dark);
}

.timers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Programs List */
.programs-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.program-item {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  background-color: transparent;
  transition: all 0.2s ease;
}

.program-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.program-header:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .program-header:hover {
  background-color: var(--bg-color-dark);
}

.program-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.program-chevron {
  transition: transform 0.2s;
  color: var(--text-secondary-light);
  flex-shrink: 0;
}

.dark-mode .program-chevron {
  color: var(--text-secondary-dark);
}

.program-item.collapsed .program-chevron {
  transform: rotate(-90deg);
}

.program-icon-container {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.program-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.program-name {
  font-weight: 400;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.program-count {
  font-size: 0.7rem;
  color: var(--text-secondary-light);
  background-color: var(--bg-color-light);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  flex-shrink: 0;
  font-weight: 500;
}

.dark-mode .program-count {
  color: var(--text-secondary-dark);
  background-color: var(--bg-color-dark);
}

.program-menu {
  opacity: 0;
  transition: opacity 0.2s;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  flex-shrink: 0;
}

.program-header:hover .program-menu {
  opacity: 1;
}

.program-menu:hover {
  background-color: rgba(0,0,0,0.1);
}

.dark-mode .program-menu:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Mobile: siempre mostrar program-menu */
@media (max-width: 768px) {
  .program-menu {
    opacity: 1;
  }
}

.program-timers {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.05rem 0.5rem 0.2rem 1.2rem;
  max-height: 400px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.program-item.collapsed .program-timers {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.program-timer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: transparent;
  font-size: 0.8rem;
}

.program-timer-item:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .program-timer-item:hover {
  background-color: var(--bg-color-dark);
}

.program-timer-item.active {
  background-color: transparent;
  color: var(--primary-color);
  font-weight: 500;
}

.dark-mode .program-timer-item.active {
  color: var(--primary-color-dark);
}

.program-timer-item.dragging {
  opacity: 0.5;
}

.program-timer-item-menu {
  opacity: 0;
  transition: opacity 0.2s;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  flex-shrink: 0;
}

.program-timer-item:hover .program-timer-item-menu {
  opacity: 1;
}

.program-timer-item-menu:hover {
  background-color: rgba(0,0,0,0.1);
}

.dark-mode .program-timer-item-menu:hover {
  background-color: rgba(255,255,255,0.1);
}

.program-timer-item.active .program-timer-item-menu {
  opacity: 1;
}

/* Mobile: siempre mostrar program-timer-item-menu */
@media (max-width: 768px) {
  .program-timer-item-menu {
    opacity: 1;
  }
}

.program-item.drag-over {
  background-color: rgba(var(--primary-color-rgb), 0.1);
  border: 2px dashed var(--primary-color);
}

.drop-zone {
  min-height: 30px;
  border-radius: 6px;
  transition: all 0.2s;
}

.drop-zone.drag-over {
  background-color: rgba(var(--primary-color-rgb), 0.1);
  border: 2px dashed var(--primary-color);
}

.timer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: transparent;
  position: relative;
}

.timer-item:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .timer-item:hover {
  background-color: var(--bg-color-dark);
}

.timer-item.active {
  background-color: transparent;
  color: var(--primary-color);
  font-weight: 500;
}

.dark-mode .timer-item.active {
  color: var(--primary-color-dark);
}

.timer-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.timer-item-favorite {
  color: var(--text-primary-light);
  flex-shrink: 0;
}

.dark-mode .timer-item-favorite {
  color: var(--text-primary-dark);
}

.timer-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-item-menu {
  opacity: 0;
  transition: opacity 0.2s;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
}

.timer-item:hover .timer-item-menu {
  opacity: 1;
}

.timer-item-menu:hover {
  background-color: rgba(0,0,0,0.1);
}

.dark-mode .timer-item-menu:hover {
  background-color: rgba(255,255,255,0.1);
}

.timer-item.active .timer-item-menu {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem;
  margin: 0;
  margin-top: 1rem;
  position: relative;
}




.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0.75rem;
  position: relative;
  margin-top: 1rem;
}


.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-primary-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
}

.dark-mode .sidebar-action-btn {
  color: var(--text-primary-dark);
}

.sidebar-action-btn:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .sidebar-action-btn:hover {
  background-color: var(--bg-color-dark);
}

.sidebar-action-icon {
  flex-shrink: 0;
}

.sidebar-action-text {
  flex: 1;
  text-align: left;
}

.left-sidebar.collapsed .sidebar-actions {
  margin: 0 0 1rem 0;
  padding: 0 0 1rem 0;
}

.left-sidebar.collapsed .sidebar-action-btn {
  justify-content: center;
  padding: 0.75rem;
  margin: 0;
}

.left-sidebar.collapsed .sidebar-action-text {
  display: none;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin: 0 0.5rem;
  border-radius: 6px;
  background-color: transparent;
}

.dark-mode .user-profile {
  background-color: transparent;
}

.user-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  background-color: var(--surface-color-light);
}

.dark-mode .user-photo {
  background-color: var(--surface-color-dark);
}

.user-info {
  flex: 1;
  min-width: 0;
}

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

.sign-out-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary-light);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.35rem;
  text-align: left;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.dark-mode .sign-out-btn {
  color: var(--text-secondary-dark);
}

.sign-out-btn:hover {
  color: var(--primary-color);
  background: var(--bg-color-light);
}

.dark-mode .sign-out-btn:hover {
  color: var(--primary-color-dark);
  background: var(--bg-color-dark);
}

.sign-in-btn {
  width: calc(100% - 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0.5rem;
  font-weight: 500;
  font-size: 0.8rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 40px;
}

/* Asegurar que el botón de Google One Tap se vea correctamente */
.sign-in-btn > div {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

/* Main Content */
.main-content {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  top: 0;
  bottom: 0;
  padding: 2rem;
  transition: all 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
}

body:has(.left-sidebar.collapsed) .main-content {
  left: var(--sidebar-collapsed);
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  width: 100%;
}

.welcome-content {
  text-align: center;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.welcome-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary-light);
  margin-bottom: 2rem;
  white-space: nowrap;
}

.dark-mode .welcome-subtitle {
  color: var(--text-secondary-dark);
}

.welcome-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin: 0;
}

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

.dark-mode .btn-secondary {
  background: var(--bg-color-dark);
  color: var(--text-primary-dark);
  border-color: var(--border-dark);
}

.btn-secondary:hover {
  background: var(--bg-hover-light);
  transform: translateY(-2px);
}

.dark-mode .btn-secondary:hover {
  background: var(--bg-hover-dark);
}

/* Timer Workspace */
.timer-workspace {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workspace-header {
  margin-bottom: 2rem;
  position: relative;
}

.guest-mode-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(var(--primary-color-rgb), 0.15);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10000; /* Mayor que mobile-header y mobile-overlay */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .guest-mode-badge {
  background: rgba(var(--primary-color-dark-rgb), 0.15);
  border-color: var(--primary-color-dark);
  color: var(--primary-color-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.guest-mode-badge svg {
  width: 16px;
  height: 16px;
}

/* Ajuste responsive del badge en móvil */
@media (max-width: 768px) {
  .guest-mode-badge {
    top: 70px; /* Debajo del header móvil (60px + 10px margen) */
    left: 1rem;
    right: 1rem;
    transform: none;
    max-width: none;
    font-size: 0.75rem;
    padding: 0.6rem 1rem;
    justify-content: center;
  }
  
  .guest-mode-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Ajustar el padding superior del main-content cuando hay badge de invitado */
  body:has(.guest-mode-badge) .main-content {
    padding-top: 150px !important; /* Header móvil (60px) + espacio para badge (60px) + margen (30px) */
  }
  
  body:has(.guest-mode-badge) .workspace-header {
    margin-top: 0;
  }
}

/* Ocultar botones de edición en modo invitado */
body:has(.guest-mode-badge) .block-actions {
  display: none !important;
}

/* Ocultar cursor drag en modo invitado */
body:has(.guest-mode-badge) .block-item {
  cursor: default !important;
}

/* Aumentar espacio entre bloques en modo invitado */
body:has(.guest-mode-badge) .block-list-modern {
  gap: 1.25rem !important; /* Mismo espacio que los timer cards */
}

body:has(.guest-mode-badge) .block-item {
  margin-bottom: 1.25rem !important; /* Forzar espacio entre bloques */
}

body:has(.guest-mode-badge) .block-item:last-child {
  margin-bottom: 0 !important; /* Quitar margen del último elemento */
}

.timer-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.timer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.current-timer-name {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  order: -1;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary-light);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.dark-mode .btn-icon {
  color: var(--text-secondary-dark);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  background: var(--bg-color-light);
  color: var(--primary-color);
}

.dark-mode .btn-icon:hover {
  background: var(--bg-color-dark);
  color: var(--primary-color-dark);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon-danger:hover {
  background: var(--bg-color-light);
  color: var(--danger-color);
}

.dark-mode .btn-icon-danger:hover {
  background: var(--bg-color-dark);
}

/* Mobile: aumentar área de clic */
@media (max-width: 768px) {
  .btn-icon {
    min-width: 44px;
    height: 44px;
    padding: 0.5rem;
  }
  
  .btn-icon svg {
    width: 20px;
    height: 20px;
  }
}


/* ============================================
   TIMER COMPONENTS
   ============================================ */

/* On Air Indicator */
.on-air-indicator {
    /* Indicador ON AIR deshabilitado */
    display: none !important;
}

.on-air-indicator.active {
    opacity: 1;
    visibility: visible;
}

.on-air-indicator .dot {
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Timer Display - Modern & Minimal */
.timer-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.timer-card-modern {
  background: transparent;
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.dark-mode .timer-card-modern {
  border-color: var(--border-color-dark);
}

.timer-card-modern:hover {
  border-color: var(--primary-color);
}

.dark-mode .timer-card-modern:hover {
  border-color: var(--primary-color-dark);
}

.timer-card-header {
  margin-bottom: 1.5rem;
}

.timer-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary-light);
}

.dark-mode .timer-card-label {
  color: var(--text-secondary-dark);
}

.timer-modern {
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--text-primary-light);
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.dark-mode .timer-modern {
  color: var(--text-primary-dark);
}

#timer {
  color: var(--primary-color);
}

.dark-mode #timer {
  color: var(--primary-color-dark);
}

/* Progress Bar - Modern */
.progress-bar-modern {
  height: 4px;
  background-color: var(--border-color-light);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.dark-mode .progress-bar-modern {
  background-color: var(--border-color-dark);
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  background-color: var(--primary-color);
}

.dark-mode .progress-fill {
  background-color: var(--primary-color-dark);
}

/* Controls - Modern Layout */
.controls {
  margin-bottom: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.controls-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.controls-secondary {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Control Buttons - Modern & Minimal */
.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.control-btn * {
  pointer-events: none;
}

.dark-mode .control-btn {
  color: var(--text-primary-dark);
}

.control-btn svg {
  width: 20px;
  height: 20px;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: var(--bg-color-light);
  color: var(--primary-color);
}

.dark-mode .control-btn:hover {
  background: var(--bg-color-dark);
  color: var(--primary-color-dark);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn-play {
  width: 52px;
  height: 52px;
  background: var(--primary-color);
  color: white;
  border-radius: 10px;
}

.dark-mode .control-btn-play {
  background: var(--primary-color-dark);
  color: white;
}

.control-btn-play svg {
  width: 24px;
  height: 24px;
  stroke: white !important;
  fill: white !important;
}

.control-btn-play:hover {
  background: rgba(var(--primary-color-rgb), 0.9);
}

.control-btn-play:hover svg {
  stroke: white !important;
  fill: white !important;
  opacity: 1 !important;
}

.dark-mode .control-btn-play:hover {
  background: rgba(var(--primary-color-dark-rgb), 0.9);
}

.control-btn-secondary {
  width: 44px;
  height: 44px;
}

/* Mobile: aumentar botones de control */
@media (max-width: 768px) {
  .control-btn {
    width: 52px;
    height: 52px;
  }
  
  .control-btn svg {
    width: 24px;
    height: 24px;
  }
  
  .control-btn-play {
    width: 64px;
    height: 64px;
  }
  
  .control-btn-play svg {
    width: 28px;
    height: 28px;
  }
  
  .control-btn-secondary {
    width: 52px;
    height: 52px;
  }
}

/* Toggle Buttons */
.control-toggle-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary-light);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dark-mode .control-toggle-btn {
  color: var(--text-secondary-dark);
}

.control-toggle-btn:hover {
  color: var(--primary-color);
  background: var(--bg-color-light);
}

.dark-mode .control-toggle-btn:hover {
  color: var(--primary-color-dark);
  background: var(--bg-color-dark);
}

.control-toggle-btn.active {
  background: var(--primary-color);
  color: white;
}

.dark-mode .control-toggle-btn.active {
  background: var(--primary-color-dark);
  color: white;
}

.control-toggle-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Mobile: aumentar botones toggle */
@media (max-width: 768px) {
  .control-toggle-btn {
    padding: 0.65rem 1rem;
    font-size: 0.9375rem;
    min-height: 44px;
  }
  
  .control-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Buttons */
.btn {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  border: none;
  font-family: inherit;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn * {
  pointer-events: none;
}

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

.dark-mode .btn-primary {
  background-color: var(--primary-color-dark);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-color);
  opacity: 0.9;
}

.dark-mode .btn-primary:hover:not(:disabled) {
  background-color: var(--primary-color-dark);
  opacity: 0.9;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-secondary-light);
}

.dark-mode .btn-secondary {
  color: var(--text-secondary-dark);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-color-light);
  color: var(--text-primary-light);
}

.dark-mode .btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-color-dark);
  color: var(--text-primary-dark);
}

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

.dark-mode .btn.active {
  background: var(--primary-color-dark);
}

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

.btn:active:not(:disabled) {
  transform: scale(0.95);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-color);
  opacity: 0.9;
}

/* Mobile: aumentar tamaño de botones */
@media (max-width: 768px) {
  .btn {
    padding: 0.65rem 1rem;
    font-size: 0.9375rem;
    min-height: 44px;
  }
}

/* Legacy button styles - Not used in modern design */
/* .square-btn {
  width: 64px;
  height: 64px;
  padding: 0;
  font-size: 1.5rem;
  border-radius: 16px;
} */

/* Block Details - Modern */
.block-details-modern {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  background: transparent;
  transition: all 0.3s ease;
}

.dark-mode .block-details-modern {
  border-color: var(--border-color-dark);
}

.block-details-modern:hover {
  border-color: var(--primary-color);
}

.dark-mode .block-details-modern:hover {
  border-color: var(--primary-color-dark);
}

.block-details-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.block-details-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: white;
}

.dark-mode .block-details-icon {
  background-color: var(--primary-color-dark);
}

.block-details-text {
  flex: 1;
}

.block-details-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary-light);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.dark-mode .block-details-title {
  color: var(--text-primary-dark);
}

.block-details-description {
  font-size: 0.875rem;
  color: var(--text-secondary-light);
  line-height: 1.6;
  margin: 0;
}

.dark-mode .block-details-description {
  color: var(--text-secondary-dark);
}

/* Block Editor - Modern */
.block-editor-modern {
  max-width: 800px;
  margin: 0 auto;
}

.editor-header {
  margin-bottom: 1.5rem;
}

.editor-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary-light);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.dark-mode .editor-title {
  color: var(--text-primary-dark);
}

.editor-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary-light);
}

.dark-mode .editor-subtitle {
  color: var(--text-secondary-dark);
}

.input-group-modern {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  background: transparent;
  transition: all 0.3s ease;
}

.dark-mode .input-group-modern {
  border-color: var(--border-color-dark);
}

.input-group-modern:focus-within {
  border-color: var(--primary-color);
}

.dark-mode .input-group-modern:focus-within {
  border-color: var(--primary-color-dark);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.input-modern {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-primary-light);
  font-family: inherit;
}

.dark-mode .input-modern {
  color: var(--text-primary-dark);
  border-color: var(--border-color-dark);
}

.input-modern:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--surface-color-light);
}

.dark-mode .input-modern:focus {
  border-color: var(--primary-color-dark);
  background-color: var(--surface-color-dark);
}

.input-modern::placeholder {
  color: var(--text-secondary-light);
  opacity: 0.6;
}

.dark-mode .input-modern::placeholder {
  color: var(--text-secondary-dark);
}

.input-time {
  width: 140px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* Time Input Enhancements */
.time-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.time-input-large {
  font-size: 1rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  font-weight: 500;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  transition: all 0.3s ease;
  width: 100%;
  background: transparent;
  color: var(--text-primary-light);
  font-family: inherit;
}

.dark-mode .time-input-large {
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.time-input-large:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
  background-color: var(--surface-color-light);
}

.dark-mode .time-input-large:focus {
  border-color: var(--primary-color-dark);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.08);
  background-color: var(--surface-color-dark);
}

.time-input-large::placeholder {
  color: var(--text-secondary-light);
  opacity: 0.6;
}

.dark-mode .time-input-large::placeholder {
  color: var(--text-secondary-dark);
}

.time-input-helper {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  color: var(--text-secondary-light);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.dark-mode .time-input-helper {
  color: var(--text-secondary-dark);
}

.time-input-container:focus-within .time-input-helper {
  opacity: 0.7;
  color: var(--primary-color);
}

.dark-mode .time-input-container:focus-within .time-input-helper {
  color: var(--primary-color-dark);
}

.input-textarea {
  resize: none;
  overflow-y: hidden;
  min-height: 42px;
  line-height: 1.5;
}

.btn-add-block {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: white;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dark-mode .btn-add-block {
  background: var(--primary-color-dark);
}

.btn-add-block svg {
  width: 16px;
  height: 16px;
}

.btn-add-block:hover {
  background: var(--primary-color);
  opacity: 0.9;
}

.dark-mode .btn-add-block:hover {
  background: var(--primary-color-dark);
  opacity: 0.9;
}

.btn-add-block:active {
  transform: scale(0.95);
}

/* Mobile: aumentar botón de agregar bloque */
@media (max-width: 768px) {
  .btn-add-block {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    min-height: 48px;
  }
  
  .btn-add-block svg {
    width: 18px;
    height: 18px;
  }
}

/* Block List - Modern */
.block-list-modern {
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* Espacio normal para el timer maestro */
}

.empty-state-modern {
  text-align: center;
  padding: 3rem 2rem;
  border: 1px dashed var(--border-color-light);
  border-radius: 12px;
  display: none;
}

.dark-mode .empty-state-modern {
  border-color: var(--border-color-dark);
}

.empty-state-modern svg {
  color: var(--text-secondary-light);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.dark-mode .empty-state-modern svg {
  color: var(--text-secondary-dark);
}

.empty-state-modern h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary-light);
  margin-bottom: 0.375rem;
}

.dark-mode .empty-state-modern h3 {
  color: var(--text-primary-dark);
}

.empty-state-modern p {
  font-size: 0.875rem;
  color: var(--text-secondary-light);
  margin: 0;
}

.dark-mode .empty-state-modern p {
  color: var(--text-secondary-dark);
}

.dark-mode .empty-state p {
  color: var(--text-secondary-dark);
}

.block-item {
  background: transparent;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0; /* Sin margen individual, usamos gap del contenedor */
  border: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
}

.dark-mode .block-item {
  border-color: var(--border-color-dark);
}

.block-item:hover {
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.02);
}

.dark-mode .block-item:hover {
  border-color: var(--primary-color-dark);
  background-color: rgba(var(--primary-color-dark-rgb), 0.02);
}

.block-item.active {
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.05);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.dark-mode .block-item.active {
  border-color: var(--primary-color-dark);
  background-color: rgba(var(--primary-color-dark-rgb), 0.05);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-dark-rgb), 0.1);
}

/* Borde izquierdo removido para diseño más limpio */
/* .block-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
}

.dark-mode .block-item.active::before {
  background: var(--primary-color-dark);
} */

.block-item.drag-over {
  background-color: rgba(var(--primary-color-rgb), 0.08);
  border-color: var(--primary-color);
  border-style: dashed;
}

.block-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.block-time {
  font-weight: 600;
  font-size: 0.9375rem;
  width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary-light);
  letter-spacing: 0.02em;
}

.dark-mode .block-time {
  color: var(--text-primary-dark);
}

.block-item.active .block-time {
  color: var(--primary-color);
}

.dark-mode .block-item.active .block-time {
  color: var(--primary-color-dark);
}

.block-content {
  flex: 1;
  min-width: 0;
}

.block-content strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
  color: var(--text-primary-light);
}

.dark-mode .block-content strong {
  color: var(--text-primary-dark);
}

.block-content span {
  display: block;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary-light);
  opacity: 0.8;
}

.dark-mode .block-content span {
  color: var(--text-secondary-dark);
}

.block-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.block-item:hover .block-actions {
  opacity: 1;
}

.block-actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary-light);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.block-actions button * {
  pointer-events: none;
}

.dark-mode .block-actions button {
  color: var(--text-secondary-dark);
}

.block-actions button svg {
  width: 14px;
  height: 14px;
}

.block-actions button:hover {
  color: var(--primary-color);
  background: var(--bg-color-light);
}

.dark-mode .block-actions button:hover {
  color: var(--primary-color-dark);
  background: var(--bg-color-dark);
}

.block-actions .btn-danger:hover {
  color: var(--danger-color);
  background: var(--bg-color-light);
}

.dark-mode .block-actions .btn-danger:hover {
  background: var(--bg-color-dark);
}

/* Mobile: siempre mostrar block-actions */
@media (max-width: 768px) {
  .block-actions {
    opacity: 1;
  }
  
  .block-actions button {
    width: 44px;
    height: 44px;
  }
  
  .block-actions button svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================
   MODALS & OVERLAYS
   ============================================ */

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--surface-color-light);
  margin: 0 auto;
  max-width: 600px;
  width: 90%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border-color-light);
}

.dark-mode .modal-content {
  background-color: var(--surface-color-dark);
  border-color: var(--border-color-dark);
}

.modal-small {
  max-width: 400px;
}

.modal-new-timer {
  max-width: 500px;
}

.modal-new-program {
  z-index: 2100;
}

/* Mobile: ajustes para modales pequeños */
@media (max-width: 768px) {
  .modal-small {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }
  
  .modal-small .modal-body {
    padding: 1.5rem 1rem;
  }
  
  .modal-small .modal-header {
    padding: 1.25rem 1rem;
  }
  
  .modal-small .modal-footer {
    padding: 1rem;
  }
}

.modal-description {
  color: var(--text-secondary-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-size: 0.9375rem;
}

.dark-mode .modal-description {
  color: var(--text-secondary-dark);
}

.input-large {
  font-size: 1rem;
  font-weight: 400;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary-light);
  transition: all 0.2s ease;
  width: 100%;
  font-family: inherit;
}

.dark-mode .input-large {
  color: var(--text-primary-dark);
  border-color: var(--border-color-dark);
}

.input-large:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.02);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.dark-mode .input-large:focus {
  border-color: var(--primary-color-dark);
  background-color: rgba(var(--primary-color-dark-rgb), 0.02);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-dark-rgb), 0.1);
}

.input-large::placeholder {
  color: var(--text-secondary-light);
  opacity: 0.6;
}

.dark-mode .input-large::placeholder {
  color: var(--text-secondary-dark);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border-color-light);
}

.dark-mode .modal-header {
  border-bottom-color: var(--border-color-dark);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary-light);
  letter-spacing: -0.01em;
}

.dark-mode .modal-header h2 {
  color: var(--text-primary-dark);
}

.modal-body {
  padding: 2rem;
}

.delete-confirm-text {
  color: var(--text-primary-light);
  line-height: 1.6;
  margin: 0;
  font-size: 0.9375rem;
}

.dark-mode .delete-confirm-text {
  color: var(--text-primary-dark);
}

/* Share Modal */
.share-description {
  color: var(--text-secondary-light);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
}

.dark-mode .share-description {
  color: var(--text-secondary-dark);
}

.share-link-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.share-link-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color-light);
  border-radius: 6px;
  background: var(--bg-color-light);
  color: var(--text-primary-light);
  font-size: 0.875rem;
  font-family: 'Monaco', 'Courier New', monospace;
  transition: all 0.2s ease;
  min-width: 0; /* Permite que el input se contraiga */
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark-mode .share-link-input {
  border-color: var(--border-color-dark);
  background: var(--bg-color-dark);
  color: var(--text-primary-dark);
}

.share-link-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--surface-color-light);
}

.dark-mode .share-link-input:focus {
  border-color: var(--primary-color-dark);
  background: var(--surface-color-dark);
}

/* Mobile: hacer que el contenedor de compartir sea responsive */
@media (max-width: 768px) {
  .share-link-container {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .share-link-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.875rem 1rem;
  }
  
  .share-link-container .btn {
    width: 100%;
    justify-content: center;
  }
}

.share-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--primary-color-rgb), 0.1);
  border-radius: 6px;
  color: var(--primary-color);
  font-size: 0.875rem;
  animation: fadeIn 0.3s ease;
}

.dark-mode .share-status {
  background: rgba(var(--primary-color-dark-rgb), 0.1);
  color: var(--primary-color-dark);
}

.share-status svg {
  flex-shrink: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary-light);
  border-radius: 0 0 12px 12px;
}

.dark-mode .modal-footer {
  background: var(--bg-secondary-dark);
}

.modal-footer button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
  font-weight: 400;
}

.modal-footer .btn-secondary {
  background: transparent;
  color: var(--text-secondary-light);
}

.dark-mode .modal-footer .btn-secondary {
  color: var(--text-secondary-dark);
}

.modal-footer .btn-secondary:hover {
  background: var(--bg-color-light);
  color: var(--text-primary-light);
}

.dark-mode .modal-footer .btn-secondary:hover {
  background: var(--bg-color-dark);
  color: var(--text-primary-dark);
}

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

.dark-mode .modal-footer .btn-primary {
  background: var(--primary-color-dark);
}

.modal-footer .btn-primary:hover {
  background: var(--primary-color);
  opacity: 0.9;
}

.dark-mode .modal-footer .btn-primary:hover {
  background: var(--primary-color-dark);
  opacity: 0.9;
}

.modal-footer button:active {
  transform: scale(0.95);
}

.close {
  color: var(--text-secondary-light);
  font-size: 1.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.dark-mode .close {
  color: var(--text-secondary-dark);
}

.close:hover {
  background-color: var(--bg-color-light);
  color: var(--text-primary-light);
}

.dark-mode .close:hover {
  background-color: var(--bg-color-dark);
  color: var(--text-primary-dark);
}

.close:active {
  transform: scale(0.95);
}

.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  margin-bottom: 1rem;
  padding-left: 0;
  line-height: 1.6;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background-color: var(--surface-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  min-width: 200px;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.dark-mode .context-menu {
  background-color: var(--surface-color-dark);
  border-color: var(--border-color-dark);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  color: var(--text-primary-light);
}

.dark-mode .context-menu-item {
  color: var(--text-primary-dark);
}

.context-menu-item:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .context-menu-item:hover {
  background-color: var(--bg-color-dark);
}

.context-menu-item-danger {
  color: var(--danger-color);
}

.context-menu-item-danger:hover {
  background-color: rgba(255, 59, 48, 0.1);
}

/* Mobile: evitar que el menú contextual se salga de la pantalla */
@media (max-width: 768px) {
  .context-menu {
    /* Aumentar tamaño de opciones para mejor usabilidad en móvil */
    min-width: 220px;
  }
  
  .context-menu-item {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .context-menu-item svg {
    width: 20px;
    height: 20px;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  background-color: var(--surface-color-dark);
  color: white;
  box-shadow: var(--shadow-lg);
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transform: translateX(400px);
  transition: all 0.3s ease;
  font-weight: 600;
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.toast.error {
  background-color: var(--danger-color);
}

/* Search Modal */
.search-modal {
  align-items: flex-start;
  padding-top: 10vh;
}

.search-modal-content {
  max-width: 600px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.search-modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dark-mode .search-modal-header {
  border-bottom-color: var(--border-color-dark);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-primary-light);
  outline: none;
  font-family: inherit;
}

.dark-mode .search-input {
  color: var(--text-primary-dark);
}

.search-input::placeholder {
  color: var(--text-secondary-light);
}

.dark-mode .search-input::placeholder {
  color: var(--text-secondary-dark);
}

.search-close {
  background: transparent;
  border: none;
  color: var(--text-secondary-light);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dark-mode .search-close {
  color: var(--text-secondary-dark);
}

.search-close:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .search-close:hover {
  background-color: var(--bg-color-dark);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary-light);
}

.dark-mode .search-empty {
  color: var(--text-secondary-dark);
}

.search-result-item {
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-result-item:hover {
  background-color: var(--bg-color-light);
}

.dark-mode .search-result-item:hover {
  background-color: var(--bg-color-dark);
}

.search-result-icon {
  font-size: 1.2rem;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.search-result-program {
  font-size: 0.85rem;
  color: var(--text-secondary-light);
}

.dark-mode .search-result-program {
  color: var(--text-secondary-dark);
}

/* Program Selector in Modal */
.program-selector {
  margin-top: 1.5rem;
}

.program-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.program-selector-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary-light);
  margin: 0;
}

.dark-mode .program-selector-label {
  color: var(--text-primary-dark);
}

/* Dropdown personalizado */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-trigger {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-primary-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
}

.dropdown-trigger:hover {
  border-color: var(--primary-color);
}

.dropdown-trigger:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.dropdown-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-arrow {
  color: var(--text-secondary-light);
  transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--surface-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 0.25rem;
}

.custom-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color-light);
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: var(--bg-color-light);
}

.dropdown-option.selected {
  background-color: rgba(0, 122, 255, 0.1);
  color: var(--primary-color);
}

.dropdown-option .program-icon-container {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-option .program-icon {
  width: 16px;
  height: 16px;
}

.dropdown-option .program-name {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Modo oscuro */
.dark-mode .dropdown-trigger {
  background: transparent;
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.dark-mode .dropdown-trigger:hover {
  border-color: var(--primary-color-dark);
}

.dark-mode .dropdown-trigger:focus {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.dark-mode .dropdown-arrow {
  color: var(--text-secondary-dark);
}

.dark-mode .dropdown-menu {
  background-color: var(--surface-color-dark);
  border-color: var(--border-color-dark);
}

.dark-mode .dropdown-option {
  border-bottom-color: var(--border-color-dark);
}

.dark-mode .dropdown-option:hover {
  background-color: var(--bg-color-dark);
}

.dark-mode .dropdown-option.selected {
  background-color: rgba(10, 132, 255, 0.1);
  color: var(--primary-color-dark);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  border-radius: 6px;
  font-weight: 400;
  white-space: nowrap;
  font-family: inherit;
}

.dark-mode .btn-link {
  color: var(--primary-color-dark);
}

.btn-link:hover {
  background: var(--bg-color-light);
  color: var(--primary-color);
}

.dark-mode .btn-link:hover {
  background: var(--bg-color-dark);
  color: var(--primary-color-dark);
}

.btn-link:active {
  transform: scale(0.95);
}

/* Input Group Styles (for modals) */
.input-group {
  margin-top: 1.5rem;
}

.input-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary-light);
  margin-bottom: 0.5rem;
}

.dark-mode .input-label {
  color: var(--text-primary-dark);
}

.input-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary-light);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.dark-mode .input-hint {
  color: var(--text-secondary-dark);
}

/* Edit Block Modal - Minimalist Style */
.edit-block-field {
  margin-bottom: 2rem;
}

.edit-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-secondary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .edit-field-label {
  color: var(--text-secondary-dark);
}

.edit-field-input {
  width: 100%;
  background-color: var(--bg-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-primary-light);
  font-family: inherit;
  transition: all 0.2s ease;
}

.edit-field-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.edit-field-input::placeholder {
  color: var(--text-secondary-light);
}

.dark-mode .edit-field-input {
  background-color: var(--bg-color-dark);
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.dark-mode .edit-field-input:focus {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.1);
}

.dark-mode .edit-field-input::placeholder {
  color: var(--text-secondary-dark);
}

.edit-time-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-time-input {
  flex: 1;
  background-color: var(--bg-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary-light);
  text-align: center;
  font-family: inherit;
  transition: all 0.2s ease;
}

.edit-time-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.dark-mode .edit-time-input {
  background-color: var(--bg-color-dark);
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.dark-mode .edit-time-input:focus {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.1);
}

.time-separator {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary-light);
  margin: 0 0.25rem;
}

.dark-mode .time-separator {
  color: var(--text-secondary-dark);
}

.edit-time-field {
  width: 100%;
  background-color: var(--bg-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary-light);
  text-align: center;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: 2px;
  transition: all 0.2s ease;
}

.edit-time-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.edit-time-field::placeholder {
  color: var(--text-secondary-light);
  font-weight: 400;
}

.dark-mode .edit-time-field {
  background-color: var(--bg-color-dark);
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.dark-mode .edit-time-field:focus {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.dark-mode .edit-time-field::placeholder {
  color: var(--text-secondary-dark);
}

.time-field {
  width: 100%;
  background-color: var(--bg-color-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary-light);
  text-align: center;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: 2px;
  transition: all 0.2s ease;
}

.time-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.time-field::placeholder {
  color: var(--text-secondary-light);
  font-weight: 400;
}

.dark-mode .time-field {
  background-color: var(--bg-color-dark);
  border-color: var(--border-color-dark);
  color: var(--text-primary-dark);
}

.dark-mode .time-field:focus {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.dark-mode .time-field::placeholder {
  color: var(--text-secondary-dark);
}

.edit-textarea {
  resize: none;
  overflow: hidden;
  min-height: 2.5rem;
  max-height: 7.5rem; /* 5 líneas aproximadamente */
  line-height: 1.5;
}

.edit-textarea.scrollable {
  overflow-y: auto;
}

/* Estilo del scroll para el textarea */
.edit-textarea.scrollable::-webkit-scrollbar {
  width: 6px;
}

.edit-textarea.scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.edit-textarea.scrollable::-webkit-scrollbar-thumb {
  background: var(--text-secondary-light);
  border-radius: 3px;
}

.edit-textarea.scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary-light);
}

.dark-mode .edit-textarea.scrollable::-webkit-scrollbar-thumb {
  background: var(--text-secondary-dark);
}

.dark-mode .edit-textarea.scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary-dark);
}

.btn-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Program Customization */
.modal-new-timer {
  max-width: 500px;
  width: 90%;
}

.customize-section {
  margin-bottom: 1.2rem;
}

.customize-section h3 {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: var(--text-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .customize-section h3 {
  color: var(--text-primary-dark);
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  max-width: 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color-light);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
}

.dark-mode .color-option {
  border-color: var(--border-color-dark);
}

.color-option:hover {
  transform: scale(1.15);
  border-color: var(--text-primary-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dark-mode .color-option:hover {
  border-color: var(--text-primary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
  transform: scale(1.1);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.icon-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  width: 100%;
  padding: 0.2rem;
}

.icon-option {
  width: 100%;
  aspect-ratio: 1;
  max-width: 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color-light);
  background-color: var(--surface-color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin: 0 auto;
}

.dark-mode .icon-option {
  border-color: var(--border-color-dark);
  background-color: var(--surface-color-dark);
}

.icon-option:hover {
  background-color: var(--bg-color-light);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.dark-mode .icon-option:hover {
  background-color: var(--bg-color-dark);
}

.icon-option.selected {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.icon-option svg {
  width: 20px;
  height: 20px;
  color: inherit;
}

/* ============================================
   STOPWATCH WORKSPACE
   ============================================ */

.stopwatch-workspace {
  animation: fadeIn 0.3s ease;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.stopwatch-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem 0;
}

.stopwatch-display-container {
  text-align: center;
  width: 100%;
}

.stopwatch-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dark-mode .stopwatch-label {
  color: var(--text-secondary-dark);
}

.stopwatch-display {
  font-size: 6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary-light);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.dark-mode .stopwatch-display {
  color: var(--text-primary-dark);
}

.stopwatch-display.warning {
  color: #f59e0b;
}

.stopwatch-display.danger {
  color: #ef4444;
}

.stopwatch-target-info {
  font-size: 1rem;
  color: var(--text-secondary-light);
  margin-bottom: 1.5rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.dark-mode .stopwatch-target-info {
  color: var(--text-secondary-dark);
}

.stopwatch-target-info span:last-child {
  font-weight: 600;
  color: var(--text-primary-light);
}

.dark-mode .stopwatch-target-info span:last-child {
  color: var(--text-primary-dark);
}

.stopwatch-progress-bar {
  width: 100%;
  max-width: 600px;
  height: 8px;
  background: var(--bg-color-light);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

.dark-mode .stopwatch-progress-bar {
  background: var(--bg-color-dark);
}

.stopwatch-progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 4px;
  width: 0%;
}

.dark-mode .stopwatch-progress-fill {
  background: var(--primary-color-dark);
}

.stopwatch-progress-fill.warning {
  background: #f59e0b;
}

.stopwatch-progress-fill.danger {
  background: #ef4444;
}

.stopwatch-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.btn-icon-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.dark-mode .btn-icon-large {
  background: var(--primary-color-dark);
  box-shadow: 0 4px 12px rgba(var(--primary-color-dark-rgb), 0.3);
}

.btn-icon-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.4);
}

.dark-mode .btn-icon-large:hover {
  box-shadow: 0 6px 16px rgba(var(--primary-color-dark-rgb), 0.4);
}

.btn-icon-large:active {
  transform: translateY(0);
}

.btn-icon-large.btn-secondary {
  background: var(--bg-color-light);
  color: var(--text-primary-light);
  border: 2px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark-mode .btn-icon-large.btn-secondary {
  background: var(--bg-color-dark);
  color: var(--text-primary-dark);
  border-color: var(--border-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-icon-large.btn-secondary:hover {
  background: var(--bg-hover-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .btn-icon-large.btn-secondary:hover {
  background: var(--bg-hover-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */


/* ============================================
   MOBILE HEADER AND MENU
   ============================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface-color-light);
  border-bottom: 1px solid var(--border-color-light);
  z-index: 1001;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode .mobile-header {
  background: var(--surface-color-dark);
  border-bottom-color: var(--border-color-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary-light);
  margin: 0;
  flex: 1;
  text-align: center;
  padding-right: 44px; /* Compensate for menu button width */
  pointer-events: none; /* Don't block clicks on menu button */
}

.dark-mode .mobile-header-title {
  color: var(--text-primary-dark);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary-light);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.dark-mode .mobile-menu-toggle span {
  background: var(--text-primary-dark);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */
@media (max-width: 1024px) {
  .main-content {
    padding: 1.5rem;
  }
  
  .timer-display {
    gap: 1rem;
  }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-overlay {
    display: block;
  }
  
  /* Hide collapse toggle button on mobile */
  .collapse-toggle {
    display: none !important;
  }
  
  .left-sidebar {
    transform: translateX(-100%);
    width: 90%;
    max-width: 90vw;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }
  
  .dark-mode .left-sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }
  
  .left-sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Always show sidebar as expanded on mobile */
  .left-sidebar.collapsed {
    width: 90%;
    max-width: 90vw;
    transform: translateX(-100%);
  }
  
  .left-sidebar.collapsed.mobile-open {
    transform: translateX(0);
  }
  
  .left-sidebar.collapsed .logo-text,
  .left-sidebar.collapsed .new-timer-btn .text,
  .left-sidebar.collapsed .new-stopwatch-btn .text,
  .left-sidebar.collapsed .sidebar-section-title,
  .left-sidebar.collapsed .timer-item-name,
  .left-sidebar.collapsed .program-name,
  .left-sidebar.collapsed .program-count,
  .left-sidebar.collapsed .sidebar-action-text {
    display: block;
  }
  
  .left-sidebar.collapsed .sidebar-section {
    visibility: visible;
    padding: 0.75rem;
  }
  
  .left-sidebar.collapsed .sidebar-section * {
    display: block;
  }

  .main-content {
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 80px; /* Account for mobile header */
  }

  body:has(.left-sidebar.collapsed) .main-content,
  body:has(.left-sidebar.mobile-open) .main-content {
    left: 0;
  }
  
  .workspace-header {
    margin-bottom: 1.5rem;
  }
  
  .timer-header-info {
    margin-bottom: 1rem;
  }
  
  .current-timer-name {
    font-size: 1.5rem;
  }

  .welcome-screen {
    min-height: calc(100vh - 100px);
    padding: 2rem 1rem;
  }

  .welcome-title {
    font-size: 2.25rem;
    font-weight: 700;
    white-space: normal;
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }

  .welcome-subtitle {
    font-size: 1.125rem;
    white-space: normal;
    margin-bottom: 2rem;
    line-height: 1.4;
  }
  
  .welcome-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    gap: 1rem;
  }
  
  .btn-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  .timer-display {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 100%;
  }
  
  .timer-card-modern {
    padding: 1.5rem 1rem;
  }
  
  .timer-modern {
    font-size: 2.75rem;
    font-weight: 700;
  }
  
  .controls {
    max-width: 100%;
  }
  
  .control-btn {
    width: 50px;
    height: 50px;
  }
  
  .control-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .control-btn-play {
    width: 60px;
    height: 60px;
  }
  
  .control-btn-play svg {
    width: 22px;
    height: 22px;
  }
  
  .controls-secondary {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .control-toggle-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  .control-toggle-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .block-details-modern {
    padding: 1rem;
    max-width: 100%;
  }
  
  .block-details-icon {
    width: 32px;
    height: 32px;
  }
  
  .block-details-title {
    font-size: 0.8125rem;
  }
  
  .block-details-description {
    font-size: 0.8125rem;
  }
  
  .block-editor-modern {
    max-width: 100%;
  }
  
  .editor-title {
    font-size: 1rem;
  }
  
  .input-group-modern {
    padding: 1rem;
  }
  
  .input-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .input-time {
    width: 100%;
  }
  
  .btn-add-block {
    width: 100%;
  }
  
  .block-item {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }
  
  .block-time {
    min-width: 70px;
    font-size: 0.875rem;
  }
  
  .block-content strong {
    font-size: 0.875rem;
  }
  
  .block-content span {
    font-size: 0.75rem;
  }
  
  .block-actions {
    opacity: 1;
  }
  
  .block-actions button {
    padding: 0.4rem;
  }
  
  /* Modals responsive */
  .modal-content {
    margin: 2rem 1rem;
    max-width: calc(100% - 2rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  .modal-header h2 {
    font-size: 1.25rem;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
  }

  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  /* Stopwatch responsive */
  .stopwatch-display-container {
    padding: 2rem 1rem;
  }
  
  .stopwatch-display {
    font-size: 4.5rem;
    font-weight: 800;
  }
  
  .stopwatch-controls {
    gap: 1rem;
  }

  .btn-icon-large {
    width: 60px;
    height: 60px;
  }
  
  .btn-icon-large svg {
    width: 26px;
    height: 26px;
  }
  
  /* Context menus */
  .context-menu {
    max-width: calc(100vw - 2rem);
  }
  
  /* Dropdowns */
  .dropdown-menu {
    max-height: 250px;
  }
}

/* ============================================
   RESPONSIVE DESIGN - SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
  .mobile-menu-toggle {
    width: 40px;
    height: 40px;
  }
  
  .mobile-menu-toggle span {
    width: 18px;
  }
  
  .current-timer-name {
    font-size: 1.25rem;
  }
  
  .welcome-title {
    font-size: 2rem;
  }
  
  .welcome-subtitle {
    font-size: 1.1rem;
  }

  .timer-modern {
    font-size: 2.5rem;
    font-weight: 700;
  }
  
  .timer-card-label {
    font-size: 0.7rem;
  }
  
  .control-btn {
    width: 44px;
    height: 44px;
  }
  
  .control-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .control-btn-play {
    width: 52px;
    height: 52px;
  }
  
  .control-btn-play svg {
    width: 20px;
    height: 20px;
  }
  
  .control-toggle-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }
  
  .control-toggle-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .block-details-modern {
    padding: 0.875rem;
  }
  
  .editor-title {
    font-size: 0.9rem;
  }
  
  .editor-subtitle {
    font-size: 0.75rem;
  }
  
  .input-modern {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }
  
  .btn-add-block {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
  
  .stopwatch-display {
    font-size: 4rem;
    font-weight: 800;
  }
  
  .stopwatch-label {
    font-size: 0.7rem;
  }
  
  .btn-icon-large {
    width: 52px;
    height: 52px;
  }
  
  .btn-icon-large svg {
    width: 22px;
    height: 22px;
  }
  
  .modal-content {
    margin: 1rem 0.75rem;
    max-width: calc(100% - 1.5rem);
  }
  
  .btn-icon {
    padding: 0.25rem;
    min-width: 28px;
    height: 28px;
  }
  
  .btn-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .welcome-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-large {
    width: 100%;
  }
}

/* ============================================
   TUTORIAL MODAL STYLES
   ============================================ */

.modal-tutorial {
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tutorial-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  position: relative;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.dark-mode .tutorial-header {
  background: linear-gradient(135deg, var(--primary-color-dark), var(--secondary-color));
}

.tutorial-header-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.tutorial-header-icon svg {
  width: 32px;
  height: 32px;
}

.tutorial-header-text h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.tutorial-header-text p {
  margin: 0.375rem 0 0 0;
  font-size: 0.9375rem;
  opacity: 0.9;
  color: white;
}

.tutorial-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.tutorial-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.tutorial-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--surface-color-light);
}

.dark-mode .tutorial-body {
  background: var(--surface-color-dark);
}

.tutorial-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-color-light);
  border-radius: 12px;
  border: 1px solid var(--border-color-light);
  transition: all 0.3s ease;
}

.dark-mode .tutorial-section {
  background: var(--bg-color-dark);
  border-color: var(--border-color-dark);
}

.tutorial-section:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dark-mode .tutorial-section:hover {
  border-color: var(--primary-color-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tutorial-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tutorial-section-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary-light);
}

.dark-mode .tutorial-section-header h3 {
  color: var(--text-primary-dark);
}

.tutorial-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tutorial-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tutorial-list li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  color: var(--text-primary-light);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.dark-mode .tutorial-list li {
  color: var(--text-primary-dark);
}

.tutorial-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  align-self: flex-start;
  white-space: nowrap;
}

.dark-mode .tutorial-badge {
  background: var(--primary-color-dark);
}

.tutorial-badge.mode-auto {
  background: linear-gradient(135deg, #10b981, #059669);
}

.tutorial-badge.mode-manual {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tutorial-shortcuts {
  background: var(--surface-color-light);
  border: 2px dashed var(--border-color-light);
}

.dark-mode .tutorial-shortcuts {
  background: var(--surface-color-dark);
  border-color: var(--border-color-dark);
}

.tutorial-tips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.tutorial-tip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-color-light);
  border-radius: 8px;
  color: var(--text-primary-light);
  font-size: 0.875rem;
  border-left: 3px solid var(--primary-color);
}

.dark-mode .tutorial-tip {
  background: var(--bg-color-dark);
  color: var(--text-primary-dark);
  border-left-color: var(--primary-color-dark);
}

.tutorial-tip svg {
  flex-shrink: 0;
  color: var(--primary-color);
}

.dark-mode .tutorial-tip svg {
  color: var(--primary-color-dark);
}

.tutorial-footer {
  text-align: center;
  padding: 1.5rem 0 0 0;
  margin-top: 1rem;
  border-top: 2px solid var(--border-color-light);
}

.dark-mode .tutorial-footer {
  border-top-color: var(--border-color-dark);
}

.tutorial-footer p {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary-light);
  margin: 0 0 0.5rem 0;
}

.dark-mode .tutorial-footer p {
  color: var(--text-primary-dark);
}

.tutorial-version {
  font-size: 0.8125rem;
  color: var(--text-secondary-light);
  font-weight: 500;
}

.dark-mode .tutorial-version {
  color: var(--text-secondary-dark);
}

/* Tutorial Responsive */
@media (max-width: 768px) {
  .modal-tutorial {
    max-width: calc(100% - 2rem);
    max-height: 70vh;
    margin: 1rem;
  }
  
  .tutorial-header {
    padding: 1.25rem;
    gap: 1rem;
  }
  
  .tutorial-header-icon {
    width: 48px;
    height: 48px;
  }
  
  .tutorial-header-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .tutorial-header-text h2 {
    font-size: 1.375rem;
  }
  
  .tutorial-header-text p {
    font-size: 0.875rem;
  }
  
  .tutorial-close {
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
  }
  
  .tutorial-body {
    padding: 1.25rem;
  }
  
  .tutorial-section {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .tutorial-section-header {
    gap: 0.75rem;
  }
  
  .tutorial-section-header h3 {
    font-size: 1.125rem;
  }
  
  .tutorial-icon {
    width: 40px;
    height: 40px;
  }
  
  .tutorial-list {
    gap: 0.875rem;
  }
  
  .tutorial-list li {
    font-size: 0.875rem;
  }
  
  .tutorial-badge {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .modal-tutorial {
    max-width: 100%;
    max-height: 70vh;
    margin: 0;
    border-radius: 0;
  }
  
  .tutorial-header {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  
  .tutorial-header-icon {
    width: 44px;
    height: 44px;
  }
  
  .tutorial-header-text h2 {
    font-size: 1.25rem;
  }
  
  .tutorial-header-text p {
    font-size: 0.8125rem;
  }
  
  .tutorial-body {
    padding: 1rem;
  }
  
  .tutorial-section {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }
  
  .tutorial-section-header h3 {
    font-size: 1rem;
  }
  
  .tutorial-icon {
    width: 36px;
    height: 36px;
  }
  
  .tutorial-list li {
    font-size: 0.8125rem;
  }
  
  .tutorial-tip {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }
}
