/**
 * Fitness Coach Pro - Modals & Overlays
 * Login Modal + Mascot Owl Physics, Global Search Modal & Checkout Drawer Wrappers
 */

/* ─────────────────────────────────────────────
     Login Modal Overlay
     ───────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-card {
    position: relative;
    width: 90%;
    max-width: 440px;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.glass-modal {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 300;
}

body.rtl-layout .modal-close-btn {
    right: auto;
    left: 20px;
}

.mascot-animation-container {
    height: 100px;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.modal-form-content h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 900;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    border: 2px solid var(--border-stroke);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.submit-btn {
    width: 100%;
    margin-top: 10px;
    height: 48px;
    font-size: 1.1rem;
}

.error-banner {
    display: none;
    background-color: rgba(255, 75, 75, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
}

/* ─────────────────────────────────────────────
     Duolingo Mascot CSS Drawing & Physics
     ───────────────────────────────────────────── */
.mascot-owl {
    width: 80px;
    height: 80px;
    position: relative;
    animation: mascotIdle 2s infinite alternate ease-in-out;
}

@keyframes mascotIdle {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.mascot-body {
    width: 100%;
    height: 100%;
    background-color: var(--accent-green);
    border-radius: 50% 50% 40% 40%;
    position: relative;
    border: 3px solid var(--accent-green-shadow);
    overflow: hidden;
}

.mascot-wings {
    position: absolute;
    width: 90px;
    left: -5px;
    top: 30px;
    display: flex;
    justify-content: space-between;
}

.mascot-wings::before, .mascot-wings::after {
    content: '';
    width: 15px;
    height: 35px;
    background-color: var(--accent-green);
    border: 3px solid var(--accent-green-shadow);
    border-radius: 50%;
}

.mascot-wings::before { transform: rotate(-20deg); }
.mascot-wings::after { transform: rotate(20deg); }

.mascot-face {
    position: absolute;
    width: 60px;
    height: 40px;
    left: 10px;
    top: 20px;
}

.mascot-eyes {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.mascot-eyes .eye {
    width: 26px;
    height: 26px;
    background-color: #ffffff;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-primary);
    transition: height 0.15s ease, margin-top 0.15s ease;
}

.mascot-eyes .pupil {
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    transition: transform 0.2s ease;
}

.mascot-beak {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--accent-yellow);
    border: 2px solid var(--accent-yellow-shadow);
    transform: rotate(45deg);
    bottom: -6px;
    left: 24px;
    border-radius: 0 0 4px 0;
}

.mascot-owl.look-shy .eye {
    height: 4px;
    margin-top: 11px;
    border-radius: 2px;
    background-color: var(--text-primary);
}

.mascot-owl.look-shy .pupil {
    display: none;
}

.mascot-owl.celebrating {
    animation: mascotJump 0.5s infinite alternate cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mascotJump {
    from { transform: translateY(0) scaleY(1); }
    to { transform: translateY(-30px) scaleY(1.05); }
}

.mascot-owl.celebrating .eye {
    background-color: var(--accent-yellow);
}

/* ─────────────────────────────────────────────
     Global Checkout Drawer Hidden Wrappers
     ───────────────────────────────────────────── */
.checkout-drawer-wrapper {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 450px !important;
    height: 100vh !important;
    z-index: 1500 !important;
    transform: translateX(100%) !important;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-width: 100% !important;
}
.checkout-drawer-wrapper.drawer-open {
    transform: translateX(0) !important;
}
body.rtl-layout .checkout-drawer-wrapper {
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
}
body.rtl-layout .checkout-drawer-wrapper.drawer-open {
    transform: translateX(0) !important;
}
.drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1400 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    display: none !important;
}

.confetti-overlay-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2000 !important;
    pointer-events: none !important;
    display: none !important;
}

.payment-iframe-overlay-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2500 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    display: none !important;
}

/* ─────────────────────────────────────────────
     Premium Search Modal Overlay
     ───────────────────────────────────────────── */
.search-modal-overlay {
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(180%) !important;
}

.search-modal-card {
    max-width: 680px !important;
    width: 92% !important;
    border: 1px solid rgba(197, 160, 89, 0.25) !important;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 40px rgba(197, 160, 89, 0.08) !important;
}

.search-modal-title {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--gold) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.search-input-wrapper {
    position: relative;
    margin: 30px 0 25px 0;
    width: 100%;
}

.search-modal-input {
    width: 100% !important;
    font-size: 1.4rem !important;
    padding: 18px 60px 18px 25px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    color: var(--text-primary) !important;
    outline: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
}

body.rtl-layout .search-modal-input {
    padding: 18px 25px 18px 60px !important;
}

.search-modal-input:focus {
    border-color: var(--gold) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.25), inset 0 2px 4px rgba(0,0,0,0.05) !important;
}

.dark-theme .search-modal-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark-theme .search-modal-input:focus {
    border-color: var(--gold) !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

.search-modal-submit-btn {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 6px;
    border-radius: 50%;
}

body.rtl-layout .search-modal-submit-btn {
    right: auto;
    left: 18px;
}

.search-modal-submit-btn:hover {
    color: var(--gold) !important;
    transform: translateY(-50%) scale(1.15) !important;
}

.search-modal-submit-btn span {
    font-size: 2rem !important;
}

.search-modal-overlay .modal-close-btn {
    transition: transform 0.3s ease, color 0.3s ease !important;
}

.search-modal-overlay .modal-close-btn:hover {
    color: var(--gold) !important;
    transform: rotate(90deg) !important;
}

.trending-searches-container {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.trending-title {
    font-size: 0.95rem !important;
    color: var(--text-secondary) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600 !important;
}

.trending-icon {
    font-size: 1.2rem !important;
    color: var(--gold) !important;
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.trending-tag-btn {
    background: rgba(197, 160, 89, 0.08);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: inherit;
}

.trending-tag-btn:hover {
    background: var(--gold) !important;
    color: #ffffff !important;
    border-color: var(--gold) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.3) !important;
}

.dark-theme .trending-tag-btn {
    background: rgba(197, 160, 89, 0.05);
    border-color: rgba(197, 160, 89, 0.15);
}

.dark-theme .trending-tag-btn:hover {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    color: #030712 !important;
}
