* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: white;
    /* Seamless white background for iframe embedding */
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile */
    display: block;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.chat-container {
    background: white;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    height: 90vh;
    height: 90dvh;
    /* Dynamic viewport height for mobile */
    max-height: none;
    min-height: 90vh;
    min-height: 90dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Landing Page Styles */
.landing-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.landing-page.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.landing-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.landing-header {
    padding: 0 20px 15px;
    text-align: center;
}

.landing-logo {
    width: 70px;
    /* height: 70px; */
    border-radius: 20%;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.landing-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.landing-subtitle {
    font-size: 12px;
    color: #666;
}

.landing-content {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px 20px;
    overflow-y: auto;
}

.landing-description {
    text-align: center;
    margin-bottom: 22px;
    margin-top: 10px;
}

.landing-description h2 {
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.landing-description p {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.question-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.question-card {
    background: #f7f7f8;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.question-card:hover {
    background: #ececf1;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.question-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.question-card-desc {
    font-size: 11px;
    color: #666;
}

.landing-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.landing-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.landing-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    overflow-y: auto;
    min-height: 64px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.landing-input::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.landing-input:focus {
    /* border-color: #667eea; */
    border-color: #38bdf8;
}

.landing-send-button {
    background: linear-gradient(135deg, #38bdf8 0%, #113251 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s,
    box-shadow 0.2s;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 64px;
}

.landing-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Chat Interface Styles */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.chat-interface.active {
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    background: #38bdf8;
    color: white;
    padding: 6px 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-logo {
    width: 40px;
    /* height: 40px; */
    border-radius: 20%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-info {
    flex: 1;
}

.header-info h1 {
    font-size: 18px;
    margin-bottom: 2px;
}

.header-info p {
    font-size: 12px;
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.chat-messages::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.bot {
    align-items: flex-start;
}

.bot-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bot-avatar {
    width: 36px;
    /* height: 28px; */
    border-radius: 20%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bot-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 16px;
}

.message.user .message-bubble {
    background: #38bdf8;
    color: white;
}

.message.bot .message-bubble {
    background: #f8f9fa;
    color: #333;
    box-shadow: none;
    border: 1px solid #e9ecef;
    margin-left: 36px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

.message.bot .message-time {
    margin-left: 36px;
}

.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 18px;
    width: 70px;
    border: 1px solid #e9ecef;
    margin-left: 36px;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    overflow-y: auto;
    min-height: 64px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.chat-input::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.chat-input:focus {
    border-color: #38bdf8;
}

.send-button {
    background: linear-gradient(135deg, #38bdf8 0%, #113251 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s,
    box-shadow 0.2s;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 64px;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #ff4444;
    color: white;
    padding: 10px;
    border-radius: 10px;
    margin: 10px 20px;
    font-size: 14px;
    display: none;
}

.error-message.active {
    display: block;
}

.quick-questions {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 46px;
}

.quick-question {
    background: #f0f0f0;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
    min-height: 32px;
}

.quick-question:hover {
    background: #e0e0e0;
}


.company-footer {
    /* margin-top: 1.2rem; */
    padding-top: 1rem;
    padding-bottom: 1.1rem;
    border-top: 1px solid #333;
    background: #333;
    text-align: center;
}

.company-footer p {
    font-size: 0.7rem;
    /* line-height: 1.4; */
    color: white;
}

.company-footer a {
    font-weight: bold;
    color: #38bdf8;
}


/* ========================================= */
/* Responsive Design for Mobile and Tablets */
/* ========================================= */
@media (max-width: 900px) {
    body {
        padding: 0;
        min-height: 100dvh;
        /* Dynamic viewport height */
    }

    .chat-container {
        border-radius: 0;
        height: 95vh;
        height: 95dvh;
        /* Dynamic viewport height for mobile */
        min-height: 95vh;
        min-height: 95dvh;
        max-height: none;
    }

    /* Landing Page Mobile */
    .landing-header {
        padding: 0 20px 12px;
        margin-top: 20px;
    }

    .landing-logo {
        width: 70px;
        /* height: 70px; */
        margin-bottom: 12px;
    }

    .landing-title {
        font-size: 26px;
    }

    .landing-subtitle {
        font-size: 13px;
    }

    .landing-content {
        padding: 0 20px 15px;
    }

    .landing-description {
        margin-bottom: 20px;
    }

    .landing-description h2 {
        font-size: 17px;
    }

    .landing-description p {
        font-size: 13px;
        padding: 0 5px;
    }

    .question-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        max-width: 100%;
    }

    .question-card {
        padding: 12px;
    }

    .question-card-title {
        font-size: 13px;
    }

    .question-card-desc {
        font-size: 11px;
    }

    .landing-footer {
        padding: 18px;
    }

    .landing-input {
        padding: 11px 15px;
        font-size: 14px;
    }

    .landing-send-button {
        padding: 11px 26px;
        font-size: 14px;
    }

    /* Chat Interface Mobile */
    .chat-header {
        padding: 6px 12px;
    }

    .header-logo {
        width: 35px;
        /* height: 35px; */
    }

    .header-info h1 {
        font-size: 16px;
    }

    .header-info p {
        font-size: 11px;
    }

    .chat-messages {
        padding: 15px;
        padding-top: 30px;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 14px;
    }

    .bot-avatar {
        width: 36px;
        /* height: 24px; */
    }

    .bot-name {
        font-size: 12px;
    }

    .message.bot .message-bubble {
        margin-left: 32px;
    }

    .message.bot .message-time {
        margin-left: 32px;
    }

    .typing-indicator {
        margin-left: 32px;
    }

    .quick-questions {
        padding: 8px 15px;
        gap: 6px;
    }

    .quick-question {
        padding: 6px 12px;
        font-size: 11px;
    }

    .chat-input-container {
        padding: 12px 15px;
    }

    .chat-input {
        padding: 10px 14px;
        font-size: 13px;
    }

    .send-button {
        padding: 10px 24px;
        font-size: 13px;
    }
}


/* ========================================= */
/* Extra small devices (phones, 480px and down) */
/* ========================================= */
@media (max-width: 480px) {
    body {
        padding: 0;
        min-height: 100dvh;
        /* Dynamic viewport height */
    }

    .chat-container {
        border-radius: 0;
        height: 95vh;
        height: 95dvh;
        /* Dynamic viewport height for mobile */
        min-height: 95vh;
        min-height: 95dvh;
        max-height: none;
    }

    /* Landing Page - Extra Small Mobile */
    .landing-header {
        padding: 0 15px 6px;
        margin-top: 24px;
        margin-bottom: 0;
    }

    .landing-logo {
        width: 90px;
        margin-bottom: 12px;
    }

    .landing-title {
        font-size: 26px;
    }

    .landing-subtitle {
        font-size: 16px;
    }

    .landing-content {
        padding: 0 15px 15px;
    }

    .landing-description {
        margin-bottom: 20px;
    }

    .landing-description h2 {
        font-size: 20px;
    }

    .landing-description p {
        font-size: 16px;
        padding: 0 4px;
    }

    .question-cards {
        gap: 10px;
    }

    .question-card {
        padding: 13px;
        padding-bottom: 16px;
    }

    .question-card-title {
        font-size: 17px;
    }

    .question-card-desc {
        font-size: 9px;
    }

    .landing-footer {
        padding: 15px;
    }

    .landing-input {
        font-size: 18px !important;
        min-height: 74px !important;
        max-height: 120px !important;
        padding: 12px 16px !important;
        white-space: normal !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
    }

    .landing-input-wrapper {
        gap: 12px;
    }

    .landing-send-button {
        font-size: 15px;
        min-height: 74px;
        padding: 12px 24px;
    }

    /* Chat Interface - Extra Small Mobile */
    .message-bubble {
        max-width: 90%;
        font-size: 18px;
        padding: 14px 18px;
    }

    .bot-message-header {
        margin-bottom: 8px;
    }

    .bot-avatar {
        width: 36px;
    }

    .bot-name {
        font-size: 16px;
    }

    .message.bot .message-bubble {
        margin-left: 40px;
    }

    .message.bot .message-time {
        margin-left: 40px;
        font-size: 12px;
    }

    .message.user .message-time {
        font-size: 12px;
    }

    .typing-indicator {
        margin-left: 40px;
        width: 77px;
        padding: 14px 18px;
    }

    .typing-indicator span {
        height: 9px;
        width: 9px;
    }

    .quick-questions {
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
        padding: 10px 16px;
        gap: 10px;
    }

    .quick-questions::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .quick-question {
        font-size: 17px;
        padding: 12px 18px;
        min-height: 42px;
        margin: 0;
    }

    .chat-input-container {
        padding: 16px;
    }

    .chat-input {
        font-size: 18px !important;
        min-height: 74px !important;
        max-height: 120px !important;
        padding: 12px 16px !important;
        white-space: normal !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
    }

    .send-button {
        padding: 12px 24px;
        font-size: 16px;
        min-height: 74px;
    }

    .error-message {
        font-size: 15px;
        padding: 14px;
        margin: 14px 16px;
    }
}

/* ===========================
   CLIENT-SPECIFIC OVERRIDES
   =========================== */

    {
    % if client_name=="scentific" %
}

/* Scentific-specific overrides - Using old CSS values for 480px */
@media (max-width: 480px) {

    /* Landing Page - Scentific Old Values */
    .landing-logo {
        width: 85px;
    }

    .landing-title {
        font-size: 22px;
    }

    .landing-subtitle {
        font-size: 12px;
    }

    .landing-description h2 {
        font-size: 16px;
    }

    .landing-description p {
        font-size: 11px;
    }

    .question-card-title {
        font-size: 13px;
    }

    .landing-input {
        font-size: 14px !important;
        min-height: 44px !important;
    }

    .landing-send-button {
        font-size: 15px;
        min-height: 44px;
    }

    /* Chat Interface - Scentific Old Values */
    .message-bubble {
        font-size: 14px;
        padding: 12px 16px;
    }

    .bot-avatar {
        width: 32px;
    }

    .bot-name {
        font-size: 14px;
    }

    .message.bot .message-bubble {
        margin-left: 36px;
    }

    .message.bot .message-time {
        margin-left: 36px;
        font-size: 11px;
    }

    .message.user .message-time {
        font-size: 11px;
    }

    .typing-indicator {
        margin-left: 36px;
        width: 70px;
        padding: 12px 16px;
    }

    .typing-indicator span {
        height: 8px;
        width: 8px;
    }

    .quick-question {
        font-size: 12px;
        padding: 10px 14px;
        min-height: 34px;
        margin: 2px 0;
    }

    .chat-input-container {
        padding: 14px 16px;
    }

    .chat-input {
        font-size: 12px !important;
        min-height: 44px !important;
    }

    .send-button {
        font-size: 15px;
        min-height: 44px;
    }

    .landing-footer .landing-input-wrapper .landing-input {
        font-size: 12px !important;
    }

    .chat-input-container .chat-input-wrapper .chat-input {
        font-size: 12px !important;

        .error-message {
            font-size: 13px;
            padding: 12px;
            margin: 12px 16px;
        }
    }

        {
        % endif %
    }