/* FarsTube / ParsTube Footer - scoped */
.farstube-footer-root {
    --ft-footer-bg-color: #f8f9fa;
    --ft-footer-surface-color: rgba(255, 255, 255, 0.72);
    --ft-footer-surface-solid: #ffffff;
    --ft-footer-surface-hover: rgba(0, 0, 0, 0.04);
    --ft-footer-text-main: #0f172a;
    --ft-footer-text-muted: #64748b;
    --ft-footer-border-color: rgba(15, 23, 42, 0.08);
    --ft-footer-primary: #ff3b30;
    --ft-footer-primary-glow: rgba(255, 59, 48, 0.4);
    --ft-footer-premium-gradient: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
    --ft-footer-radius-full: 9999px;
    --ft-footer-radius-lg: 32px;
    --ft-footer-radius-md: 20px;
    --ft-footer-transition-apple: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    --ft-footer-transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: rtl;
    font-family: inherit;
    color: var(--ft-footer-text-main);
    -webkit-tap-highlight-color: transparent;
}

html.dark .farstube-footer-root,
html.farstube-dark .farstube-footer-root {
    --ft-footer-bg-color: #050505;
    --ft-footer-surface-color: rgba(15, 15, 15, 0.72);
    --ft-footer-surface-solid: #0f0f11;
    --ft-footer-surface-hover: rgba(255, 255, 255, 0.05);
    --ft-footer-text-main: #f8fafc;
    --ft-footer-text-muted: #94a3b8;
    --ft-footer-border-color: rgba(255, 255, 255, 0.08);
    --ft-footer-primary-glow: rgba(255, 59, 48, 0.6);
}

.farstube-footer-root,
.farstube-footer-root * { box-sizing: border-box; }
.farstube-footer-root a { text-decoration: none !important; color: inherit; }
.farstube-footer-root button,
.farstube-footer-root input { border: none; background: none; outline: none; font-family: inherit; color: inherit; }
.farstube-footer-root button { cursor: pointer; }

.farstube-footer-root .ft-footer {
    background: var(--ft-footer-surface-solid);
    position: relative;
    overflow: hidden;
    padding-top: 72px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 90px);
    border-top: 1px solid var(--ft-footer-border-color);
    z-index: 10;
}

@media (min-width: 901px) {
    .farstube-footer-root .ft-footer { padding-bottom: 30px; }
}

.farstube-footer-root .ft-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ft-footer-primary), transparent);
    opacity: 0.3;
}

.farstube-footer-root .footer-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
    animation: ft-footer-float-blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}
.farstube-footer-root .blob-1 { width: 400px; height: 400px; background: var(--ft-footer-primary); top: -100px; right: -100px; }
.farstube-footer-root .blob-2 { width: 350px; height: 350px; background: #3b82f6; bottom: -50px; left: -50px; animation-delay: -5s; }
html.dark .farstube-footer-root .footer-blob,
html.farstube-dark .farstube-footer-root .footer-blob { opacity: 0.25; }

@keyframes ft-footer-float-blob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 30px) scale(1.1); }
    100% { transform: translate(20px, -40px) scale(0.9); }
}

.farstube-footer-root .ft-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 20;
}

/* Fixed: newsletter banner no longer goes under page content */
.farstube-footer-root .footer-banner {
    background: var(--ft-footer-surface-color);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--ft-footer-radius-lg);
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 32px;
    border: 1px solid var(--ft-footer-border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.1);
    margin-top: 0;
    margin-bottom: 60px;
    position: relative;
    overflow: visible;
    transition: var(--ft-footer-transition-apple);
    z-index: 50;
}
.farstube-footer-root .footer-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: rgba(255, 59, 48, 0.2);
}
html.dark .farstube-footer-root .footer-banner,
html.farstube-dark .farstube-footer-root .footer-banner { box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

.farstube-footer-root .banner-content h3 { margin: 0 0 12px; font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }
.farstube-footer-root .banner-content p { margin: 0; font-size: 15px; color: var(--ft-footer-text-muted); line-height: 1.8; max-width: 430px; }
.farstube-footer-root .banner-form {
    display: flex;
    gap: 8px;
    background: var(--ft-footer-surface-solid);
    padding: 8px;
    border-radius: var(--ft-footer-radius-full);
    border: 2px solid var(--ft-footer-border-color);
    transition: var(--ft-footer-transition-apple);
    flex: 1;
    max-width: 500px;
    min-width: 280px;
    position: relative;
    z-index: 2;
}
.farstube-footer-root .banner-form:focus-within {
    border-color: var(--ft-footer-primary);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15), 0 10px 25px rgba(255, 59, 48, 0.2);
    transform: scale(1.02);
}
.farstube-footer-root .banner-input {
    flex: 1;
    min-width: 0;
    padding: 0 20px;
    font-size: 16px;
    color: var(--ft-footer-text-main);
    font-weight: 500;
    cursor: text;
}
.farstube-footer-root .banner-input::placeholder { color: var(--ft-footer-text-muted); opacity: 0.7; }
.farstube-footer-root .banner-btn {
    background: var(--ft-footer-primary) !important;
    color: #fff !important;
    padding: 14px 32px;
    border-radius: var(--ft-footer-radius-full);
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: var(--ft-footer-transition-bounce);
    box-shadow: 0 8px 20px var(--ft-footer-primary-glow);
    white-space: nowrap;
}
.farstube-footer-root .banner-btn:hover { background: #ff2a1f !important; transform: scale(0.96); box-shadow: 0 4px 10px var(--ft-footer-primary-glow); }
.farstube-footer-root .newsletter-message {
    position: absolute;
    bottom: -30px;
    right: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ft-footer-primary);
    opacity: 0;
    transform: translateY(-4px);
    transition: .25s ease;
}
.farstube-footer-root .newsletter-message.is-visible { opacity: 1; transform: translateY(0); }
.farstube-footer-root .newsletter-message.is-success { color: #10b981; }

.farstube-footer-root .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 60px;
}
.farstube-footer-root .footer-col { display: flex; flex-direction: column; gap: 20px; }
.farstube-footer-root .footer-about { padding-left: 20px; }
.farstube-footer-root .footer-brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 900; letter-spacing: -1px; width: fit-content; }
.farstube-footer-root .footer-brand span span { color: var(--ft-footer-primary); }
.farstube-footer-root .footer-brand-icon {
    width: 44px;
    height: 44px;
    background: var(--ft-footer-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 10px 25px var(--ft-footer-primary-glow);
    transition: var(--ft-footer-transition-bounce);
    font-size: 24px;
}
.farstube-footer-root .footer-brand:hover .footer-brand-icon { transform: rotate(15deg) scale(1.1); }
.farstube-footer-root .brand-desc { color: var(--ft-footer-text-muted); font-size: 15px; line-height: 1.9; font-weight: 500; max-width: 380px; margin: 0; }

.farstube-footer-root .social-row { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.farstube-footer-root .social-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--ft-footer-surface-hover);
    color: var(--ft-footer-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--ft-footer-transition-bounce);
    border: 1px solid transparent;
}
.farstube-footer-root .social-btn.insta:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: #fff; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px rgba(220, 39, 67, 0.4); }
.farstube-footer-root .social-btn.x:hover { background: #000; color: #fff; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
html.dark .farstube-footer-root .social-btn.x:hover,
html.farstube-dark .farstube-footer-root .social-btn.x:hover { background: #fff; color: #000; box-shadow: 0 10px 20px rgba(255,255,255,.3); }
.farstube-footer-root .social-btn.telegram:hover { background: #0088cc; color: #fff; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px rgba(0,136,204,.4); }
.farstube-footer-root .social-btn.youtube:hover { background: #ff0000; color: #fff; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px rgba(255,0,0,.4); }
.farstube-footer-root .social-btn.custom:hover { background: var(--ft-footer-primary); color: #fff; transform: translateY(-6px) scale(1.1); box-shadow: 0 10px 20px var(--ft-footer-primary-glow); }

.farstube-footer-root .footer-title { font-size: 18px; font-weight: 900; color: var(--ft-footer-text-main); margin: 0 0 12px; position: relative; }
.farstube-footer-root .footer-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ft-footer-text-muted);
    width: fit-content;
    transition: var(--ft-footer-transition-apple);
    padding: 4px 0;
}
.farstube-footer-root .footer-link.is-primary { color: var(--ft-footer-primary); }
.farstube-footer-root .magic-arrow { position: relative; width: 12px; height: 3px; background: var(--ft-footer-text-muted); border-radius: 4px; transition: var(--ft-footer-transition-bounce); display: inline-block; }
.farstube-footer-root .magic-arrow::before,
.farstube-footer-root .magic-arrow::after { content: ''; position: absolute; left: 0; width: 8px; height: 3px; background: transparent; border-radius: 4px; transform-origin: 1.5px center; transition: var(--ft-footer-transition-bounce); }
.farstube-footer-root .footer-link:hover { color: var(--ft-footer-text-main); transform: translateX(-10px); }
.farstube-footer-root .footer-link:hover .magic-arrow { width: 18px; background: var(--ft-footer-primary); box-shadow: 0 0 12px var(--ft-footer-primary-glow); }
.farstube-footer-root .footer-link:hover .magic-arrow::before { background: var(--ft-footer-primary); transform: rotate(45deg); box-shadow: 0 0 10px var(--ft-footer-primary-glow); }
.farstube-footer-root .footer-link:hover .magic-arrow::after { background: var(--ft-footer-primary); transform: rotate(-45deg); box-shadow: 0 0 10px var(--ft-footer-primary-glow); }

.farstube-footer-root .app-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--ft-footer-surface-color);
    padding: 12px 24px;
    border-radius: var(--ft-footer-radius-md);
    border: 1px solid var(--ft-footer-border-color);
    transition: var(--ft-footer-transition-bounce);
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.farstube-footer-root .app-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: linear-gradient(135deg, transparent, var(--ft-footer-primary), transparent); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: var(--ft-footer-transition-apple); }
.farstube-footer-root .app-btn:hover { background: var(--ft-footer-surface-solid); transform: translateY(-4px) scale(1.02); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.farstube-footer-root .app-btn:hover::before { opacity: 1; }
.farstube-footer-root .app-btn-icon { font-size: 32px; transition: var(--ft-footer-transition-bounce); line-height: 1; }
.farstube-footer-root .app-btn:hover .app-btn-icon { transform: scale(1.1) rotate(-5deg); color: var(--ft-footer-primary) !important; }
.farstube-footer-root .app-btn-text { display: flex; flex-direction: column; text-align: right; }
.farstube-footer-root .app-btn-sub { font-size: 11px; color: var(--ft-footer-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.farstube-footer-root .app-btn-title { font-size: 16px; font-weight: 900; }

.farstube-footer-root .footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 30px 0; border-top: 1px solid var(--ft-footer-border-color); color: var(--ft-footer-text-muted); font-size: 14px; font-weight: 600; flex-wrap: wrap; gap: 20px; position: relative; z-index: 1; }
.farstube-footer-root .footer-rules { display: flex; gap: 32px; flex-wrap: wrap; }
.farstube-footer-root .footer-rules a { position: relative; }
.farstube-footer-root .footer-rules a::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--ft-footer-primary); transform: scaleX(0); transition: transform .3s ease; transform-origin: right center; }
.farstube-footer-root .footer-rules a:hover { color: var(--ft-footer-text-main); }
.farstube-footer-root .footer-rules a:hover::after { transform: scaleX(1); }
.farstube-footer-root .love-text { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; line-height: 1.8; }
.farstube-footer-root .love-icon { color: var(--ft-footer-primary); animation: ft-footer-heartbeat 1.5s infinite cubic-bezier(.215,.61,.355,1); display: inline-block; filter: drop-shadow(0 0 5px var(--ft-footer-primary-glow)); }
@keyframes ft-footer-heartbeat { 0% {transform:scale(1)} 15% {transform:scale(1.3)} 30% {transform:scale(1)} 45% {transform:scale(1.3)} 60%,100% {transform:scale(1)} }

.farstube-footer-root .dev-link { color: var(--ft-footer-primary) !important; font-weight: 900; font-size: 15px; position: relative; transition: var(--ft-footer-transition-apple); padding: 2px 8px; border-radius: 8px; background: rgba(255,59,48,.1) !important; line-height: 1.6; }
.farstube-footer-root .dev-link:hover { background: var(--ft-footer-primary) !important; color: #fff !important; transform: translateY(-2px); box-shadow: 0 4px 12px var(--ft-footer-primary-glow); }
.farstube-footer-root .dev-modal-overlay { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; transition: var(--ft-footer-transition-apple); padding: 20px; }
.farstube-footer-root .dev-modal-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.farstube-footer-root .dev-modal-card { background: var(--ft-footer-surface-solid); border: 1px solid var(--ft-footer-border-color); border-radius: 32px; padding: 40px; width: 100%; max-width: 400px; text-align: center; position: relative; transform: scale(.9) translateY(20px); opacity: 0; transition: all .5s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 30px 60px rgba(0,0,0,.15); }
.farstube-footer-root .dev-modal-overlay.is-active .dev-modal-card { transform: scale(1) translateY(0); opacity: 1; }
.farstube-footer-root .dev-close { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; border-radius: 50%; background: var(--ft-footer-surface-hover) !important; color: var(--ft-footer-text-muted) !important; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: var(--ft-footer-transition-apple); }
.farstube-footer-root .dev-close:hover { background: var(--ft-footer-primary) !important; color: #fff !important; transform: rotate(90deg); }
.farstube-footer-root .dev-avatar { width: 100px; height: 100px; margin: 0 auto 20px; border-radius: 30px; background: var(--ft-footer-premium-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; box-shadow: 0 15px 30px rgba(245,158,11,.3); transform: rotate(-5deg); transition: var(--ft-footer-transition-bounce); }
.farstube-footer-root .dev-modal-card:hover .dev-avatar { transform: rotate(5deg) scale(1.05); }
.farstube-footer-root .dev-name { font-size: 24px; font-weight: 900; color: var(--ft-footer-text-main); margin: 0 0 8px; }
.farstube-footer-root .dev-title { font-size: 14px; font-weight: 600; color: var(--ft-footer-text-muted); margin: 0 0 30px; }
.farstube-footer-root .dev-action-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 16px; border-radius: 20px; font-size: 16px; font-weight: 800; transition: var(--ft-footer-transition-bounce); margin-bottom: 12px; position: relative; overflow: hidden; }
.farstube-footer-root .dev-action-btn.telegram { background: #2AABEE; color: #fff !important; box-shadow: 0 10px 20px rgba(42,171,238,.3); }
.farstube-footer-root .dev-action-btn.telegram:hover { background: #229ED9; transform: translateY(-3px); box-shadow: 0 15px 25px rgba(42,171,238,.4); }
.farstube-footer-root .dev-action-btn.phone { background: var(--ft-footer-surface-hover) !important; color: var(--ft-footer-text-main) !important; border: 2px solid transparent; }
.farstube-footer-root .dev-action-btn.phone:hover { border-color: var(--ft-footer-text-muted); transform: translateY(-3px); }
.farstube-footer-root .copy-toast { position: absolute; inset: 0; background: #10b981; color: #fff; border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; opacity: 0; transform: translateY(100%); transition: var(--ft-footer-transition-apple); z-index: 2; }
.farstube-footer-root .copy-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1200px) {
    .farstube-footer-root .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
    .farstube-footer-root .footer-apps { grid-column: span 3; flex-direction: row; align-items: center; justify-content: center; border-top: 1px solid var(--ft-footer-border-color); padding-top: 40px; margin-top: 20px; flex-wrap: wrap; }
    .farstube-footer-root .footer-apps .footer-title { width: 100%; text-align: center; }
}
@media (max-width: 900px) {
    .farstube-footer-root .ft-footer { padding-top: 48px; }
    .farstube-footer-root .footer-banner { padding: 30px 24px; flex-direction: column; text-align: center; margin-bottom: 48px; }
    .farstube-footer-root .banner-content p { max-width: 100%; }
    .farstube-footer-root .banner-form { width: 100%; max-width: 100%; }
    .farstube-footer-root .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
    .farstube-footer-root .footer-about { grid-column: span 2; align-items: center; text-align: center; padding-left: 0; }
    .farstube-footer-root .footer-apps { grid-column: span 2; flex-direction: column; }
    .farstube-footer-root .brand-desc { max-width: 100%; }
}
@media (max-width: 500px) {
    .farstube-footer-root .ft-footer-container { padding: 0 18px; }
    .farstube-footer-root .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .farstube-footer-root .footer-col { grid-column: span 1 !important; align-items: center !important; text-align: center; }
    .farstube-footer-root .footer-link:hover { transform: translateX(0) scale(1.05); }
    .farstube-footer-root .banner-form { flex-direction: column; background: transparent; border: none; padding: 0; box-shadow: none !important; transform: none !important; }
    .farstube-footer-root .banner-input { width: 100%; border: 2px solid var(--ft-footer-border-color); border-radius: var(--ft-footer-radius-full); height: 50px; background: var(--ft-footer-surface-solid); }
    .farstube-footer-root .banner-input:focus { border-color: var(--ft-footer-primary); }
    .farstube-footer-root .banner-btn { width: 100%; }
    .farstube-footer-root .newsletter-message { position: static; margin-top: 10px; text-align: center; }
    .farstube-footer-root .footer-bottom { flex-direction: column; justify-content: center; text-align: center; gap: 24px; }
    .farstube-footer-root .footer-rules { justify-content: center; gap: 20px; }
}
