/* ========================================
   INVITE MODAL — pozvánka emailem
   BEM METODIKA — MOBILE FIRST
   ======================================== */

/* ========================================
   OVERLAY A POZICOVÁNÍ
   ======================================== */

.invite-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.invite-modal--visible {
    opacity: 1;
    visibility: visible;
}

.invite-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    touch-action: none;
}

/* ========================================
   BOX — MOBIL (slide up from bottom)
   ======================================== */

.invite-modal__box {
    position: relative;
    width: 100%;
    max-height: 92vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

.invite-modal--visible .invite-modal__box {
    transform: translateY(0);
}

/* ========================================
   ZÁHLAVÍ
   ======================================== */

.invite-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.invite-modal__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.invite-modal__header-info svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #667eea;
}

.invite-modal__header-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.invite-modal__header-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.invite-modal__header-station {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    color: #6b7280;
    transition: background 0.15s;
}

.invite-modal__close:hover {
    background: #e5e7eb;
}

.invite-modal__close svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   TĚLO (scrollovatelné)
   ======================================== */

.invite-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 16px;
}

/* Pole formuláře */
.invite-modal__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.invite-modal__preview {
    margin-bottom: 4px;
}

.invite-modal__label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.invite-modal__label--editable {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #667eea;
}

.invite-modal__label--editable svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.invite-modal__label--editable em {
    font-style: normal;
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
}

.invite-modal__required {
    color: #ef4444;
}

/* Email input */
.invite-modal__email {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.invite-modal__email:focus {
    border-color: #667eea;
}

.invite-modal__email--error {
    border-color: #ef4444;
    animation: inviteShake 0.3s ease;
}

@keyframes inviteShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Chybová hláška nad emailem */
.invite-modal__email-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #b91c1c;
    line-height: 1.4;
    margin-bottom: 8px;
}

.invite-modal__email-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #dc2626;
    stroke-width: 2.5;
}

.invite-modal__email-error--visible {
    display: flex;
}

/* Tlačítko Pokračovat (mobilní UX) */
.invite-modal__next-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #667eea;
    background: #f0f3ff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.invite-modal__next-btn:hover {
    background: #e0e7ff;
}

.invite-modal__next-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .invite-modal__next-btn {
        display: none;
    }
}

/* Textarea */
.invite-modal__msg {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #1a1a2e;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    outline: none;
    resize: vertical;
    min-height: 150px;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.6;
    background: #f0f3ff;
}

.invite-modal__msg:focus {
    border-color: #667eea;
    background: #fff;
}

/* Toggle náhledu */
.invite-modal__preview-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: none;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    margin-bottom: 10px;
}

.invite-modal__preview-toggle svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.invite-modal__preview-toggle:hover,
.invite-modal__preview-toggle--open {
    background: #f0f3ff;
}

/* ========================================
   EMAIL PREVIEW — Pedia.dog branded design
   ======================================== */

.invite-modal__preview {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.08);
}

.invite-modal__email-wrap {
    font-size: 13px;
    line-height: 1.55;
    color: #374151;
    background: #f8f7fc;
}

/* ---- Hlavička emailu ---- */
.invite-modal__email-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 28px 20px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9b59b6 100%);
    overflow: hidden;
    text-align: center;
}

.invite-modal__email-header-paws {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    color: #fff;
}

.invite-modal__email-paw {
    position: absolute;
}

.invite-modal__email-paw--1 {
    width: 60px;
    height: 60px;
    top: -8px;
    right: 12px;
    transform: rotate(25deg);
}

.invite-modal__email-paw--2 {
    width: 44px;
    height: 44px;
    bottom: 4px;
    left: 8px;
    transform: rotate(-15deg);
}

.invite-modal__email-paw--3 {
    width: 32px;
    height: 32px;
    top: 6px;
    left: 40%;
    transform: rotate(40deg);
}

.invite-modal__email-logo {
    height: 44px;
    width: auto;
    display: block;
    filter: brightness(0) saturate(100%) invert(1);
    position: relative;
    z-index: 1;
}

.invite-modal__email-tagline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

.invite-modal__email-header-line {
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* ---- Přivítání ---- */
.invite-modal__email-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px 14px;
    background: #fff;
}

.invite-modal__email-greeting-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: -24px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.invite-modal__email-greeting-icon svg {
    width: 18px;
    height: 18px;
}

.invite-modal__email-greeting-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ---- Tělo emailu ---- */
.invite-modal__email-body {
    background: #fff;
}

/* Bloky */
.invite-modal__email-block {
    padding: 14px 16px;
}

.invite-modal__email-block p {
    margin: 0 0 6px;
}

.invite-modal__email-block p:last-child {
    margin-bottom: 0;
}

.invite-modal__email-block--fixed {
    background: #faf9fe;
    border-top: 1px solid #f0edf8;
}

.invite-modal__email-block--editable {
    background: #f0f3ff;
    border-top: 1px solid #e0e7ff;
    border-bottom: 1px solid #e0e7ff;
}

.invite-modal__email-block-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.invite-modal__email-block-label svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.invite-modal__email-block--fixed .invite-modal__email-block-label {
    color: #c4b5d8;
}

.invite-modal__email-block--editable .invite-modal__email-block-label {
    color: #667eea;
}

/* Text osobní zprávy v náhledu */
.invite-modal__email-msg-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    word-break: break-word;
}

/* ---- Výhody — karty s ikonami ---- */
.invite-modal__email-benefits-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.invite-modal__email-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.invite-modal__email-benefit {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #f0edf8;
    border-radius: 10px;
}

.invite-modal__email-benefit-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ede9fe;
    color: #764ba2;
}

.invite-modal__email-benefit-icon svg {
    width: 20px;
    height: 20px;
}

.invite-modal__email-benefit div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.invite-modal__email-benefit strong {
    font-size: 12px;
    color: #1a1a2e;
}

.invite-modal__email-benefit span {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

/* ---- CTA tlačítko ---- */
.invite-modal__email-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.invite-modal__email-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
}

.invite-modal__email-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.invite-modal__email-link {
    font-size: 12px;
    color: #667eea;
    text-decoration: underline;
}

/* ---- Patička emailu ---- */
.invite-modal__email-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 16px;
    background: linear-gradient(135deg, #2d2150 0%, #1a1a2e 100%);
    text-align: center;
}

.invite-modal__email-footer-brand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.invite-modal__email-footer-logo {
    height: 18px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.invite-modal__email-footer-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.invite-modal__email-footer-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.invite-modal__email-footer-links a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
}

.invite-modal__email-footer-links a:hover {
    color: rgba(255, 255, 255, 0.6);
}

.invite-modal__email-footer-links span {
    color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   PATIČKA MODALU (sticky)
   ======================================== */

.invite-modal__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 20px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.invite-modal__send {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.invite-modal__send:hover {
    opacity: 0.88;
}

.invite-modal__send svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.invite-modal__cancel {
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    white-space: nowrap;
}

.invite-modal__cancel:hover {
    color: #6b7280;
}

/* ========================================
   TABLET A DESKTOP (768px+)
   ======================================== */

@media (min-width: 768px) {
    .invite-modal {
        align-items: center;
        padding: 20px;
    }

    .invite-modal__box {
        width: 100%;
        max-width: 580px;
        max-height: 88vh;
        border-radius: 16px;
        transform: scale(0.94) translateY(16px);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    }

    .invite-modal--visible .invite-modal__box {
        transform: scale(1) translateY(0);
    }

    .invite-modal__header {
        padding: 18px 20px 16px;
    }

    .invite-modal__body {
        padding: 20px;
        gap: 14px;
    }

    .invite-modal__footer {
        padding: 14px 20px 18px;
    }
}
