/**
 * Geo Validator Frontend Styles — Full-Screen Map Design
 * 
 * @package WooGeoValidator
 */

/* ========================================
   Full-Screen Layout
   ======================================== */
.wgv-fullscreen {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--tapmenu-verify-bg, #f5f5f5);
}

/* ========================================
   Floating Header
   ======================================== */
.wgv-floating-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(env(safe-area-inset-top, 0px) + clamp(12px, 2.2dvh, 24px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 70%, rgba(255, 255, 255, 0) 100%);
}

.wgv-back-btn {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #E63946;
    transition: transform 0.2s;
}

.wgv-back-btn:hover {
    transform: scale(1.05);
}

.wgv-page-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.3px;
}

/* ========================================
   Floating Search Bar
   ======================================== */
.wgv-floating-search {
    position: absolute;
    top: calc(var(--tapmenu-topbar-height, 0px) + env(safe-area-inset-top, 0px) + clamp(12px, 2.4dvh, 28px));
    left: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 28px;
    padding: 4px 6px 4px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    gap: 10px;
}

.wgv-fullscreen .leaflet-top {
    top: calc(var(--tapmenu-topbar-height, 0px) + env(safe-area-inset-top, 0px) + clamp(76px, 12dvh, 108px));
}

.wgv-search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.wgv-floating-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    padding: 10px 0;
    font-family: inherit;
}

.wgv-floating-search input::placeholder {
    color: #999;
}

.wgv-gps-btn {
    width: auto;
    min-width: 42px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #FEF2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    cursor: pointer;
    flex-shrink: 0;
    color: #E63946;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.2s;
}

.wgv-gps-btn svg {
    flex-shrink: 0;
}

.wgv-gps-label {
    line-height: 1;
}

.wgv-gps-btn:hover {
    background: #FDE8E8;
    transform: scale(1.05);
}

.wgv-gps-btn.locating {
    animation: wgv-pulse 1.2s infinite;
}

@keyframes wgv-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* ========================================
   Full-Screen Map
   ======================================== */
.wgv-map-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wgv-map-fullscreen #wgv-map {
    width: 100%;
    height: 100%;
}

.wgv-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.wgv-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #E63946;
    border-radius: 50%;
    animation: wgv-spin 0.8s linear infinite;
}

@keyframes wgv-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.wgv-map-overlay p {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

/* Center Pin (fixed position on map) */
.wgv-center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 500;
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* ========================================
   Bottom Sheet
   ======================================== */
.wgv-bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 10px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wgv-sheet-handle {
    width: 36px;
    height: 4px;
    background: #DDD;
    border-radius: 2px;
    margin: 0 auto 14px;
}

/* Initial Prompt */
.wgv-initial-prompt {
    text-align: center;
    padding: 8px 0 14px;
}

.wgv-prompt-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.wgv-initial-prompt p {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* ========================================
   Result Card (in bottom sheet)
   ======================================== */
.wgv-result {
    margin-bottom: 14px;
}

.wgv-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
}

.wgv-result-card.success {
    background: #F0FFF4;
    border: 1px solid #C6F6D5;
}

.wgv-result-card.error {
    background: #FFF5F5;
    border: 1px solid #FED7D7;
}

.wgv-result-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}

.wgv-result-card.success .wgv-result-icon {
    background: #48BB78;
    color: white;
}

.wgv-result-card.error .wgv-result-icon {
    background: #FC8181;
    color: white;
}

.wgv-result-info {
    flex: 1;
}

.wgv-result-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a1a;
}

.wgv-result-details {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #666;
}

.wgv-result-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wgv-result-card.error .wgv-result-info h3 {
    color: #C53030;
}

.wgv-result-card.error .wgv-result-info p {
    font-size: 13px;
    color: #718096;
    margin: 4px 0 0;
}

/* ========================================
   Confirm Button
   ======================================== */
.wgv-confirm-btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: var(--tapmenu-verify-action-bg, #E63946);
    color: var(--tapmenu-verify-action-text, #ffffff);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.25s;
    font-family: inherit;
}

.wgv-confirm-btn:hover:not(:disabled) {
    background: var(--tapmenu-primary-hover, #C1121F);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
}

.wgv-confirm-btn:disabled {
    background: #DDD;
    color: #999;
    cursor: not-allowed;
}

.wgv-confirm-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ========================================
   Leaflet Overrides
   ======================================== */
.wgv-fullscreen .leaflet-control-zoom {
    margin-right: 12px !important;
    margin-bottom: 220px !important;
    margin-top: 12px !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.wgv-fullscreen .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    border-bottom: 1px solid #eee !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 13px 15px;
    font-size: 14px;
}

/* ========================================
   Notice
   ======================================== */
.wgv-notice {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 13px;
}

.wgv-notice.wgv-error {
    background: #FFF5F5;
    color: #C53030;
    border: 1px solid #FED7D7;
}

/* ========================================
   Hide WP default elements on this page
   ======================================== */
.wgv-fullscreen~.tapmenu-footer {
    display: none !important;
}

/* ========================================
   Prototype Visual Refresh
======================================== */
.wgv-fullscreen {
    background: #ffffff;
    box-shadow: 0 40px 100px rgba(15, 23, 42, 0.14);
}

.wgv-floating-search {
    top: calc(var(--tapmenu-topbar-height, 0px) + 16px);
    left: 16px;
    right: 16px;
    padding: 6px 8px 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
}

.wgv-fullscreen .leaflet-top {
    top: calc(var(--tapmenu-topbar-height, 0px) + env(safe-area-inset-top, 0px) + clamp(84px, 13dvh, 116px));
}

.wgv-floating-search input {
    font-size: 15px;
    font-weight: 600;
}

.wgv-gps-btn {
    width: auto;
    min-width: 44px;
    height: 42px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(225, 29, 72, 0.08);
}

.wgv-gps-btn:hover {
    background: rgba(225, 29, 72, 0.12);
}

.wgv-map-overlay {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wgv-center-pin {
    filter: drop-shadow(0 18px 34px rgba(15, 23, 42, 0.24));
}

.wgv-bottom-sheet {
    padding: 14px 20px 24px;
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 18px));
    border-radius: 32px 32px 0 0;
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.22);
}

.wgv-sheet-handle {
    width: 48px;
    height: 5px;
    margin-bottom: 18px;
    background: #d1d5db;
}

.wgv-initial-prompt {
    padding: 4px 0 16px;
}

.wgv-prompt-icon {
    margin-bottom: 10px;
    font-size: 32px;
}

.wgv-initial-prompt p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.7;
}

.wgv-result-card {
    padding: 16px;
    border-radius: 24px;
}

.wgv-result-info h3 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.wgv-result-details {
    color: #6b7280;
}

.wgv-confirm-btn {
    min-height: 54px;
    border: none;
    border-radius: 999px;
    background: var(--tapmenu-verify-action-bg, var(--tapmenu-primary-color, #E63946));
    box-shadow: 0 18px 38px rgba(225, 29, 72, 0.28);
}

body.rtl .wgv-fullscreen,
.wgv-fullscreen[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

.wgv-floating-search {
    top: 16px;
}

.wgv-fullscreen .leaflet-top {
    top: 84px;
}

.wgv-center-pin {
    animation: wgvPinFloat 1.9s ease-in-out infinite;
}

@keyframes wgvPinFloat {
    0%,
    100% {
        transform: translate(-50%, -100%);
    }

    50% {
        transform: translate(-50%, calc(-100% - 8px));
    }
}
