body {
    font-family: 'Roboto', sans-serif;
    background-color: #2d2d2a;
    color: #FFFFFF;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 200vh;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-btn {
    width: 40px;
    height: 40px;
    min-width: 40px; /* Ensure minimum width */
    min-height: 40px; /* Ensure minimum height */
    border-radius: 50%;
    background-color: #7B61FF;
    color: #FFFFFF;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex; /* Use flexbox */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    padding: 0; /* Remove any padding */
    line-height: 1; /* Ensure line height doesn't affect centering */
}

.profile-btn:hover {
    background-color: #6A50E0;
}

/* Profile page styles */
.profile-area {
    background-color: #333331;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#user-info{
    background-color: #4B4C55;
    border-radius: 10px;
    padding: 20px;
}

.paypal-button-container {
    max-width: 300px;
    margin: 0 auto;
}

#user-info h2, #subscription-info h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

#user-info p {
    font-size: 16px;
    margin-bottom: 10px;
}

.subscription-container {
    margin-top: 20px;
}

#subscription-info {
    background-color: #4B4C55;
    border-radius: 10px;
    padding: 20px;
    overflow: hidden; /* Add this to prevent content from protruding */

}

#paypal-button-container {
    margin-top: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    margin: 0;
}

.plan-badge {
    background-color: #4B4C55;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 18px;
    display: inline-block;
}

.chat-area {
    background-color: #333331;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-area.collapsed {
    max-height: 150px; /* Adjust this value as needed */
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.greeting {
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.logo {
    margin-right: 10px;
    font-size: 28px;
}

.message-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: #7B61FF;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto; /* Ensures the message is not cut off */
}

.ai-message {
    align-self: flex-start;
    background-color: #4B4C55;
    color: white;
    border-bottom-left-radius: 4px;
}

.error-message {
    background-color: #FF6B6B;
    color: #FFFFFF;
    text-align: center;
}

.loading-message {
    background-color: #7B61FF;
    color: #FFFFFF;
    text-align: center;
}

.input-area {
    margin-top: 20px;
}

.debug-info {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
}

#debug-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
}

textarea {
    width: 100%;
    height: 50px;
    background-color: #393937;
    border: none;
    border-radius: 15px;
    padding: 10px 15px;
    color: #FFFFFF;
    font-size: 16px;
    resize: none;
    font-family: 'Roboto', sans-serif;
    transition: height 0.3s ease;
    box-sizing: border-box;
}

textarea:focus {
    height: 100px;
    outline: none;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background-color: #7B61FF;
    border: none;
    border-radius: 15px;
    padding: 10px 15px;
    color: #FFFFFF;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.btn:hover {
    background-color: #6A50E0;
}

.send-icon {
    width: 24px;
    height: 24px;
    color: #FFFFFF;
}

.recent-chats {
    margin-top: 20px;
}

.recent-chats h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.chat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.chat-item {
    background-color: #333331;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.chat-item:hover {
    background-color: #4B4C55;
}

.chat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.chat-item h4 {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.chat-item p {
    font-size: 14px;
    color: #A9A9B2;
    margin: 0;
}

.view-all {
    color: #7B61FF;
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: #6A50E0;
}

.delete-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 18px;
    color: #A9A9B2;
    transition: color 0.3s ease;
}

.delete-icon:hover {
    color: #FF6B6B;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #333331;
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content label {
    display: block;
    margin-top: 10px;
}

.modal-content select {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
    background-color: #393937;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
}

.modal-content button {
    margin-top: 20px;
}

.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #7B61FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Styles for signin.html */
.signin-container {
    background-color: #333331;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.signin-form {
    display: flex;
    flex-direction: column;
}

.tab-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.tab.active {
    border-bottom-color: #7B61FF;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#signin-tab h2, #signup-tab h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

#signin-tab input, #signup-tab input, #signup-tab select {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: #454543;
    color: #FFFFFF;
    width: 100%;
    box-sizing: border-box;
}

#signin-tab button, #signup-tab button {
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: #7B61FF;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#signin-tab button:hover, #signup-tab button:hover {
    background-color: #6A50E0;
}

#debug-output {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #454543;
    border-radius: 4px;
    white-space: pre-wrap;
}

.continue-btn {
    background-color: #7B61FF;
    color: #FFFFFF;
    border: none;
    border-radius: 15px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.continue-btn:hover {
    background-color: #6A50E0;
}

.continue-btn:disabled {
    background-color: #9B8DFF;
    cursor: not-allowed;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2d2d2a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.splash-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}

.splash-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #7B61FF;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add this class to hide the splash screen */
.splash-screen-hidden {
    opacity: 0;
    pointer-events: none;
}

.subscription-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.subscription-option {
    flex: 1 1 200px; /* Changed from flex: 1 to flex: 1 1 200px */
    min-width: 200px;
    max-width: 100%; /* Changed from 300px to 100% */
    background-color: #333331;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-sizing: border-box; /* Add this to include padding in the width calculation */

}

.subscription-option h4 {
    margin-bottom: 15px;
}


@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 36px;
    }

    .plan-badge {
        font-size: 14px;
    }

    .greeting {
        font-size: 20px;
    }

    .logo {
        font-size: 24px;
    }

    .chat-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .continue-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .profile-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 14px;
    }

    .profile-area {
        padding: 15px;
    }

    #subscription-info {
        padding: 15px;
    }

    .subscription-container h3 {
        font-size: 18px;
    }

    .subscription-option h4 {
        font-size: 16px;
    }

    #user-info h2, #subscription-info h2 {
        font-size: 20px;
    }

    #user-info p {
        font-size: 14px;
    }

    .paypal-button-container {
        max-width: 100%;
    }

    .subscription-options {
        flex-direction: column;
        align-items: stretch; /* Changed from center to stretch */
    }

    .subscription-option {
        width: 100%;
        max-width: none;
        margin-bottom: 20px; /* Add some space between options when stacked */

    }
}

.paypal-button {
    width: 100% !important;
    max-width: 300px !important;
}

@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

