* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* Global scrollbar hiding */
::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation; /* Improves touch experience */
}

.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-y: auto;
}

.chat-section {
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.model-selector {
    align-self: flex-start;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    margin-bottom: 15px;
    cursor: pointer;
}

.model-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 0.7rem;
}

.chat-container {
    width: 100%;
    height: 100%;
    /* background-color: #fff; */
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    cursor: pointer;
    position: relative;
    /* transition: all 0.3s ease; */
}

.chat-header {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
}

.chat-messages {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.chat-messages::-webkit-scrollbar {
    display: none;
}

.message {
    display: flex;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background-color: #0084ff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message.system {
    align-self: center;
    background-color: #ffe58f;
    color: #333;
    font-size: 0.9rem;
    border-radius: 10px;
}

.message.loading {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: #888;
    border-bottom-left-radius: 5px;
}

.chat-input {
    width: 100%;
    position: sticky;
    bottom: 0;
    padding: 10px 0;
    margin-top: auto;
    z-index: 50;
}

#user-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 0.95rem;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#user-input:focus {
    border-color: #0084ff;
    box-shadow: 0 2px 8px rgba(0,132,255,0.2);
}

.chat-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.action-btn {
    background: none;
    border: none;
    padding: 5px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #555;
}

.action-btn span {
    display: inline-block;
}

.feature-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
}

.feature-btn {
    background: none;
    border: none;
    padding: 5px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
}

.feature-btn span {
    display: inline-block;
}

.website-info {
    width: 100%;
    max-width: 800px;
    /* background-color: #fff; */
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); */
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
    /* transition: all 0.3s ease; */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for website info section */
.website-info::-webkit-scrollbar {
    display: none;
}

.info-section {
    margin-bottom: 30px;
    text-align: left;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.info-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.info-section ul, .info-section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #555;
}

.faq-item {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.faq-item p {
    margin-bottom: 0;
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background-color: transparent;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.icp-info p, .contact-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.icp-info a, .contact-info a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.icp-info a:hover, .contact-info a:hover {
    color: #0084ff;
    text-decoration: underline;
}

/* Tablet Styles (768px and below) */
@media (max-width: 768px) {
    .chat-header h1 {
        font-size: 1.3rem;
    }

    .chat-container {
        padding: 20px;
    }

    .chat-actions, .feature-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .action-btn, .feature-btn {
        margin: 5px;
    }

    .website-info {
        padding: 20px;
        margin-top: 20px;
    }

    .info-section h2 {
        font-size: 1.3rem;
    }
}

/* Mobile Styles (600px and below) */
@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .main-container {
        height: 100vh;
        overflow: hidden;
    }

    .chat-section {
        height: 100%;
        max-width: 100%;
    }

    .chat-container {
        padding: 15px;
        height: 100%;
        border-radius: 0;
    }

    .chat-header h1 {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 20px;
    }

    .chat-messages {
        flex: 1;
    }

    .message {
        max-width: 90%;
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    .chat-actions {
        margin-top: 10px;
        gap: 5px;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 0.85rem;
    }

    .feature-buttons {
        gap: 5px;
        margin-top: 10px;
    }

    .feature-btn {
        padding: 4px 8px;
        font-size: 0.85rem;
    }

    .website-info {
        padding: 15px;
        margin-top: 0;
        border-radius: 0;
    }

    .info-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .info-section h2 {
        font-size: 1.2rem;
    }

    .info-section p, .info-section li {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .faq-item {
        padding: 12px;
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    .chat-actions, .feature-buttons {
        flex-wrap: wrap;
    }

    .chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 15px;
        background-color: #f8f9fa;
        border-top: 1px solid #eee;
        z-index: 100;
    }

    #user-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .footer {
        bottom: 70px; /* Adjusted to be above the fixed input */
        right: 10px;
    }

    .icp-info p, .contact-info p {
        font-size: 0.7rem;
    }
}

/* Small Mobile Styles (400px and below) */
@media (max-width: 400px) {
    .chat-header h1 {
        font-size: 1rem;
    }

    .action-btn, .feature-btn {
        padding: 3px 6px;
        font-size: 0.8rem;
    }

    .message {
        max-width: 95%;
        padding: 7px 10px;
        font-size: 0.9rem;
    }

    .info-section h2 {
        font-size: 1.1rem;
    }

    .info-section p, .info-section li {
        font-size: 0.9rem;
    }

    .faq-item h3 {
        font-size: 0.95rem;
    }

    #user-input {
        padding: 8px 12px;
    }
}