/* ============================================
   DarChat End User Shell
   Light-mode redesign layer for end-user apps.
   Styles only the UI shell, never the logic.
   ============================================ */

body.enduser-app {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(203, 213, 225, 0.42), transparent 32%),
        radial-gradient(circle at 100% 0, rgba(226, 232, 240, 0.56), transparent 26%),
        linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 50%, #edf2f7 100%);
    color: #0f172a;
}

body.enduser-app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 28%),
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.7), transparent 22%);
    z-index: 0;
}

body.enduser-app > * {
    position: relative;
    z-index: 1;
}

body.enduser-app #authSection {
    max-width: min(34rem, 100%) !important;
    margin-inline: auto;
    padding-block: clamp(1rem, 4vw, 2rem);
}

body.enduser-app #chatSection {
    width: 100%;
    max-width: min(70rem, 100%) !important;
    margin-inline: auto;
    padding-block: clamp(0.75rem, 3vw, 1.5rem);
}

body.enduser-app #authSection .auth-card {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12) !important;
    border-radius: 28px !important;
}

body.enduser-app .auth-mode-badge {
    background: #111827 !important;
    color: #ffffff !important;
}

body.enduser-app .auth-brand-mark {
    background: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

body.enduser-app .auth-brand-title,
body.enduser-app .text-gray-800 {
    color: #0f172a !important;
}

body.enduser-app .auth-brand-subtitle,
body.enduser-app .text-gray-500,
body.enduser-app .text-gray-400 {
    color: #64748b !important;
}

body.enduser-app #authSection input[type="text"],
body.enduser-app #authSection input[type="tel"],
body.enduser-app #authSection input[type="password"] {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid #d9e1ea !important;
    border-radius: 18px !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.enduser-app #authSection input:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08) !important;
}

body.enduser-app .auth-primary-btn,
body.enduser-app #authButton,
body.enduser-app #verifyOtpBtn {
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #111827 !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 32px rgba(17, 24, 39, 0.18);
}

body.enduser-app .auth-primary-btn:hover,
body.enduser-app #authButton:hover,
body.enduser-app #verifyOtpBtn:hover {
    background: #020617 !important;
    border-color: #020617 !important;
    box-shadow: 0 22px 36px rgba(2, 6, 23, 0.22);
}

body.enduser-app .auth-text-link,
body.enduser-app .text-teal-600 {
    color: #0f172a !important;
}

body.enduser-app .step-dot.active,
body.enduser-app .step-line.active {
    background: #111827 !important;
}

body.enduser-app .otp-inputs input {
    width: 56px;
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    border-color: #d9e1ea;
    border-radius: 18px;
    color: #0f172a;
}

body.enduser-app .otp-inputs input:focus,
body.enduser-app .otp-inputs input.filled {
    border-color: #111827;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}

body.enduser-app .resend-timer {
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
}

body.enduser-app .resend-timer .countdown {
    color: #0f172a;
}

body.enduser-app #chatSection .chat-container {
    min-height: min(88vh, 880px);
    height: min(88vh, 880px);
    border-radius: 32px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12) !important;
}

body.enduser-app #chatSection .bg-teal-600.text-white {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #0f172a !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.96);
}

body.enduser-app #chatSection .bg-teal-600.text-white .text-teal-200 {
    color: #64748b !important;
}

body.enduser-app #statusIndicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.96);
    color: #475569 !important;
    font-weight: 600;
}

body.enduser-app #chatSection .w-10.h-10.bg-white.bg-opacity-20 {
    background: #111827 !important;
    color: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.16);
}

body.enduser-app #chatSection button[title="Logout"] {
    background: rgba(248, 250, 252, 0.92);
    color: #64748b !important;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 14px !important;
}

body.enduser-app #chatSection button[title="Logout"]:hover {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

body.enduser-app #messagesContainer {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.92) 100%) !important;
    padding: 1.35rem !important;
}

body.enduser-app #typingIndicator,
body.enduser-app #euMediaPreview {
    background: transparent !important;
    border-top: 0 !important;
    padding-inline: 1.35rem !important;
}

body.enduser-app .typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.96);
    color: #64748b;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

body.enduser-app .message-bubble {
    border-radius: 24px !important;
    padding: 1rem 1rem !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

body.enduser-app .message-bubble.bg-teal-600.text-white {
    background: #111827 !important;
    color: #ffffff !important;
}

body.enduser-app .message-bubble.bg-teal-600.text-white .text-teal-200 {
    color: #cbd5e1 !important;
}

body.enduser-app .message-bubble.bg-white.shadow {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #0f172a !important;
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08) !important;
}

body.enduser-app .message-bubble.bg-gradient-to-r.from-teal-50.to-sky-50.border.border-teal-100 {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
    color: #334155 !important;
    border: 1px dashed #cbd5e1 !important;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06) !important;
}

body.enduser-app .eu-media-img,
body.enduser-app .eu-media-video {
    border-radius: 18px !important;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.1);
}

body.enduser-app .eu-file-card {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #0f172a !important;
    border: 1px solid rgba(226, 232, 240, 0.96) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

body.enduser-app .message-bubble.bg-teal-600.text-white .eu-file-card {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: none;
}

body.enduser-app .eu-file-dl {
    background: rgba(241, 245, 249, 0.98) !important;
    color: #475569 !important;
}

body.enduser-app .eu-file-dl:hover {
    background: #e2e8f0 !important;
}

body.enduser-app .message-bubble.bg-teal-600.text-white .eu-file-dl {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

body.enduser-app #chatSection .p-4.bg-white.border-t {
    background: rgba(255, 255, 255, 0.9) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.96) !important;
    padding: 1rem 1.35rem !important;
}

body.enduser-app #chatSection input[type="text"]#messageInput {
    background: rgba(248, 250, 252, 0.98) !important;
    border: 1px solid rgba(226, 232, 240, 0.96) !important;
    color: #0f172a !important;
    min-height: 52px;
    border-radius: 999px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.enduser-app #chatSection input[type="text"]#messageInput:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08) !important;
}

body.enduser-app #chatSection button.p-2.text-gray-400 {
    width: 48px;
    height: 48px;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.96);
    color: #64748b !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

body.enduser-app #chatSection button.p-2.text-gray-400:hover {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

body.enduser-app #chatSection button.p-3.bg-teal-600.text-white {
    width: 52px;
    height: 52px;
    border-radius: 16px !important;
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #111827 !important;
    box-shadow: 0 18px 30px rgba(17, 24, 39, 0.2);
}

body.enduser-app #chatSection button.p-3.bg-teal-600.text-white:hover {
    background: #020617 !important;
    border-color: #020617 !important;
}

body.enduser-app #euMediaPreview > div {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(226, 232, 240, 0.96) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

body.enduser-app .messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.enduser-app .messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 768px) {
    body.enduser-app {
        padding: 0.85rem !important;
    }

    body.enduser-app #chatSection {
        padding: 0;
    }

    body.enduser-app #chatSection .chat-container {
        min-height: calc(100vh - 1.7rem);
        height: calc(100vh - 1.7rem);
        border-radius: 26px !important;
    }

    body.enduser-app #messagesContainer {
        padding: 1rem !important;
    }
}
