/* Framework7 iOS theme color overrides */
:root {
    --f7-theme-color: #007aff;
    --f7-theme-color-rgb: 0, 122, 255;
    --f7-theme-color-shade: #0062cc;
    --f7-theme-color-tint: #3395ff;

    /* Solid navbar — prevents frosted-glass blur from visually mismatching
       the plain-white iOS status bar area above the app viewport */
    --f7-bars-bg-color: #ffffff;
    --f7-bars-translucent-opacity: 1;
}

/* Hide empty navbar slots visually but keep in flex layout for centering */
.navbar-inner > .left:empty,
.navbar-inner > .right:empty {
    visibility: hidden;
    pointer-events: none;
}

/* Reset browser defaults for button elements used as F7 links */
button.link {
    background: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

/* F7 only styles a.link in navbar — match padding for button.link */
.navbar button.link {
    padding: 0 12px;
}

/* PIN overlay: avatar header locked above scrollable content */
.pin-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(2.5rem, env(safe-area-inset-top, 2.5rem)) 0 1.5rem;
    background: #fff;
}

.login-screen .login-screen-content {
    justify-content: center;
    flex: 1;
    min-height: 0;
}

/* Kid avatar circle — used by home.html and pin-overlay.html */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* PIN overlay dots — used by pin-overlay.html login-screen */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #333;
    margin: 0 6px;
}

.dot.filled { background: #333; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}

.shake { animation: shake 0.4s ease-in-out; }

/* Photo size constraints — used by kid/task-detail.html */
.proof-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.proof-thumbnail-lg {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Kid avatar sizes — used by balance.html review cards */
.kid-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.kid-avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Greeting icon in kid task-list navbar title */
.greeting-icon {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
    top: -1px;
}

/* Admin login link — discreet lock icon in bottom-right corner of home screen */
.admin-login-link {
    position: fixed;
    top: 1rem;
    right: 1rem;
    text-decoration: none;
    color: #007aff;
    opacity: 0.6;
    line-height: 1;
}

.admin-login-link .f7-icons {
    font-size: 22px;
}

/* Kid-friendly home page grid */
.kid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.5rem;
    padding: 2rem 1rem;
    justify-content: center;
}

.kid-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    text-decoration: none;
}

.kid-card:active {
    transform: scale(1.05);
}

.avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 2.2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    background-color: #007aff;
    text-decoration: none;
}

.kid-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Wider name slot on the profile page where space isn't constrained */
.profile-kid-name {
    max-width: 200px;
    margin: 0 auto;
}

/* Task detail header — title left, prize badge right */
.task-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.task-detail-header h2 {
    margin: 0;
    flex: 1;
}

/* Task pill — multi-line list item: title+prize on row 1, status label on row 2.
   F7's item-inner defaults to flex-direction:row; this switches it to column so
   item-title-row and item-subtitle stack vertically. */
.item-inner.task-pill {
    flex-direction: column;
    align-items: stretch;
}

/* Task page — prize and status badges */
.prize-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(52, 199, 89, 0.12);
    color: #1a6e30;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 10px 2px 6px;
    font-size: 0.85rem;
}

.prize-badge .f7-icons {
    font-size: 16px;
    line-height: 1;
    color: #34c759;
}

.status-badge-pending {
    background: #fff0d4;
    color: #a05700;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge-kid {
    background: #e5f0ff;
    color: #0055c8;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-claim {
    background: #34c759;
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.9rem 1.5rem;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.rejection-notice {
    background: #fff5f5;
    border-left: 4px solid #ff3b30;
    border-radius: 8px;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
}

/* Task detail — camera + drop button side-by-side row */
.task-action-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.task-drop-btn {
    min-height: 52px;
    border-radius: 9999px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    background: rgba(255, 59, 48, 0.1) !important;
    color: #ff3b30 !important;
    border: none !important;
}

/* Photo upload widget — two-phase: camera trigger → preview + submit + retake */
.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-take-btn.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 700;
    background: #34c759;
    color: white;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.photo-take-btn.button .f7-icons {
    font-size: 20px;
    line-height: 1;
}

.photo-phase-review {
    flex-direction: column;
    gap: 10px;
}

.photo-preview-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.photo-preview-img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

.photo-submit-btn.button {
    min-height: 52px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    background: #34c759;
    color: white;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.photo-retake-btn.button {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 600;
}

/* Profile page stat tiles */
.profile-stats {
    display: flex;
    align-items: center;
    text-align: center;
    padding: 4px 0;
}

.stat-item {
    flex: 1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
}

.stat-label {
    font-size: 0.7rem;
    color: #8e8e93;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(60, 60, 67, 0.18);
    margin: 2px 0;
    flex-shrink: 0;
}

/* Tappable avatar (profile page) */
.avatar-tappable {
    cursor: pointer;
    transition: transform 120ms ease-out;
}

.avatar-tappable:active {
    transform: scale(0.94);
}

/* Emoji inside avatar circles */
.avatar-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

/* Avatar picker section labels */
.avatar-section-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--f7-list-item-footer-text-color, #8e8e93);
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 16px;
}

/* Color picker grid */
.avatar-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 4px 0;
    justify-items: center;
}

.avatar-color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 100ms ease-out;
    padding: 0;
    appearance: none;
}

.avatar-color-option:active {
    transform: scale(0.93);
}

/* Profile page emoji picker grid */
.avatar-icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 4px 0;
    justify-items: center;
}

.avatar-option {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--f7-color-bg-2, #f2f2f7);
    border: 3px solid transparent;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 100ms ease-out;
    padding: 0;
    appearance: none;
}

.avatar-option:active {
    transform: scale(0.93);
}

.avatar-option-none {
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
}

.avatar-option-selected {
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.avatar-letter {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.avatar-letter-small {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

/* Photo lightbox — custom overlay */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

#lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

/* ── Admin tasks page ───────────────────────────────── */
.navbar-icon-btn {
    font-size: 24px;
    color: #007aff;
}

.admin-task-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-top: 4px;
}

.admin-task-badge--available {
    background: rgba(52, 199, 89, 0.15);
    color: #1a7a34;
}

.admin-task-badge--pending {
    background: rgba(255, 149, 0, 0.15);
    color: #a05a00;
}

/* ── Admin login screen ────────────────────────────── */
.admin-login-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: #007aff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}
.admin-login-icon .f7-icons {
    font-size: 36px;
    color: white;
}
.admin-login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #000;
    margin: 0 0 0.25rem;
}
.admin-login-subtitle {
    font-size: 15px;
    text-align: center;
    color: rgba(60, 60, 67, 0.6);
    margin: 0 0 2rem;
}
.admin-login-form {
    padding: 0 1.5rem;
}
.admin-login-error {
    background: rgba(255, 59, 48, 0.1);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #ff3b30;
    font-size: 15px;
}
.admin-login-error p {
    margin: 0;
}
.admin-login-field {
    margin-bottom: 1rem;
}
.admin-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.35rem;
}
.admin-login-field input {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 0.875rem;
    font-size: 17px;
    color: #000;
    background: #f2f2f7;
    border: 1.5px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.admin-login-field input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}
.admin-login-btn {
    display: block;
    width: 100%;
    min-height: 50px;
    margin-top: 1.5rem;
    padding: 0 1.5rem;
    font-size: 17px;
    font-weight: 600;
    color: white;
    background: #007aff;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: opacity 200ms ease-out, transform 100ms ease-out;
    -webkit-appearance: none;
    appearance: none;
}
.admin-login-btn:active {
    opacity: 0.85;
    transform: scale(0.98);
}

/* Small payout button in balance list item */

/* Emoji size for small (40px) avatar circles */
.avatar-emoji-sm {
    font-size: 1.2rem;
    line-height: 1;
}

/* Photo review overlay page */
.photo-review-page {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--f7-page-bg-color, #f2f2f7);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.photo-review-page--visible {
    transform: translateX(0);
}

.photo-review-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Extended task pill card */
.task-review-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.task-review-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.task-review-title {
    font-size: 17px;
    font-weight: 600;
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.photo-thumb-wrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: visible;
}

.photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: none;
    border: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    color: #ff3b30;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

/* Round action buttons */
.review-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 0 16px 32px;
}

.review-actions .button.button-round {
    border-radius: 9999px;
    min-width: 140px;
    height: 50px;
}
