/**
 * Timed Popup Quote CSS + Mobile Action Menu
 */

:root {
    --tp-popup-primary: #1d4ed8;
    --tp-popup-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --tp-popup-bg: #ffffff;
    --tp-popup-text: #1e293b;
    --tp-popup-muted: #64748b;
    --tp-popup-radius: 24px;
    --tp-popup-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.tp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.25rem;
}

.tp-popup-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Popup Container
   ========================================================================== */
.tp-popup-container {
    background: var(--tp-popup-bg);
    width: 100%;
    max-width: 600px;
    border-radius: var(--tp-popup-radius);
    position: relative;
    box-shadow: var(--tp-popup-shadow);
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tp-popup-overlay.is-active .tp-popup-container {
    transform: translateY(0) scale(1);
}

.tp-popup-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tp-popup-muted);
    transition: all 0.2s;
    z-index: 10;
}

.tp-popup-close:hover {
    background: #e2e8f0;
    color: var(--tp-popup-text);
    transform: rotate(90deg);
}

.tp-popup-header {
    padding: 2.5rem 2.5rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.tp-popup-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-popup-icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--tp-popup-primary);
}

.tp-popup-title-wrap h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--tp-popup-text);
    margin: 0 0 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.tp-popup-title-wrap p {
    font-size: 0.9375rem;
    color: var(--tp-popup-muted);
    margin: 0;
    line-height: 1.5;
}

.tp-popup-body {
    padding: 0 2.5rem 1.5rem;
}

.tp-popup-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tp-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-form-group.full-width {
    grid-column: 1 / -1;
}

.tp-form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tp-popup-text);
    letter-spacing: 0.05em;
}

.tp-form-group input {
    height: 3.25rem;
    padding: 0 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: var(--tp-popup-text);
    transition: all 0.2s;
    background: #f8fafc;
}

.tp-form-group input:focus {
    outline: none;
    border-color: var(--tp-popup-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.tp-submit-btn {
    margin-top: 0.5rem;
    height: 3.5rem;
    background: var(--tp-popup-gradient);
    color: #ffffff;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -5px rgba(29, 78, 216, 0.4);
}

.tp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(29, 78, 216, 0.5);
    filter: brightness(1.1);
}

.tp-submit-btn:active {
    transform: translateY(0);
}

.tp-popup-footer {
    padding: 1.5rem 2.5rem 2rem;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.tp-popup-footer p {
    font-size: 0.75rem;
    color: var(--tp-popup-muted);
    font-weight: 500;
    margin: 0;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Popup — Mobile Responsive (Full-Screen Slide-Up)
   ========================================================================== */
@media (max-width: 767px) {
    .tp-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .tp-popup-overlay.is-active .tp-popup-container {
        transform: translateY(0);
    }

    .tp-popup-container {
        width: 100%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tp-popup-header {
        padding: 2rem 1.25rem 1rem;
        gap: 1rem;
    }

    .tp-popup-icon {
        width: 44px;
        height: 44px;
    }

    .tp-popup-title-wrap h2 {
        font-size: 1.375rem;
    }

    .tp-popup-title-wrap p {
        font-size: 0.8125rem;
    }

    .tp-popup-body {
        padding: 0 1.25rem 1.25rem;
    }

    .tp-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tp-form-group input {
        height: 3rem;
        font-size: 0.9375rem;
    }

    .tp-popup-footer {
        padding: 1.25rem;
    }

    .tp-submit-btn {
        height: 3.25rem;
        font-size: 0.9375rem;
    }
}


/* ==========================================================================
   Mobile Action Menu (Floating)
   ========================================================================== */
.tp-mobile-action-menu {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 9999;
    font-family: inherit;
    transition: bottom 0.3s ease;
}

/* Move above sticky bottom bar when it's visible */
.tp-mobile-action-menu.has-sticky-bar {
    bottom: 100px;
}

@media (max-width: 767px) {
    .tp-mobile-action-menu {
        display: block;
    }
}

/* Toggle Button */
.tp-action-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 10002;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tp-action-toggle:active {
    transform: scale(0.9);
}

.tp-action-toggle .material-symbols-outlined {
    font-size: 28px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-action-toggle .tp-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.tp-mobile-action-menu.is-open .tp-action-toggle {
    background: #6d28d9;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.tp-mobile-action-menu.is-open .tp-icon-help {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.tp-mobile-action-menu.is-open .tp-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Action Items (Menu Cards) */
.tp-action-items {
    position: absolute;
    bottom: 72px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 280px;
    z-index: 10003;
}

.tp-mobile-action-menu.is-open .tp-action-items {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tp-action-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: none;
    text-align: left;
    width: 100%;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tp-action-item:hover,
.tp-action-item:active {
    background: #f8fafc;
    color: #1e293b;
}

.tp-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.tp-action-icon .material-symbols-outlined {
    font-size: 22px;
}

.tp-action-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tp-action-text strong {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1px;
    line-height: 1.3;
}

.tp-action-text span {
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.2;
}

.tp-action-chevron {
    color: #3b82f6;
    font-size: 20px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Action Overlay (Background Dimmer) */
.tp-action-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tp-mobile-action-menu.is-open .tp-action-overlay {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Global Mobile Overflow Fix
   ========================================================================== */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
}
