/* General Styles */
body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

/* Login Styles */
#login-container {
    background-color: #ff9966;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 2rem auto;
    border: 5px dashed #ff6633;
}

#login-container h1 {
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

#login-form, #signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#login-form input, #signup-form input {
    padding: 12px;
    border: 2px solid #ff6633;
    border-radius: 20px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s;
}

#login-form input:focus, #signup-form input:focus {
    outline: none;
    border-color: #ff4411;
}

#login-form button, #signup-form button {
    background-color: #ff6633;
    color: white;
    border: 2px solid white;
    padding: 12px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#login-form button:hover, #signup-form button:hover {
    background-color: #ff4411;
    transform: scale(1.05);
}

.error {
    color: #ff4411;
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: white;
    font-weight: bold;
    position: relative;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 2px;
    background-color: white;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Chat Styles */
header {
    background-color: #ff9966;
    color: white;
    text-align: center;
    padding: 1rem;
    border-bottom: 5px dashed #ff6633;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

header h1 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-height: 500px;
}

#messages {
    flex: 1;
    overflow-y: auto;
    background-color: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    max-height: 70vh;
    box-sizing: border-box;
}

.message {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    max-width: 80%;
    font-style: normal !important;
    text-rendering: optimizeLegibility;
}

.bot-message {
    background-color: #e3f2fd;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.user-message {
    background-color: #fff9c4;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0;
    text-align: right;
}

#input-container {
    display: flex;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

#user-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #66bbff;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

#send-button {
    background-color: #66bbff;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

#send-button:hover {
    background-color: #5aa3e6;
}

footer {
    background-color: #ff9966;
    color: white;
    text-align: center;
    padding: 1rem;
    border-top: 5px dashed #ff6633;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

.message-container {
    display: flex;
    margin-bottom: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background-color: #66bbff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-avatar {
    background-color: #ff9966;
}

#loading {
    display: none;
    text-align: center;
    margin: 1rem 0;
}

.bot-thinking {
    display: flex;
    padding: 0.5rem 1rem;
    background-color: #e3f2fd;
    border-radius: 1rem;
    border-bottom-left-radius: 0;
    align-self: flex-start;
    margin-right: auto;
    max-width: 80%;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: #66bbff;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.3s;
}

.dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.logout-button {
    background-color: #ff6633;
    color: white;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-left: 1rem;
}

.logout-button:hover {
    background-color: #ff4411;
    transform: scale(1.05);
}

/* Login Footer Styles */
.login-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
}

.privacy-notice {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.privacy-notice .emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.privacy-notice p {
    color: #ff6633;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
    display: inline-block;
    vertical-align: middle;
}

.funky-border {
    height: 4px;
    background: linear-gradient(90deg, 
        #ff6633 0%, 
        #ff9966 25%, 
        #ff6633 50%, 
        #ff9966 75%, 
        #ff6633 100%
    );
    border-radius: 2px;
    animation: borderWave 2s linear infinite;
    background-size: 200% 100%;
}

@keyframes borderWave {
    0% {
        background-position: 0% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Google Sign-in Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background-color: white;
    border: 2px solid #ff6633;
    border-radius: 20px;
    font-size: 16px;
    color: #ff6633;
    cursor: pointer;
    transition: all 0.3s;
}

.google-btn:hover {
    background-color: #fff5f2;
    transform: scale(1.02);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

/* Toggle Button Styles */
.toggle-btn {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    border: 2px solid white;
    border-radius: 20px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-bottom: 1rem;
    font-weight: bold;
}

.toggle-btn:hover {
    background-color: #45a049;
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.toggle-btn.active {
    background-color: #ff6633;
}

.toggle-btn.active:hover {
    background-color: #ff4411;
}

.toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

/* Collapsible Section */
.collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    opacity: 0;
}

.collapsible.expanded {
    max-height: 500px; /* Adjust based on your content */
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

/* Mobile-specific styles to prevent keyboard issues */
@media screen and (max-width: 768px) {
    body {
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    #chat-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    #chat-container header {
        flex-shrink: 0;
        padding: 0.5rem;
    }
    
    #chat-container main {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    #messages {
        flex: 1;
        overflow-y: auto;
        max-height: none;
        min-height: 200px;
    }
    
    #input-container {
        flex-shrink: 0;
        padding: 0.5rem;
        background: white;
        border-top: 1px solid #e0e0e0;
        margin-top: 0;
    }
    
    #user-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    #send-button {
        font-size: 16px;
        padding: 0.75rem 1rem;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"], input[type="email"], input[type="password"] {
        font-size: 16px;
    }
    
    /* Login container adjustments */
    #login-container {
        margin: 1rem auto;
        padding: 1.5rem;
    }
}

/* Prevent zoom on all devices */
input, textarea, select {
    font-size: 16px;
}

/* Ensure proper height on mobile */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Existing styles continue below */

#chat-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Hide chat container when not active */
#chat-container.hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* Ensure login container is always visible when chat is hidden */
#login-container:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 10 !important;
} 