/* ==========================================================================
   Garudo Web Application - App Shell, Loading Screen & Pull-to-Refresh
   ========================================================================== */

/* -------------------------------------------------------------
   1. Smooth Native Scrolling & Touch Behaviors
------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none; /* Prevents awkward browser rubber-banding while custom pull-to-refresh is active */
}

/* -------------------------------------------------------------
   2. Seamless App Loading Screen (Splash Screen)
   STRICT RULE: Hidden completely on website; only shown in App environment.
------------------------------------------------------------- */
#garudo-app-loader {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Strictly enabled only when running inside Mobile Application Environment */
html.garudo-app-env:not(.garudo-no-loader) #garudo-app-loader {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #07152b;
    background: radial-gradient(circle at 50% 45%, #0d2244 0%, #07152b 75%);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    pointer-events: auto !important;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
    opacity: 1 !important;
    transform: scale(1);
    visibility: visible !important;
}

html.garudo-app-env #garudo-app-loader.loaded,
#garudo-app-loader.garudo-suppressed {
    opacity: 0 !important;
    transform: scale(1.025);
    pointer-events: none !important;
    visibility: hidden !important;
    display: none !important;
}

.garudo-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    max-width: 90vw;
}

.garudo-loader-logo-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.garudo-loader-logo-glow {
    position: absolute;
    width: 200px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 183, 3, 0.32) 0%, rgba(242, 101, 34, 0.15) 50%, transparent 75%);
    border-radius: 50%;
    animation: garudoGlowPulse 2.4s ease-in-out infinite;
    filter: blur(14px);
    z-index: 1;
}

.garudo-loader-logo {
    position: relative;
    z-index: 2;
    max-width: 340px;
    width: 82vw;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
    animation: garudoLogoFloat 2.8s ease-in-out infinite;
}

.garudo-loader-tagline {
    color: #cbd5e1;
    font-size: 11.5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 24px;
    opacity: 0.9;
}

.garudo-loader-tagline span {
    color: #ffb703;
    font-weight: 700;
}

/* Glowing Progress Bar */
.garudo-loader-bar-wrap {
    width: 180px;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.garudo-loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, #ffb703, #f26522, #ffb703);
    border-radius: 99px;
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.85);
    animation: garudoBarMove 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes garudoGlowPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

@keyframes garudoLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes garudoBarMove {
    0% { left: -50%; width: 35%; }
    50% { width: 65%; }
    100% { left: 110%; width: 35%; }
}

/* -------------------------------------------------------------
   3. Smooth Drag-Down-To-Refresh (Pull-to-Refresh)
------------------------------------------------------------- */
#garudo-pull-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 9999990;
    transform: translateY(-80px);
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    opacity: 0;
}

#garudo-pull-refresh.active-pull {
    transition: none; /* Free fluid drag following finger */
    opacity: 1;
}

#garudo-pull-refresh.refreshing {
    transform: translateY(22px) !important;
    transition: transform 0.25s ease-out;
    opacity: 1;
}

.garudo-ptr-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: #07152b;
    border: 1px solid rgba(255, 183, 3, 0.4);
    border-radius: 40px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 8px 24px rgba(7, 21, 43, 0.35), 0 3px 8px rgba(0, 0, 0, 0.2);
}

.garudo-ptr-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffb703;
    transition: transform 0.15s ease, color 0.15s ease;
}

.garudo-ptr-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.garudo-ptr-spinner {
    width: 18px;
    height: 18px;
    border: 2.2px solid rgba(255, 183, 3, 0.25);
    border-top-color: #ffb703;
    border-radius: 50%;
    animation: garudoPtrSpin 0.75s linear infinite;
    display: none;
}

#garudo-pull-refresh.refreshing .garudo-ptr-icon {
    display: none;
}

#garudo-pull-refresh.refreshing .garudo-ptr-spinner {
    display: inline-block;
}

#garudo-pull-refresh.threshold-reached .garudo-ptr-icon {
    color: #10b981; /* Green check state */
    transform: rotate(180deg);
}

#garudo-pull-refresh.threshold-reached .garudo-ptr-pill {
    border-color: rgba(16, 185, 129, 0.6);
}

@keyframes garudoPtrSpin {
    to { transform: rotate(360deg); }
}
