/* ═══════════════════════════════════════════════════════════════
   📻 HAJDUK „ПОЗДРАВЪ ДО ЕФИРА" — пълниятъ модалъ на радиото,
   портнатъ въ хайдушкия стилъ. Scoped .haj-scope.haj-pozdrav.
   Изпраща къмъ ИСТИНСКАТА опашка на radio-companion (презъ
   edge функцията radio-pozdrav); одобрение + ефиръ = въ радиото.
   ═══════════════════════════════════════════════════════════════ */

.haj-scope.haj-pozdrav {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(8, 6, 4, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;

    &.poz-hidden { display: none; }

    /* ── дървениятъ панелъ ── */
    & .poz-panel {
        position: relative;
        width: min(430px, 96vw);
        max-height: 94dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 14px;
        border: 1px solid #0e0902;
        background:
            repeating-linear-gradient(90deg, transparent 0 54px, rgba(0,0,0,0.14) 54px 56px, transparent 56px 110px),
            linear-gradient(174deg, #2c2013, #221910 45%, #1b130b);
        box-shadow: inset 0 1px 0 rgba(214,178,110,0.16), inset 0 0 60px rgba(0,0,0,0.45),
                    0 24px 60px rgba(0,0,0,0.65);
        padding: 18px 18px 20px;
    }
    & .poz-panel::before { /* месингова жичка отгоре */
        content: ''; position: absolute; left: 8%; right: 8%; top: 0; height: 2px;
        background: linear-gradient(90deg, transparent, rgba(207,166,45,0.55) 30%, rgba(240,216,120,0.75) 50%, rgba(207,166,45,0.55) 70%, transparent);
    }

    /* ── глава ── */
    & .poz-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
    & .poz-title {
        font-family: var(--font-display); font-size: 25px; color: var(--haj-bone);
        margin: 0; letter-spacing: 0.4px;
        text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    }
    & .poz-from { font-family: var(--font-hand); font-size: 18px; color: var(--haj-smoke); margin-top: 1px; }
    & .poz-from b { color: var(--haj-brass); font-weight: 700; }
    & .poz-x {
        flex: none; width: 40px !important; height: 40px !important;
        min-width: 0 !important; min-height: 0 !important;
        border-radius: 50%; border: none !important; cursor: pointer; padding: 0 !important;
        background: radial-gradient(circle at 35% 30%, #4a3a22, #2c2013 70%) !important;
        box-shadow: inset 0 0 0 1.5px rgba(207,166,45,0.4), 0 3px 8px rgba(0,0,0,0.5);
        color: #cfa62d; font-size: 18px;
        display: flex; align-items: center; justify-content: center;
    }
    & .poz-x:active { transform: translateY(1px); }

    /* ── бележката (пергаментъ съ редове) ── */
    & .poz-note {
        position: relative;
        background:
            repeating-linear-gradient(180deg, transparent 0 33px, rgba(58,42,24,0.16) 33px 34px),
            linear-gradient(172deg, #f0e4c6, #ecdfc0 55%, #ddcaa0);
        border-radius: 5px;
        border: 1px solid rgba(90,66,30,0.35);
        box-shadow: inset 0 0 24px rgba(120,90,40,0.14), 0 8px 18px rgba(0,0,0,0.45);
        padding: 12px 14px 8px;
    }
    & .poz-note-head {
        text-align: center; font-family: var(--font-body); font-weight: 700;
        font-size: 11px; letter-spacing: 2.6px; color: #8a6d3a; margin-bottom: 8px;
    }
    & .poz-note-head::before, & .poz-note-head::after { content: ' — '; color: rgba(138,109,58,0.6); }
    & .poz-to-row {
        display: flex; align-items: baseline; gap: 8px;
        border-bottom: 1.5px solid rgba(58,42,24,0.35);
        padding-bottom: 4px; margin-bottom: 2px;
    }
    & .poz-to-row span { font-family: var(--font-hand); font-size: 20px; color: #5a4426; }
    & .poz-to-row input {
        flex: 1; border: none; outline: none; background: none;
        font-family: var(--font-hand); font-size: 20px; color: var(--ink, #3a2a18);
        padding: 0; min-width: 0;
    }
    & .poz-to-row input::placeholder { color: rgba(90,68,38,0.55); }
    & textarea.poz-text {
        display: block; width: 100%; min-height: 150px; resize: none;
        border: none; outline: none; background: none;
        font-family: var(--font-hand); font-size: 22px; line-height: 34px;
        color: var(--ink, #3a2a18); padding: 0;
    }
    & textarea.poz-text::placeholder { color: rgba(90,68,38,0.5); }
    & .poz-count {
        text-align: right; font-family: var(--font-body); font-weight: 700;
        font-size: 12px; letter-spacing: 1.5px; color: #8a6d3a; padding: 2px 0 2px;
    }

    /* ── секционни заглавия ── */
    & .poz-sec {
        display: flex; align-items: center; gap: 10px;
        font-family: var(--font-body); font-weight: 700; font-size: 12px;
        letter-spacing: 2.4px; color: var(--haj-brass-dim, #93803a);
        margin: 16px 0 8px;
    }
    & .poz-sec::after { content: ''; flex: 1; height: 1px; background: rgba(147,128,58,0.3); }
    & .poz-opt { font-family: var(--font-hand); font-size: 15px; letter-spacing: 0.4px; color: var(--haj-smoke); text-transform: none; font-weight: 500; }

    /* ── песенъ отъ крошнята ── */
    & .poz-song { position: relative; }
    & .poz-song input {
        width: 100%; border-radius: 8px;
        border: 1px solid rgba(147,128,58,0.4);
        background: linear-gradient(160deg, #33241a, #241811);
        box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
        font-family: var(--font-hand); font-size: 19px; color: var(--haj-bone);
        padding: 10px 12px; outline: none;
    }
    & .poz-song input::placeholder { color: rgba(168,179,154,0.55); }
    & .poz-songlist {
        margin-top: 6px; border-radius: 8px; overflow: hidden;
        border: 1px solid rgba(147,128,58,0.35);
        background: #1b130b;
        box-shadow: 0 10px 22px rgba(0,0,0,0.55);
    }
    & .poz-songrow {
        display: block; width: 100%; text-align: left; cursor: pointer;
        border: none !important; background: none !important; box-shadow: none !important;
        min-height: 0 !important;
        padding: 9px 12px !important;
        font-family: var(--font-body); font-size: 14px; color: var(--haj-bone);
        border-bottom: 1px solid rgba(147,128,58,0.14) !important;
    }
    & .poz-songrow b { color: var(--haj-brass); font-weight: 700; }
    & .poz-songrow:active { background: rgba(207,166,45,0.12) !important; }
    & .poz-songempty { padding: 9px 12px; font-family: var(--font-hand); font-size: 16px; color: var(--haj-smoke); }
    & .poz-songpick[hidden], & .poz-songlist[hidden] { display: none; }
    & .poz-songpick {
        margin-top: 8px; display: flex; align-items: center; gap: 8px;
        background: linear-gradient(172deg, #f0e4c6, #ddcaa0);
        border-radius: 6px; padding: 8px 10px;
        border: 1px solid rgba(90,66,30,0.35);
        box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    }
    & .poz-songpick .t {
        flex: 1; font-family: var(--font-hand); font-size: 18px; color: var(--ink, #3a2a18);
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    & .poz-songpick .rm {
        flex: none; width: 26px !important; height: 26px !important;
        min-width: 0 !important; min-height: 0 !important; padding: 0 !important;
        border-radius: 50%; border: none !important; cursor: pointer;
        background: rgba(58,42,24,0.15) !important; color: #5a4426; font-size: 13px;
        display: flex; align-items: center; justify-content: center;
    }

    /* ── кой да го прочете ── */
    & .poz-djs { display: flex; gap: 10px; }
    & .poz-dj {
        flex: 1; cursor: pointer; text-align: center;
        border-radius: 10px; padding: 12px 6px 10px !important;
        border: 1px solid rgba(147,128,58,0.3) !important;
        background: linear-gradient(160deg, #2c2013, #1e1509) !important;
        box-shadow: inset 0 1px 0 rgba(214,178,110,0.08), 0 4px 10px rgba(0,0,0,0.4);
        min-height: 0 !important;
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }
    & .poz-knob {
        display: flex; align-items: center; justify-content: center;
        width: 54px; height: 54px; margin: 0 auto 7px; border-radius: 50%;
        background: radial-gradient(circle at 35% 30%, #4a3a22, #2a1e10 72%);
        box-shadow: inset 0 0 0 2px rgba(20,12,2,0.5), inset 0 2px 4px rgba(0,0,0,0.5), 0 2px 5px rgba(0,0,0,0.5);
        font-family: var(--font-display); font-size: 21px; color: #6d5a34;
        transition: background 0.15s ease, color 0.15s ease;
    }
    & .poz-dj-name { font-family: var(--font-display); font-size: 16px; color: var(--haj-smoke); }
    & .poz-dj-who {
        display: block; font-family: var(--font-body); font-weight: 700; font-size: 9px;
        letter-spacing: 2px; color: var(--haj-ember-hi, #f5924e); margin-top: 4px;
        visibility: hidden;
    }
    & .poz-dj.active {
        border-color: rgba(207,166,45,0.65) !important;
        box-shadow: inset 0 1px 0 rgba(214,178,110,0.14), 0 0 16px rgba(226,102,42,0.18), 0 4px 10px rgba(0,0,0,0.4);
    }
    & .poz-dj.active .poz-knob {
        background: radial-gradient(circle at 35% 30%, #f0d878, #cfa62d 55%, #93752a);
        color: #3a2a0c;
    }
    & .poz-dj.active .poz-dj-name { color: var(--haj-bone); }
    & .poz-dj.active .poz-dj-who { visibility: visible; }

    /* ── подсказка + изпращане ── */
    & .poz-hint {
        text-align: center; font-family: var(--font-hand); font-size: 18px;
        color: var(--haj-smoke); margin: 14px 0 10px;
    }
    & .poz-send {
        display: flex; align-items: center; justify-content: center;
        width: 100%; height: 54px; cursor: pointer;
        border: 1px solid #241804 !important; border-radius: 9px;
        background: linear-gradient(180deg, #e7c862, #b98f2e 45%, #8a6317) !important;
        box-shadow: inset 0 2px 0 rgba(255,240,190,0.5), inset 0 -4px 7px rgba(60,40,5,0.55), 0 10px 20px rgba(0,0,0,0.5);
        font-family: var(--font-display); font-size: 19px; letter-spacing: 3px; color: #392a0b;
        text-shadow: 0 1px 0 rgba(255,240,190,0.4);
        min-height: 0 !important;
        transition: transform 0.12s ease;
    }
    & .poz-send:active { transform: translateY(2px) scale(0.99); }
    & .poz-send[disabled] { opacity: 0.6; cursor: default; }
    & .poz-status {
        min-height: 22px; text-align: center;
        font-family: var(--font-hand); font-size: 18px; color: var(--haj-ember-hi, #f5924e);
        margin-top: 8px;
    }

    /* ── потвърждение: поздравътъ тръгна ── */
    & .poz-done[hidden] { display: none; }
    & .poz-done {
        position: absolute; inset: 0; z-index: 5;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 6px; padding: 24px; text-align: center;
        border-radius: inherit;
        background:
            repeating-linear-gradient(90deg, transparent 0 54px, rgba(0,0,0,0.14) 54px 56px, transparent 56px 110px),
            linear-gradient(174deg, #2c2013, #221910 45%, #1b130b);
    }
    & .poz-done-seal {
        width: 96px; height: 96px; margin-bottom: 10px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 38% 30%, #b04a40, #93312b 55%, #6e241f 100%);
        box-shadow: inset 0 0 0 6px rgba(110,36,31,0.55), inset 0 2px 6px rgba(255,190,170,0.28),
                    0 10px 24px rgba(0,0,0,0.55), 0 0 30px rgba(226,102,42,0.18);
    }
    & .poz-done-seal svg {
        width: 52px; height: 52px;
        filter: brightness(0) invert(0.92) sepia(0.25) drop-shadow(0 1px 1px rgba(60,10,5,0.6));
        opacity: 0.92;
    }
    & .poz-done-title {
        font-family: var(--font-display); font-size: 26px; color: var(--haj-bone);
        margin: 0; text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    }
    & .poz-done-text {
        font-family: var(--font-hand); font-size: 20px; line-height: 1.4;
        color: var(--haj-smoke); margin: 4px 0 18px;
    }
    & .poz-done-btn {
        width: min(220px, 70%); height: 50px; cursor: pointer;
        border: 1px solid #241804 !important; border-radius: 9px;
        background: linear-gradient(180deg, #e7c862, #b98f2e 45%, #8a6317) !important;
        box-shadow: inset 0 2px 0 rgba(255,240,190,0.5), inset 0 -4px 7px rgba(60,40,5,0.55), 0 10px 20px rgba(0,0,0,0.5);
        font-family: var(--font-display); font-size: 17px; letter-spacing: 3px; color: #392a0b;
        text-shadow: 0 1px 0 rgba(255,240,190,0.4);
        min-height: 0 !important;
    }
    & .poz-done-btn:active { transform: translateY(2px); }

    /* ── телефонъ: на цѣлъ екранъ, като въ радиото ── */
    @media (max-width: 640px) {
        & { padding: 0; align-items: stretch; justify-content: stretch; }
        & .poz-panel {
            width: 100%;
            height: 100dvh;
            max-height: none;
            border-radius: 0;
            border: none;
            padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
        }
        & .poz-panel::before { left: 0; right: 0; }
    }
}
