/* Distantec timer page styles. Extracted from index.html for caching and CSP readiness. */
:root {
      --bg: #0a0a0f;
      --surface: rgba(255,255,255,0.04);
      --surface-hover: rgba(255,255,255,0.07);
      --border: rgba(255,255,255,0.08);
      --border-active: rgba(99,102,241,0.45);
      --primary: #6366f1;
      --primary-light: #818cf8;
      --accent: #8b5cf6;
      --danger: #ef4444;
      --success: #22c55e;
      --text: #e2e8f0;
      --text-muted: #64748b;
      --text-sub: #94a3b8;
      --radius: 18px;
    }

    body {
      min-height: 100vh;
      background: var(--bg);
      background-image:
        radial-gradient(ellipse at 15% 40%, rgba(99,102,241,0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(139,92,246,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(59,130,246,0.08) 0%, transparent 50%);
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      color: var(--text);
      padding-bottom: 4rem;
      display: block;
      align-items: unset;
      justify-content: unset;
    }

    /* Override common.css conflicts */
    .container {
      max-width: none;
      background: none;
      backdrop-filter: none;
      border: none;
      border-radius: 0;
      padding: 0;
      box-shadow: none;
    }

    .header {
      margin-bottom: 0;
      text-align: unset;
    }

.header h1 {
      font-size: unset;
      font-weight: unset;
      background: unset;
      -webkit-background-clip: unset;
      -webkit-text-fill-color: unset;
    }

    /* Header */


/* Main content */
    main {
      max-width: 1100px;
      margin: 0 auto;
      padding: 1.35rem 1.5rem 2rem;
    }

    .empty-state {
      text-align: center;
      padding: 3.5rem 2rem 4rem;
      color: var(--text-muted);
    }
    .empty-state .icon { margin-bottom: 1rem; opacity: 0.45; color: var(--primary-light); }
    .empty-state .icon .ui-icon { width: 48px; height: 48px; }
    .empty-state p { font-size: 1rem; margin-bottom: 1.5rem; }

    /* Timer grid */
    #timers-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
      gap: 1.25rem;
      justify-content: center;
    }

    /* Timer Card */
    .timer-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.5rem;
      backdrop-filter: blur(10px);
      transition: border-color 0.3s, box-shadow 0.3s;
      position: relative;
      overflow: hidden;
    }

    .timer-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--primary), var(--accent));
      opacity: 0;
      transition: opacity 0.3s;
    }

    .timer-card.running {
      border-color: rgba(99,102,241,0.3);
      box-shadow: 0 0 30px rgba(99,102,241,0.08);
    }

    .timer-card.running::before { opacity: 1; }

    .timer-card.finished {
      border-color: rgba(239,68,68,0.4);
      box-shadow: 0 0 30px rgba(239,68,68,0.1);
    }

    .timer-card.finished::before {
      background: linear-gradient(90deg, var(--danger), #f97316);
      opacity: 1;
    }

    /* Blink animation for finished countdown */
    @keyframes blink-glow {
      0%, 100% {
        box-shadow: 0 0 30px rgba(239,68,68,0.1);
        border-color: rgba(239,68,68,0.4);
      }
      50% {
        box-shadow: 0 0 60px rgba(239,68,68,0.35), 0 0 100px rgba(239,68,68,0.15);
        border-color: rgba(239,68,68,0.8);
      }
    }

    .timer-card.blinking {
      animation: blink-glow 1s ease-in-out infinite;
    }

    /* Drag ghost / sortable states */
    .timer-card.sortable-ghost {
      opacity: 0.3;
    }

    .timer-card.sortable-chosen {
      box-shadow: 0 8px 40px rgba(99,102,241,0.35);
      border-color: var(--border-active);
    }

    .timer-card.sortable-drag {
      opacity: 1 !important;
      box-shadow: 0 16px 60px rgba(0,0,0,0.6);
    }

    /* Drag handle */
    .drag-handle {
      cursor: grab;
      color: var(--text-muted);
      font-size: 1.1rem;
      line-height: 1;
      padding: 0.15rem 0.25rem;
      border-radius: 5px;
      flex-shrink: 0;
      user-select: none;
      touch-action: none;
      transition: color 0.2s, background 0.2s;
    }
    .drag-handle:hover {
      color: var(--text-sub);
      background: rgba(255,255,255,0.06);
    }
    .drag-handle:active {
      cursor: grabbing;
    }

    /* Card header row */
    .card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 1rem;
      gap: 0.5rem;
    }

    .desc-input {
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--border);
      color: var(--text);
      font-size: 0.95rem;
      font-weight: 600;
      font-family: inherit;
      padding: 0.2rem 0;
      width: 100%;
      outline: none;
      transition: border-color 0.2s;
    }
    .desc-input:focus {
      border-bottom-color: var(--primary-light);
    }
    .desc-input::placeholder { color: var(--text-muted); font-weight: 400; }

    .btn-delete {
      flex-shrink: 0;
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 0.25rem;
      border-radius: 6px;
      font-size: 1rem;
      line-height: 1;
      transition: color 0.2s, background 0.2s;
    }
    .btn-delete:hover {
      color: var(--danger);
      background: rgba(239,68,68,0.1);
    }

    /* Mode toggle */
    .mode-toggle {
      display: flex;
      background: rgba(0,0,0,0.3);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 3px;
      margin-bottom: 1.2rem;
      gap: 2px;
    }

    .mode-toggle button {
      flex: 1;
      padding: 0.45rem;
      border: none;
      border-radius: 7px;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }

    .mode-toggle button.active {
      background: linear-gradient(135deg, var(--primary), var(--accent));
      color: #fff;
      box-shadow: 0 2px 10px rgba(99,102,241,0.3);
    }

    /* Countdown inputs */
    .countdown-inputs {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      margin-bottom: 1.2rem;
      justify-content: center;
    }

    .countdown-inputs input {
      width: 52px;
      text-align: center;
      background: rgba(0,0,0,0.3);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--text);
      font-size: 1rem;
      font-weight: 600;
      font-family: 'Courier New', monospace;
      padding: 0.4rem 0.2rem;
      outline: none;
      transition: border-color 0.2s;
    }

    .countdown-inputs input:focus {
      border-color: var(--primary-light);
    }

    .countdown-inputs .sep {
      color: var(--text-muted);
      font-size: 1.1rem;
      font-weight: 700;
    }

    /* Big time display */
    .time-display {
      font-size: 2.8rem;
      font-weight: 800;
      font-family: 'Courier New', Courier, monospace;
      text-align: center;
      margin-bottom: 1.25rem;
      letter-spacing: 0.03em;
      background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      transition: all 0.2s;
    }

    .timer-card.finished .time-display {
      background: linear-gradient(135deg, #fca5a5 0%, var(--danger) 100%);
      -webkit-background-clip: text;
      background-clip: text;
    }

    /* Card controls */
    .card-controls {
      display: flex;
      gap: 0.6rem;
      align-items: center;
    }

    .btn-start-pause {
      flex: 1;
      padding: 0.6rem;
      border: none;
      border-radius: 10px;
      font-size: 0.85rem;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s;
    }

    .btn-start-pause.start {
      background: linear-gradient(135deg, var(--success), #16a34a);
      color: #fff;
      box-shadow: 0 3px 12px rgba(34,197,94,0.25);
    }
    .btn-start-pause.start:hover {
      transform: translateY(-1px);
      box-shadow: 0 5px 16px rgba(34,197,94,0.35);
    }

    .btn-start-pause.pause {
      background: linear-gradient(135deg, #f59e0b, #d97706);
      color: #fff;
      box-shadow: 0 3px 12px rgba(245,158,11,0.25);
    }
    .btn-start-pause.pause:hover {
      transform: translateY(-1px);
      box-shadow: 0 5px 16px rgba(245,158,11,0.35);
    }

    .btn-reset-card {
      padding: 0.6rem 0.75rem;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
      color: var(--text-sub);
      font-size: 0.85rem;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      transition: all 0.2s;
    }
    .btn-reset-card:hover {
      background: var(--surface-hover);
      color: var(--text);
    }

    /* Running indicator dot */
    .running-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
      display: inline-block;
      margin-right: 0.3rem;
      animation: pulse-dot 1.5s ease-in-out infinite;
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.5; transform: scale(0.7); }
    }

    .status-running { color: var(--success); font-weight: 600; }

    /* Disabled state for card elements */
    .desc-input:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .mode-toggle button:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      pointer-events: none;
    }
    .btn-delete:disabled {
      opacity: 0.3;
      cursor: not-allowed;
      pointer-events: none;
    }
    .btn-reset-card:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }
    .countdown-inputs input:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* Presets bar */
    .presets-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      justify-content: center;
      min-height: 36px;
    }
    .preset-btn {
      display: inline-flex;
      align-items: center;
      padding: 0.4rem 0.9rem;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-sub);
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
      white-space: nowrap;
    }
    .preset-btn:hover {
      background: var(--surface-hover);
      border-color: rgba(99,102,241,0.4);
      color: var(--text);
    }
    .preset-btn:active {
      transform: scale(0.97);
    }

    /* Responsive */
@media (max-width: 720px) {
      main { padding: 1rem 1rem 2rem; }
      .time-display { font-size: 2.3rem; }
      #timers-grid { grid-template-columns: 1fr; }
    }

/* Local visibility utility so Timer is not dependent on a cached common.css. */
.is-hidden { display: none !important; }
