/* =============================================================
   PWA Install Gate + Banner
   Dark mode consistent, glassmorphism UI
   ============================================================= */

/* -------------------------------------------------------------
   Banner — sesiunile 1-3
   ------------------------------------------------------------- */
.ct-install-banner {
    position: fixed;
    top: calc(70px + var(--safe-top, 0px));
    left: 12px;
    right: 12px;
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-radius: 16px;
    padding: 12px 16px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: bannerSlideDown-in 0.3s var(--ease-out) forwards;
}

.ct-install-banner-text {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.ct-install-banner-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 150ms;
}

.ct-install-banner-btn:hover {
    filter: brightness(1.1);
}

.ct-install-banner-btn:active {
    transform: scale(0.97);
}

.ct-install-banner-close {
    color: var(--text-muted);
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    flex-shrink: 0;
}

@keyframes bannerSlideDown-in {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bannerSlideUp-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.ct-install-banner.hiding {
    animation: bannerSlideUp-out 0.2s var(--ease-in) forwards;
}

/* -------------------------------------------------------------
   Gate Overlay — sesiunea 4+
   ------------------------------------------------------------- */
.ct-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
    animation: gateIn 0.4s ease-out;
}

@keyframes gateIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* -------------------------------------------------------------
   Gate Content
   ------------------------------------------------------------- */
.ct-gate-content {
    text-align: center;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px 28px 36px;
    max-width: 340px;
    width: calc(100% - 32px);
    margin: 0 16px;
}

/* Logo — text branding */
.ct-gate-logo {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Quicksand', sans-serif;
    line-height: 1;
}

.ct-gate-logo-name {
    color: var(--text-primary);
}

.ct-gate-logo-accent {
    color: var(--accent);
}

/* Titlu + subtitlu */
.ct-gate-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 0;
    line-height: 1.3;
}

.ct-gate-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 6px 0 0;
    line-height: 1.5;
}

/* Buton install (Android/Chrome) */
.ct-gate-install-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 28px;
    width: 100%;
    transition: filter 150ms, transform 150ms;
}

.ct-gate-install-btn:hover {
    filter: brightness(1.1);
}

.ct-gate-install-btn:active {
    transform: scale(0.97);
}

/* -------------------------------------------------------------
   iOS Instructions
   ------------------------------------------------------------- */
.ct-gate-ios {
    margin-top: 24px;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    max-width: 280px;
}

.ct-gate-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.ct-gate-ios-step + .ct-gate-ios-step {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ct-gate-ios-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.ct-gate-ios-step-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.ct-gate-ios-step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Share icon inline */
.ct-gate-share-icon {
    display: inline-block;
    vertical-align: middle;
    color: var(--accent);
    margin: 0 1px;
    width: 16px;
    height: 16px;
}

/* iOS non-Safari fallback */
.ct-gate-ios-nosafari {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 24px;
    line-height: 1.5;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.ct-gate-ios-nosafari strong {
    color: var(--text-primary);
}

/* -------------------------------------------------------------
   Already Installed Gate
   ------------------------------------------------------------- */
.ct-gate-installed-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto 0;
}

/* -------------------------------------------------------------
   Auth Gate — PWA standalone, user nelogat
   ------------------------------------------------------------- */
.ct-gate-login-link {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 150ms;
}

.ct-gate-login-link:hover {
    color: var(--text-primary);
}

.ct-gate-login-link:active {
    opacity: 0.7;
}

/* -------------------------------------------------------------
   Desktop Fallback
   ------------------------------------------------------------- */
.ct-gate-desktop {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 32px;
    line-height: 1.5;
}

/* -------------------------------------------------------------
   Responsive
   ------------------------------------------------------------- */
@media (min-width: 1024px) {
    .ct-gate-content {
        max-width: 420px;
    }

    .ct-install-banner {
        max-width: 500px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        top: 24px;
    }

    /* Override animation for centered desktop banner */
    @keyframes bannerSlideDown-in {
        from {
            transform: translateX(-50%) translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
    }

    @keyframes bannerSlideUp-out {
        from {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
        to {
            transform: translateX(-50%) translateY(-100%);
            opacity: 0;
        }
    }
}

/* -------------------------------------------------------------
   Reduced Motion
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ct-install-banner,
    .ct-install-banner.hiding,
    .ct-gate-overlay {
        animation-duration: 0s;
    }
}
