@import url('./base-tokens.css');

:root {
      --bg: #f8fafc;
      --card: #ffffff;
      --text: #0f172a;
      --muted: #64748b;
      --primary: #7c3aed;
      --border: #e2e8f0;
      --highlight: #f0f9ff;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --bg: #0f172a;
        --card: #1e293b;
        --text: #f1f5f9;
        --muted: #94a3b8;
        --border: #334155;
        --highlight: #1e293b;
      }
    }

    body {
      font-family: system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      margin: 0;
      /* tighter gutters, keep space for fixed controls */
      padding: 12px;
      padding-top: 60px;
      padding-left: clamp(6px, 2vw, 10px);
      padding-right: clamp(6px, 2vw, 10px);
    }

    .container {
      max-width: 768px; /* was 720px */
      margin: 0 auto;
    }

    .back-link {
      display: inline-block;
      margin-bottom: 16px;
      color: var(--primary);
      text-decoration: none;
      font-weight: 500;
    }

    .results {
      border: 0.5px solid var(--border);
      border-radius: 6px;
      padding: 12px;
    }

    h2 {
      margin-top: 0;
    }

    .muted {
      color: var(--muted);
    }
    
    .verse-container {
      margin-top: 20px;
      border-bottom: 0.5px solid var(--border);
      padding-bottom: 12px;
      margin-bottom: 12px;
    }
    
    .verse-reference {
      font-weight: bold;
      font-size: 1.1rem;
      margin-bottom: 8px;
    }
    
    .translation {
      margin-bottom: 10px;
      padding: 10px;
      border-radius: 4px;
      position: relative;
    }
    
    .translation-name {
      margin-bottom: 3px;
      font-size: 0.85rem;
      font-weight: 600;
    }
    
    .able { border-left: 3px solid var(--primary); }
    .kjv  { border-left: 3px solid #94a3b8; }
    .bsb  { border-left: 3px solid #64748b; }
    .cuv  { border-left: 3px solid #ef4444; }

    .verse-text {
      line-height: 1.6;
    }
    
    .actions {
      margin-top: 20px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    
    .action-link {
      padding: 5px 10px;
      border: 0.5px solid var(--border);
      border-radius: 4px;
      font-size: 0.88rem;
      text-decoration: none;
      color: var(--primary);
    }
    
    .action-link:hover {
      background: var(--highlight);
    }
    
    .copy-btn {
      border: 0.5px solid var(--border);
      padding: 3px 7px;
      font-size: 0.78rem;
      border-radius: 3px;
      position: absolute;
      right: 8px;
      top: 8px;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    
    .copy-btn:hover {
      background-color: var(--highlight);
      color: var(--primary);
    }
    
    .copy-btn.copied {
      background-color: #10b981;
      color: white;
      border-color: #10b981;
    }
    
    .copy-icon {
      width: 14px;
      height: 14px;
    }
    
    /* Search bar styles */
    .search-container {
      margin-bottom: 24px;
    }
    
    .input-group {
      display: flex;
      gap: 8px;
    }
    
    .form-control {
      flex: 1;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 0.9rem;
    }
    
    .btn-primary {
      background-color: var(--primary);
      border: none;
      color: white;
      padding: 10px 16px;
      border-radius: 4px;
      font-size: 0.9rem;
      cursor: pointer;
      transition: background-color 0.2s;
    }
    
    .btn-primary:hover {
      background-color: #6d28d9;
    }

    /* Emoji toggle styles */
    .emoji-toggle-container {
      margin-bottom: 24px;
    }
    
    .form-check {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .form-check-input {
      cursor: pointer;
    }
    
    .form-check-label {
      cursor: pointer;
      user-select: none;
    }

    /* Hide emojis when toggle is off */
    body.hide-emojis .verse-text {
      font-family: system-ui, sans-serif;
    }

    body.hide-emojis .verse-text::after {
      content: '';
    }

    /* More specific emoji hiding using regex-like approach */
    body.hide-emojis .verse-text {
      position: relative;
    }

    /* Alternative approach: Use JavaScript to filter emojis */
    .emoji-hidden {
      display: none;
    }

    /* Pagination styles */
    .pagination {
      margin-top: 28px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    
    .pagination-info {
      font-size: 0.9rem;
      color: var(--muted);
    }
    
    .pagination-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
    }
    
    .page-link {
      padding: 5px 10px;
      border: 0.5px solid var(--border);
      border-radius: 3px;
      text-decoration: none;
      color: var(--text);
      font-size: 0.88rem;
      transition: all 0.2s;
    }
    
    .page-link:hover:not(.disabled):not(.current) {
      background: var(--highlight);
      color: var(--primary);
    }
    
    .page-link.current {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    
    .page-link.disabled {
      color: var(--muted);
      cursor: not-allowed;
    }
    
    .page-link.ellipsis {
      padding: 5px 4px;
      border: none;
    }
    
    .page-link.prev,
    .page-link.next {
      font-weight: 500;
    }
    
    /* Jesus text highlighting */
    jesus {
      color: red;
      font-weight: 500;
    }

    /* Disambiguation styles */
    .disambiguation {
      background: var(--highlight);
      padding: 12px;
      border-radius: 6px;
      margin-top: 16px;
      font-size: 0.9rem;
    }

    .disambiguation a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 500;
    }

    .disambiguation a:hover {
      text-decoration: underline;
    }

    /* New disambiguation box styles */
    .disambiguation-box {
      background: var(--highlight);
      border: 1px solid var(--border);
      padding: 16px;
      border-radius: 8px;
      margin: 20px 0;
    }
    
    .disambiguation-box p {
      margin: 0 0 10px 0;
      font-weight: 500;
    }
    
    .disambiguation-options {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
    }
    
    .disambiguation-option {
      padding: 8px 16px;
      background: white;
      border: 1px solid var(--border);
      border-radius: 4px;
      text-decoration: none;
      color: var(--primary);
    }
    
    .disambiguation-option:hover {
      background: var(--primary);
      color: white;
    }
    
    .or {
      color: var(--muted);
    }

    /* QR Code Modal styles */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s, visibility 0.3s;
    }
    
    .modal-overlay.visible {
      opacity: 1;
      visibility: visible;
    }
    
    .modal-content {
      background-color: var(--card);
      border-radius: 12px;
      padding: 24px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
      max-width: 90%;
      width: 350px;
      text-align: center;
      position: relative;
      transform: translateY(20px);
      transition: transform 0.3s;
    }
    
    .modal-overlay.visible .modal-content {
      transform: translateY(0);
    }
    
    .modal-title {
      margin-top: 0;
      margin-bottom: 16px;
      font-size: 1.4rem;
    }
    
    .modal-close {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--bg);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .qrcode-container {
      padding: 15px;
      background-color: white;
      border-radius: 8px;
      display: inline-block;
      margin-bottom: 15px;
    }
    
    /* QR code tabs */
    .qr-tabs {
      display: flex;
      gap: 5px;
      margin-bottom: 15px;
      justify-content: center;
    }
    
    .qr-tab {
      padding: 6px 12px;
      border-radius: 16px;
      background: var(--bg);
      border: 1px solid var(--border);
      cursor: pointer;
      font-size: 0.9rem;
      transition: all 0.2s;
    }
    
    .qr-tab.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    
    .qr-tab:hover:not(.active) {
      background: var(--highlight);
    }
    
    .qrcode {
      display: none;
    }
    
    .qrcode.active {
      display: block;
    }
    
    /* QR code button */
    .qr-button {
      background-color: var(--primary);
      border: none;
      color: white;
      padding: 8px 14px;
      border-radius: 4px;
      font-size: 0.9rem;
      cursor: pointer;
      transition: background-color 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
    }
    
    .qr-button:hover {
      background-color: #6d28d9;
    }
    
    .qr-button svg {
      width: 16px;
      height: 16px;
    }
    
    .copy-error {
      background-color: #ef4444 !important;
      color: white !important;
      border-color: #ef4444 !important;
    }

    /* Use utilities instead of local duplicates:
       - replace custom button styles with .u-btn / .u-btn.secondary
       - replace card panels with .u-card
       - replace grids with .u-grid-2
       - use .u-muted for muted text */
