/* Erzsébet Patika - Premium Chatbot & Medical Profile Styles */

.ep-assistant-wrap {
    max-width: 820px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

/* ===================== HERO: CHAT ===================== */
.ep-chat-hero {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 1000px;
    box-sizing: border-box;
}

/* Panel Header */
.ep-panel-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.ep-panel-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-panel-header p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* ===================== Figyelmeztető sáv ===================== */
.ep-profile-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.45;
}

.ep-profile-alert.is-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ep-profile-alert.is-complete {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.ep-alert-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.ep-alert-text {
    flex: 1;
    min-width: 200px;
}

.ep-alert-btn {
    flex-shrink: 0;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.ep-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.35);
}

/* ===================== Chat üzenetek ===================== */
.ep-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ep-message {
    display: flex;
    max-width: 85%;
    min-width: 0;
    border-radius: 16px;
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ep-system-msg {
    align-self: flex-start;
    background-color: #fff;
    color: #334155;
    border-left: 4px solid #6366f1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ep-user-msg {
    align-self: flex-end;
    background-color: #6366f1;
    color: #fff;
}

.ep-typing {
    opacity: 0.55;
    font-style: italic;
}

.ep-chat-input-area {
    display: flex;
    gap: 12px;
}

.ep-chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

/* ===================== Gombok ===================== */
.ep-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ep-btn:hover {
    transform: translateY(-1px);
}

.ep-btn:active {
    transform: translateY(0);
}

.ep-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.ep-btn-success:hover {
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.3);
}

.ep-feedback-msg {
    font-size: 14px;
}

.ep-feedback-msg.success {
    color: #10b981;
}

.ep-feedback-msg.error {
    color: #ef4444;
}

/* ===================== MODAL / POPUP ===================== */
.ep-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
}

.ep-modal-overlay.is-open {
    display: flex;
    animation: epFadeIn .2s ease;
}

@keyframes epFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ep-modal {
    background: #fff;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    margin: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: epSlideUp .25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes epSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.ep-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ep-modal-head h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.ep-modal-close {
    border: none;
    background: #f1f5f9;
    color: #475569;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
}

.ep-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ep-modal-body {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
}

.ep-modal-foot {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.ep-modal-foot .ep-feedback-msg {
    margin-top: 10px;
}

.ep-modal-intro {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 22px 0;
    line-height: 1.5;
}

body.ep-modal-lock {
    overflow: hidden;
}

/* ===================== Form (a popupban) ===================== */
.ep-form-section {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.ep-form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 15px;
}

.ep-form-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ep-form-group {
    margin-bottom: 18px;
}

.ep-form-group:last-child {
    margin-bottom: 0;
}

.ep-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.ep-form-group label.sub-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.ep-form-row {
    display: flex;
    gap: 15px;
}

.ep-form-group.half {
    flex: 1;
}

.ep-profile-form-wrap input[type="text"],
.ep-profile-form-wrap input[type="number"],
.ep-profile-form-wrap input[type="date"],
.ep-profile-form-wrap select,
.ep-profile-form-wrap textarea {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background-color: #fff;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ep-profile-form-wrap input:focus,
.ep-profile-form-wrap select:focus,
.ep-profile-form-wrap textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.ep-profile-form-wrap textarea {
    resize: vertical;
}

/* Rádiók és checkboxok */
.ep-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 6px 0;
}

.ep-radio-group label,
.ep-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.ep-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 6px 0;
}

.ep-profile-form-wrap input[type="radio"],
.ep-profile-form-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: #6366f1;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ep-profile-form-wrap input[type="radio"] {
    border-radius: 50%;
}

.ep-profile-form-wrap input[type="radio"]::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #fff;
}

.ep-profile-form-wrap input[type="radio"]:checked::before {
    transform: scale(1);
}

.ep-profile-form-wrap input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 8px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.ep-profile-form-wrap input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.ep-profile-form-wrap input[type="radio"]:checked,
.ep-profile-form-wrap input[type="checkbox"]:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

/* Dinamikus szekció (női mezők) */
.ep-form-section.hidden {
    display: none !important;
}

.ep-form-actions {
    margin-top: 24px;
}

/* Scrollbar */
.ep-modal-body::-webkit-scrollbar,
.ep-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ep-modal-body::-webkit-scrollbar-track,
.ep-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ep-modal-body::-webkit-scrollbar-thumb,
.ep-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.ep-modal-body::-webkit-scrollbar-thumb:hover,
.ep-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===================== GDPR Modal ===================== */
.ep-gdpr-overlay {
    z-index: 999999;
}

.ep-gdpr-modal {
    max-width: 540px;
}

.ep-gdpr-section {
    margin-bottom: 18px;
}

.ep-gdpr-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.ep-gdpr-section p {
    font-size: 13px;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

.ep-gdpr-list {
    margin: 6px 0 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}

.ep-gdpr-openai-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
}

.ep-gdpr-openai-warning h4 {
    color: #92400e;
}

.ep-gdpr-openai-warning p {
    color: #78350f;
}

.ep-gdpr-checks {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ep-gdpr-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.ep-gdpr-check-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #6366f1;
    cursor: pointer;
}

.ep-gdpr-check-row a {
    color: #6366f1;
    text-decoration: underline;
}

/* ===================== Recept scan gomb ===================== */
.ep-btn-scan {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    padding: 0 18px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ep-btn-scan:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.35);
}

.ep-btn-scan:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================== Recept scan consent modal ===================== */
.ep-scan-modal {
    max-width: 520px;
}

/* Animáció wrapper */
.ep-scan-consent-anim-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.ep-scan-anim-container {
    position: relative;
    width: 220px;
    height: 360px;
    overflow: hidden;
    border-radius: 12px;
}

.ep-scan-anim-recept {
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
    user-select: none;
}

.ep-scan-anim-kez {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    animation: epHandCover 3s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes epHandCover {
    0%   { transform: translateY(-55%); opacity: 0.4; }
    15%  { opacity: 1; }
    40%  { transform: translateY(10%); }
    65%  { transform: translateY(10%); }
    85%  { transform: translateY(-55%); opacity: 1; }
    100% { transform: translateY(-55%); opacity: 0.4; }
}

/* Szöveg rész */
.ep-scan-consent-text {
    padding: 0 2px;
}

.ep-scan-consent-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.ep-scan-consent-text p {
    font-size: 13px;
    color: #334155;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.ep-scan-tips {
    margin: 0 0 14px 0;
    padding-left: 20px;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}

.ep-scan-consent-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.5;
}

/* ===================== Scan eredmények ===================== */
.ep-scan-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ep-scan-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-scan-query {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.ep-scan-warning {
    font-size: 12px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 10px;
}

.ep-scan-product {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.ep-scan-product.ep-out-of-stock {
    opacity: 0.65;
}

.ep-scan-prod-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    min-width: 0;
}

.ep-scan-prod-price {
    font-size: 13px;
    color: #6366f1;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.ep-scan-cart-btn {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .15s ease;
    box-shadow: 0 2px 8px rgba(16,185,129,.25);
}

.ep-scan-cart-btn:hover {
    box-shadow: 0 4px 12px rgba(16,185,129,.4);
    transform: translateY(-1px);
    color: #fff !important;
}

.ep-scan-no-stock {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
    font-style: italic;
}

.ep-scan-not-found {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

.ep-scan-disclaimer {
    font-size: 12px;
    color: #64748b;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 8px 12px;
    line-height: 1.5;
}

/* ===================== Reszponzív ===================== */
@media (max-width: 600px) {
    .ep-chat-hero {
        height: auto;
        min-height: 70vh;
        padding: 20px;
    }

    .ep-profile-alert {
        flex-direction: column;
        align-items: flex-start;
    }

    .ep-alert-btn {
        width: 100%;
    }

    .ep-modal-head {
        padding: 16px 18px;
    }

    .ep-modal-body {
        padding: 18px;
    }
}
