/* Range Day Pro PWA — minimal utility CSS.
   Basic/functional styling; visual parity effort is a separate future item. */

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

body { font-family: system-ui, -apple-system, sans-serif; line-height: 1.5; }

/* Layout */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.block { display: block; }
.hidden { display: none; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-auto { overflow: auto; }
.relative { position: relative; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pb-20 { padding-bottom: 5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* Sizing */
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: #fff; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-yellow-50 { background-color: #fffbeb; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-white { color: #fff; }
.text-blue-600 { color: #2563eb; }
.text-green-700 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-yellow-800 { color: #92400e; }
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-green-200 { border-color: #bbf7d0; }
.border-red-200 { border-color: #fecaca; }
.border-yellow-200 { border-color: #fde68a; }

/* Components */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06); }
.shadow-top { box-shadow: 0 -1px 3px rgba(0,0,0,0.1); }

/* Forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
    border: 1px solid #d1d5db;
    outline: none;
    font-size: 1rem;
}
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: #3b82f6;
}

/* Buttons */
button { cursor: pointer; border: none; font-size: 1rem; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:underline:hover { text-decoration: underline; }
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* Links */
a { text-decoration: none; color: inherit; }

/* Tab bar — fixed bottom on mobile */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0.25rem 0;
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
    z-index: 50;
}
.tab-bar a, .tab-bar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0;
    font-size: 0.625rem;
    color: #6b7280;
    background: none;
    border: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.tab-bar a.active, .tab-bar button.active {
    color: #2563eb;
}

/* Offline banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    z-index: 100;
}

/* Profile list items */
.profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}
.profile-item:hover {
    background-color: #f9fafb;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: #d1d5db;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    padding: 0;
}
.toggle.on {
    background: #2563eb;
}
.toggle::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle.on::after {
    transform: translateX(1.25rem);
}

/* Drill cards */
.drill-card {
    display: flex;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: left;
}
.drill-card:hover {
    background: #f9fafb;
}

/* Drill type badges */
.drill-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.drill-badge-live {
    background: #fef2f2;
    color: #b91c1c;
}
.drill-badge-dry {
    background: #f0fdf4;
    color: #15803d;
}

/* Queue link with badge */
.queue-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #2563eb;
    cursor: pointer;
}
.queue-link:hover {
    text-decoration: underline;
}
.queue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    border-radius: 9999px;
}

/* Zone counter rows */
.zone-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.75rem; /* 44px for tap targets */
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.zone-counter-row:last-child {
    border-bottom: none;
}
.zone-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}
.zone-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.zone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; /* 44px */
    height: 2.75rem; /* 44px */
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zone-btn:hover {
    background: #e5e7eb;
}
.zone-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.zone-count {
    min-width: 2rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* Score entry form */
.score-preview {
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
}

/* Pass/Fail buttons */
.pass-fail-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    font-weight: 500;
    cursor: pointer;
}
.pass-fail-active {
    background: #f0fdf4;
    border-color: #15803d;
    color: #15803d;
}
.pass-fail-fail-active {
    background: #fef2f2;
    border-color: #b91c1c;
    color: #b91c1c;
}

/* Score cards in history */
.score-card {
    display: flex;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: left;
}
.score-card:hover {
    background: #f9fafb;
}

/* Score detail rows */
.score-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.score-detail-row:last-child {
    border-bottom: none;
}
.score-detail-label {
    font-size: 0.875rem;
    color: #6b7280;
}
.score-detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

/* Score zone breakdown table */
.score-zone-table {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
}
.score-zone-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}
.score-zone-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
}

/* Void confirmation overlay */
.void-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}
.void-confirm-dialog {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 20rem;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* Queue management */
.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}
.queue-item-failed {
    border-color: #fecaca;
    background: #fef2f2;
}
