/*
Theme Name: AppTheme
Theme URI: https://tickyouoff.com
Author: Preetam S Chaudhary
Author URI: https://preetam.org
Description: A minimal WordPress theme designed for the TickYouOff app (Monolith + Capacitor).
Version: 2.32.0
text-domain: app-theme
*/

/* -- Local Inter Font (self-hosted, no external requests) --------------─ */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./assets/fonts/Inter-Regular.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./assets/fonts/Inter-Medium.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./assets/fonts/Inter-SemiBold.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./assets/fonts/Inter-Bold.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -- Core Reset -------------------------------------------------------- */
body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* -- Global Focus Indicators (WCAG 2.4.7) ------------------------------ */
*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* -- Safe Areas (Capacitor/notch) -------------------------------------- */
.safe-top {
    padding-top: env(safe-area-inset-top, 0px);
}

.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Main content top padding: clear fixed header (3.5rem / 56px) + safe area.
   Uses two declarations so browsers without env() support get the fallback. */
.safe-main-top {
    padding-top: 3.5rem;
    padding-top: calc(3.5rem + env(safe-area-inset-top, 0px));
}

/* Android Capacitor: env(safe-area-inset-top) is always 0 on Android.
   Use JS-set --safe-area-top custom property instead. */
html.cap-android .safe-top {
    padding-top: var(--safe-area-top, 24px);
}

html.cap-android .safe-main-top {
    padding-top: calc(3.5rem + var(--safe-area-top, 24px));
}

/* -- Swup Transitions -------------------------------------------------- */
.transition-fade {
    transition: opacity 0.15s ease;
    opacity: 1;
}

html.is-animating .transition-fade {
    opacity: 0;
}

/* -- Web Push Prompt Slide-Up Animation -------------------------------- */
@keyframes tyo-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.tyo-slide-up {
    animation: tyo-slide-up 0.35s ease-out;
}

/* -- Scrollbar hiding for horizontal scrollers ------------------------─ */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* -- Checklist items: scroll margin to clear fixed header -------------- */
.checklist-item {
    scroll-margin-top: 4.5rem;
}

/* -- Category Chips scroll fade indicator ----------------------------- */
.chip-scroll-container {
    position: relative;
}
.chip-scroll-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    background: linear-gradient(to right, transparent, rgb(249 250 251));
    pointer-events: none;
    transition: opacity 0.2s;
}
.chip-scroll-container.scrolled-end::after {
    opacity: 0;
}
:is(.dark) .chip-scroll-container::after {
    background: linear-gradient(to right, transparent, rgb(17 24 39));
}

/* -- Line Clamp -------------------------------------------------------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -- Pagination styling ------------------------------------------------ */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.dark .page-numbers {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}

.page-numbers:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.page-numbers.current {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.page-numbers.dots {
    border: none;
    background: none;
}

ul.page-numbers {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
    justify-content: center;
}

ul.page-numbers li {
    display: inline-flex;
}

/* -- Checklist card hover effect --------------------------------------─ */
.checklist-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.checklist-card:active {
    transform: scale(0.98);
}

/* -- Upvote button pulse animation ------------------------------------─ */
@keyframes upvote-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.upvote-btn:active {
    animation: upvote-pulse 0.3s ease;
}

/* -- Checklist item check animation ------------------------------------ */
.checklist-item {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* -- Loading skeleton -------------------------------------------------- */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200px 100%;
}

/* -- Page Loader ------------------------------------------------------─ */
#page-loader {
    transition: opacity 0.3s ease;
}

#page-loader.loader-hidden {
    opacity: 0;
    pointer-events: none;
}

/* -- Top Progress Indicator (Swup transitions) ------------------------─ */
#progress-indicator {
    transition: opacity 0.2s ease;
}

#progress-indicator.active {
    opacity: 1;
}

#progress-indicator-bar {
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
}

/* -- Bounce animation for loader dots ---------------------------------- */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.loader-dots .animate-bounce {
    animation: bounce 0.6s ease-in-out infinite;
}

/* -- Streak flame pulse (17B Stats Card) ------------------------------─ */
@keyframes flamePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.tyo-streak-flame {
    display: inline-block;
    animation: flamePulse 1.5s ease-in-out infinite;
}

/* -- Achievement toast (17I) --------------------------------------─ */
@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.animate-slideDown {
    animation: slideDown 0.3s ease-out forwards;
}

/* -- Undo Toast slide-up (15#3) ---------------------------------------- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-slideUp {
    animation: slideUp 0.3s ease-out forwards;
}

/* -- Card entrance (17J) ------------------------------------------─ */
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-card-entrance {
    animation: cardEntrance 0.35s ease-out both;
}

/* -- Dark Mode global overrides ------------------------------------ */
/* Form inputs inherit dark background */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="search"],
.dark input[type="number"],
.dark select,
.dark textarea {
    background-color: #1f2937; /* gray-800 */
    border-color: #374151;     /* gray-700 */
    color: #f3f4f6;            /* gray-100 */
}

/* Prose/content dark overrides */
.dark .prose { color: #d1d5db; }
.dark .prose h1, .dark .prose h2, .dark .prose h3,
.dark .prose h4, .dark .prose h5, .dark .prose h6 { color: #f3f4f6; }
.dark .prose a { color: #818cf8; }
.dark .prose strong { color: #e5e7eb; }

/* Dark mode: auto-invert white cards with gray-100 borders */
.dark .bg-white:not(.dark\:bg-gray-800):not(.dark\:bg-gray-900):not(.dark\:bg-gray-700) {
    background-color: #1f2937 !important; /* gray-800 */
}
.dark .border-gray-100 {
    border-color: #374151 !important; /* gray-700 */
}
/* Only apply dark bg-gray-50 override to elements that don't have an explicit dark: class */
.dark .bg-gray-50:not([class*="dark\:bg-"]) {
    background-color: #111827 !important; /* gray-900 */
}
.dark .bg-gray-100 {
    background-color: #1f2937 !important; /* gray-800 */
}
.dark .text-gray-900 {
    color: #f3f4f6 !important; /* gray-100 */
}
.dark .text-gray-700 {
    color: #d1d5db !important; /* gray-300 */
}
.dark .text-gray-600 {
    color: #9ca3af !important; /* gray-400 */
}
.dark .text-gray-500 {
    color: #9ca3af !important; /* gray-400 */
}
.dark .border-gray-200 {
    border-color: #374151 !important; /* gray-700 */
}
