/* ============================================================
   letsg.ro — Shared Styles: Header, Footer, Common Layout
   ============================================================ */

/* Embedded mode for native app WebView — hides chrome, keeps only the article content */
body.app-embed .site-header,
body.app-embed .site-footer,
body.app-embed .nav-mobile-drawer,
body.app-embed .nav-hamburger,
body.app-embed .lang-switcher,
body.app-embed .header-user { display: none !important; }
body.app-embed .page-content { padding-top: 16px !important; }
body.app-embed { background: #0f172a !important; }

:root {
    --bg-dark: #0f172a;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --glass-white: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-muted: rgba(255, 255, 255, 0.45);
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: hidden; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    color: white;
    overflow-x: hidden;
    scrollbar-width: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::-webkit-scrollbar { display: none; }

/* ── Animated background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 50%);
    animation: pulse-bg 15s infinite alternate ease-in-out;
    z-index: -1;
    pointer-events: none;
}
@keyframes pulse-bg {
    0%   { transform: translate(-25%,-25%) scale(1); }
    100% { transform: translate(-20%,-20%) scale(1.2); }
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 5vw, 48px);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.site-header .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.site-header .site-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 4vw, 32px);
}

.site-nav a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active { color: white; }


.site-nav a.nav-cta {
    background: var(--accent-blue);
    color: white;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.8rem;
}

.site-nav a.nav-cta:hover {
    background: #2563eb;
}

/* ── Nav dropdown ── */
.nav-dropdown {
    position: relative;
}
.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-dropdown > a::after {
    content: '▾';
    font-size: 0.65em;
    opacity: 0.6;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.97);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 6px 10px;   /* top padding creates visual gap without breaking hover */
    min-width: 230px;
    display: none;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(20px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 999;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
    display: flex;
}
.nav-dropdown-menu a {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: rgba(255,255,255,0.7) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s !important;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: rgba(255,255,255,0.07);
    color: white !important;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
    color: white;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}
.user-btn:hover { background: rgba(255,255,255,0.15); opacity: 1; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding: 48px clamp(16px, 5vw, 80px) 0;
    background: rgba(0,0,0,0.3);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.footer-brand .footer-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    margin-bottom: 16px;
    display: block;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: 220px;
    margin: 0 0 20px;
}

.footer-follow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 12px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}
.social-links a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.footer-col h4 {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin: 0 0 16px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.2s;
}
.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding: 20px 0;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

/* ================================================================
   PAGE WRAPPER (for non-training pages)
   ================================================================ */
.page-content {
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 60px;
    flex: 1;
}

/* ================================================================
   LEGAL PAGE STYLES
   ================================================================ */
.legal-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 40px);
}

.legal-content h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 8px;
}

.legal-content .legal-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 40px;
}

.legal-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: rgba(255,255,255,0.9);
}

.legal-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: rgba(255,255,255,0.8);
}

.legal-content p, .legal-content li {
    color: rgba(255,255,255,0.65);
    line-height: 1.75;
    font-size: 0.95rem;
}

.legal-content ul {
    padding-left: 20px;
    margin: 8px 0;
}

.legal-content a {
    color: var(--accent-blue);
    text-decoration: none;
}
.legal-content a:hover { text-decoration: underline; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
/* ================================================================
   HAMBURGER MENU
   ================================================================ */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-drawer {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 4px;
    z-index: 999;
}
.nav-mobile-drawer.open { display: flex; }
.nav-mobile-drawer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: color 0.2s;
}
.nav-mobile-drawer a:last-child { border-bottom: none; }
.nav-mobile-drawer a:hover,
.nav-mobile-drawer a.active { color: white; }
.nav-mobile-drawer a.nav-cta {
    margin-top: 8px;
    background: var(--accent-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 100px;
    text-align: center;
    border-bottom: none;
}

@media (max-width: 640px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .site-nav a:not(.nav-cta) {
        display: none;
    }
    .nav-hamburger {
        display: flex;
    }
    /* Hide secondary header actions on mobile to keep only logo + main CTA + hamburger.
       DE/EN switch, PIP launcher and profile avatar all move into the hamburger drawer. */
    .site-header .lang-switcher,
    .site-header .header-user,
    .site-header #pip-launcher-btn { display: none !important; }
}

@media (min-width: 641px) {
    .nav-mobile-drawer { display: none !important; }
    .nav-hamburger { display: none !important; }
}

@media (max-width: 400px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   ARTICLE IMAGE / SVG LIGHTBOX
   ================================================================ */
.article-body svg, .article-wrap svg,
.article-body img:not(.site-logo):not(.footer-logo),
.article-wrap img:not(.site-logo):not(.footer-logo) {
    cursor: zoom-in;
    border-radius: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.article-body svg:hover, .article-wrap svg:hover,
.article-body img:not(.site-logo):not(.footer-logo):hover,
.article-wrap img:not(.site-logo):not(.footer-logo):hover {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.5), 0 8px 32px rgba(0,0,0,0.4);
    transform: scale(1.01);
}

.lb-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(5,10,24,0.93);
    backdrop-filter: blur(16px);
    align-items: center; justify-content: center;
    padding: 24px;
    cursor: zoom-out;
}
.lb-overlay.open { display: flex; }
.lb-overlay .lb-inner {
    width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 24px;
}
.lb-overlay .lb-inner svg,
.lb-overlay .lb-inner img {
    width: 100% !important;
    height: auto !important;
    max-height: 85vh;
    cursor: default;
    border-radius: 0;
    transform: none !important;
    box-shadow: none !important;
    display: block;
}
.lb-close {
    position: fixed; top: 16px; right: 20px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    transition: background 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }

/* ── Language Switcher ─────────────────────────────────────────────────── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    flex-shrink: 0;
}
.lang-btn {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    padding: 3px 7px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
}
.lang-btn:hover { color: rgba(255,255,255,0.8); }
.lang-btn.active {
    color: white;
    background: rgba(59,130,246,0.18);
    border-color: rgba(59,130,246,0.35);
}
.lang-sep { color: rgba(255,255,255,0.15); font-size: 0.65rem; }
@media (max-width: 600px) { .lang-switcher { margin-right: 4px; } }
