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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    width: 100%;
    overflow-y: auto; /* Allow vertical scrolling when needed */
    position: relative;
}

/* Stunning scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: scale(1.05);
}


.auth-container {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    padding-top: 40px;
    align-items: flex-start; /* Align content to top to allow scrolling */
    overflow-y: auto; /* Allow scrolling when content overflows */
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0; /* Add some vertical margin */
}

/* Ensure the form container doesn't cause overflow issues */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto; /* Use margin auto for centering */
    flex-shrink: 0; /* Prevent flex shrinking */
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px auto; /* Add vertical margins to prevent overflow */
}



.form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeIn 0.6s ease-out;
}

.form-toggle {
    display: flex;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 1.8rem;
    position: relative;
}

.form-toggle::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 6px);
    height: calc(100% - 12px);
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 0;
}

.form-toggle.login-mode::before {
    transform: translateX(0);
}

.form-toggle.signup-mode::before {
    transform: translateX(100%);
}

.form-toggle button {
    flex: 1;
    padding: 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    color: #666;
}

.form-toggle button.active {
    color: white;
}

.form-toggle button:first-child:not(.active) {
    color: #333;
}

.form-toggle button:last-child:not(.active) {
    color: #333;
}

.input-group {
    margin-bottom: 1.2rem; /* Reduced from 1.4rem */
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem; /* Reduced from 0.6rem */
    font-weight: 500;
    color: #444;
    font-size: 0.9rem; /* Slightly smaller font */
}

.input-group input {
    width: 100%;
    padding: 12px 14px; /* Reduced from 14px 16px */
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem; /* Slightly smaller font */
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.input-group input::placeholder {
    color: #aaa;
}

/* Password input with toggle */
.password-input-container {
    position: relative;
    width: 100%;
}

.password-input-container input {
    padding-right: 40px; /* Make space for the eye icon */
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #667eea;
}

/* Password strength indicator for eye icons */
.password-toggle.weak-password {
    color: #ff6b6b; /* Red for weak password */
}

.password-toggle.moderate-password {
    color: #f5a623; /* Yellow for moderate password */
}

.password-toggle.strong-password {
    color: #28a745; /* Green for strong password */
}

.btn {
    padding: 12px 18px; /* Reduced padding to save space */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem; /* Slightly smaller font */
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.small-btn {
    width: auto !important; /* Override the 100% width for small buttons */
    display: inline-block;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.5);
}

.btn.primary:active {
    transform: translateY(0);
}

.chat-container {
    height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #e6e9f0 100%);
    position: relative;
    overflow: hidden;
    display: flex;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar styles */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.sidebar.hidden {
    width: 0;
    overflow: hidden;
    border-right: none;
}


.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.toggle-sidebar-btn {
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-sidebar-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.copyright-text {
    margin: 0;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.contact-support-container {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #eee;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-support-btn {
    background: linear-gradient(135deg, #339af0, #4dabf7);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(51, 154, 240, 0.3);
    width: 100%;
    font-size: 1rem;
}

.contact-support-btn:hover {
    background: linear-gradient(135deg, #228be6, #339af0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 154, 240, 0.4);
}

.contact-support-btn:active {
    transform: translateY(0);
}

.newsletter-btn {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
    width: 100%;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.newsletter-btn:hover {
    background: linear-gradient(135deg, #40c057, #37b24d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.4);
}

.newsletter-btn:active {
    transform: translateY(0);
}

.github-btn {
    background: linear-gradient(135deg, #333333, #6e6e6e);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(51, 51, 51, 0.3);
    width: 100%;
    font-size: 1rem;
    text-decoration: none;
}

.github-btn:hover {
    background: linear-gradient(135deg, #4a4a4a, #7d7d7d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 51, 51, 0.4);
}

.github-btn:active {
    transform: translateY(0);
}

/* Style the link wrapper to not affect the button styling */
.github-link {
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
}

/* Support Button for Auth Page */
.contact-support-btn-auth {
    background: linear-gradient(135deg, #339af0, #4dabf7);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(51, 154, 240, 0.4);
    font-size: 0.9rem;
    position: absolute;
    top: 1rem;
    left: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.contact-support-btn-auth:hover {
    background: linear-gradient(135deg, #228be6, #339af0);
    box-shadow: 0 6px 20px rgba(51, 154, 240, 0.5);
    width: 150px; /* Extended width to accommodate text */
}

.contact-support-btn-auth i {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.contact-support-btn-auth::after {
    content: "Contact Support";
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    z-index: 1;
    padding: 6px 10px;
    background: transparent;
    border-radius: 12px;
    transition: 
        opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s,
        transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s;
    letter-spacing: 0.2px;
}

.contact-support-btn-auth:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar.hidden {
    width: 0;
    overflow: hidden;
    border-right: none;
}



.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.toggle-sidebar-btn {
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-sidebar-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    margin-top: auto;
}

.copyright-text {
    margin: 0;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.new-chat-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.chat-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-history-item {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history-item:hover {
    background: #e9ecef;
}

.chat-history-item.active {
    background: #e6f0ff;
    border-left: 3px solid #667eea;
}

.chat-history-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    color: #333;
}

.chat-history-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-history-item:hover .chat-history-actions {
    opacity: 1;
}

.chat-history-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.chat-history-delete:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* Main chat area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0; /* Allows flex item to shrink below content size */
    overflow: hidden;
    transition: all 0.3s ease;
}

/* When sidebar is hidden, adjust the show sidebar button position */
.main-chat.hidden-sidebar {
    position: relative;
}

.show-sidebar-btn {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    left: 15px;
    top: 20px;
    z-index: 100;
    transition: all 0.3s ease;
    display: none; /* Initially hidden, shown when sidebar is collapsed */
}

.show-sidebar-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

.hidden-sidebar .header-content {
    margin-left: 40px; /* Make space for the show-sidebar-btn */
}

.hidden-sidebar .show-sidebar-btn {
    display: flex;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.chat-area {
    position: relative;
    z-index: 1;
}

.chat-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.2rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    z-index: 10;
    backdrop-filter: blur(10px);
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

.show-sidebar-btn {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.3s ease;
    display: none; /* Initially hidden, shown when sidebar is collapsed */
}

.show-sidebar-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.hidden-sidebar .show-sidebar-btn {
    display: flex;
}

.chat-header h1 {
    color: #667eea;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.chat-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

#username-display {
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn.logout {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn.logout:hover {
    background: linear-gradient(135deg, #ff5252, #e53e3e);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem 0;
}

.message {
    max-width: 75%;
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    font-size: 1.05rem;
    line-height: 1.5;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 5px;
    position: relative;
}

.message.user::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-bottom-right-radius: 20px;
    z-index: -1;
    filter: blur(5px);
    opacity: 0.3;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 5px;
    position: relative;
}

.message.bot::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 20px;
    z-index: -1;
    filter: blur(5px);
    opacity: 0.3;
}

.welcome-message {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    padding: 2rem;
    animation: fadeIn 1s ease-out;
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message p {
    font-size: 1.2rem;
    color: #888;
    max-width: 500px;
    line-height: 1.6;
}

.input-container {
    display: flex;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
      0 8px 32px 0 rgba(31, 38, 135, 0.2),
      inset 0 4px 10px rgba(255, 255, 255, 0.3);
    align-items: flex-end;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

[data-theme="dark"] .input-container {
    background: rgba(25, 25, 35, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
      0 8px 32px 0 rgba(0, 0, 0, 0.3),
      inset 0 4px 10px rgba(255, 255, 255, 0.1);
}

#message-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    max-height: 150px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(248, 249, 250, 0.8);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#message-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.05);
    background: white;
    overflow: hidden;
}

.btn.send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn.send::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.btn.send:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn.send:hover::before {
    left: 100%;
}

.typing-indicator {
    display: none;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 30px;
    align-self: flex-start;
    margin-bottom: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite ease-in-out;
}

.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(-8px); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    max-width: 350px;
    word-wrap: break-word;
    border-left: 5px solid;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: rgba(76, 175, 80, 0.95);
    border-left-color: #4CAF50;
}

.notification.error {
    background: rgba(244, 67, 54, 0.95);
    border-left-color: #f44336;
}

.notification.info {
    background: rgba(33, 150, 243, 0.95);
    border-left-color: #2196F3;
}

.notification-content {
    flex: 1;
    margin-right: 10px;
}

.notification-action-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    margin-left: 10px !important;
    cursor: pointer !important;
    font-size: 0.85em !important;
    transition: all 0.3s ease !important;
    border: none !important;
    outline: none !important;
}

.notification-action-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

.verification-container {
    text-align: center;
    padding: 1.2rem; /* Reduced from 2rem to prevent scrollbar */
    animation: fadeIn 0.6s ease-out;
}

.verification-icon {
    margin-bottom: 1rem; /* Reduced from 1.5rem to save space */
}

.verification-container h2 {
    color: #333;
    margin-bottom: 0.8rem; /* Reduced from 1rem to save space */
    font-size: 1.6rem; /* Reduced font size to save space */
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.verification-container p {
    color: #666;
    margin-bottom: 1rem; /* Reduced from 1.5rem to save space */
    line-height: 1.5; /* Reduced from 1.6 to save space */
    font-size: 1rem; /* Reduced from 1.1rem to save space */
}

.verification-actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem; /* Reduced from 1rem to save space */
    margin-top: 1rem; /* Reduced from 2rem to save space */
}

.btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.btn.secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Tablet and smaller desktop screens */
@media (max-width: 1024px) {
    .form-container {
        margin: 1.5rem;
        padding: 2rem;
        max-width: 90%;
        width: 90%;
    }
    
    .chat-header h1 {
        font-size: 1.7rem;
    }
    
    .message {
        max-width: 80%;
        padding: 0.9rem 1.2rem;
        font-size: 1rem;
    }
    
    .chat-area {
        padding: 1.5rem;
    }
    
    .input-container {
        padding: 1.2rem;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #message-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn.send {
        width: 100%;
        height: 45px;
        margin-left: 0;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        overflow: auto;
    }
    
    .auth-container {
        align-items: flex-start;
        padding-top: 2rem;
        min-height: 100vh;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
        max-width: 95%;
        width: 95%;
        min-width: 300px;
    }
    
    .form-toggle {
        padding: 4px;
        margin-bottom: 1.2rem;
    }
    
    .form-toggle button {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .input-group input {
        padding: 12px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .chat-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .chat-header {
        padding: 0.8rem 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .chat-header h1 {
        font-size: 1.4rem;
        margin: 0;
    }
    
    .user-info {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        flex-shrink: 0;
    }
    
    #username-display {
        font-size: 0.95rem;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .btn.logout {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .chat-area {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .messages-container {
        flex: 1;
        padding: 0.5rem 0;
    }
    
    .message {
        max-width: 85%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .message.user {
        align-self: flex-end;
    }
    
    .message.bot {
        align-self: flex-start;
    }
    
    .welcome-message {
        padding: 1rem;
    }
    
    .welcome-message h2 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .welcome-message p {
        font-size: 1rem;
    }
    
    .input-container {
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95);
    }
    
    #message-input {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        min-height: 40px;
        max-height: 100px;
    }
    
    .btn.send {
        width: 45px;
        height: 45px;
        margin-left: 0.8rem;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: calc(100% - 20px);
        z-index: 1001;
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    
    .verification-container {
        padding: 1.2rem;
    }
    
    .verification-container h2 {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }
    
    .verification-container p {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }
    
    #verification-email-display {
        font-size: 1.1rem;
        margin: 1rem 0;
    }
    
    .verification-actions {
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 1.5rem;
    }
    
    .verification-actions .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    .typing-indicator {
        padding: 0.8rem 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .auth-container {
        padding-top: 1rem;
    }
    
    .form-container {
        margin: 0.8rem;
        padding: 1.2rem;
        min-width: 280px;
    }
    
    .form-toggle {
        margin-bottom: 1rem;
    }
    
    .input-group {
        margin-bottom: 0.8rem;
    }
    
    .input-group input {
        padding: 10px;
    }
    
    .btn {
        padding: 11px 16px;
    }
    
    .chat-header {
        padding: 0.7rem;
    }
    
    .chat-header h1 {
        font-size: 1.3rem;
    }
    
    .message {
        max-width: 90%;
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
    }
    
    .welcome-message h2 {
        font-size: 1.3rem;
    }
    
    .welcome-message p {
        font-size: 0.95rem;
    }
    
    .input-container {
        padding: 0.8rem;
    }
    
    #message-input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .btn.send {
        width: 40px;
        height: 40px;
        margin-left: 0.6rem;
    }
    
    .notification {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
    
    .verification-container {
        padding: 1rem;
    }
    
    .verification-container h2 {
        font-size: 1.2rem;
    }
    
    .verification-container p {
        font-size: 0.95rem;
    }
    
    #verification-email-display {
        font-size: 1rem;
    }
    
    .verification-actions {
        margin-top: 1rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .form-container {
        max-width: 420px;
        padding: 2.8rem;
    }
    
    .chat-header h1 {
        font-size: 2.2rem;
    }
    
    .message {
        max-width: 70%;
        padding: 1.3rem 1.7rem;
        font-size: 1.1rem;
    }
    
    .welcome-message h2 {
        font-size: 2.2rem;
    }
    
    .welcome-message p {
        font-size: 1.25rem;
    }
    
    #message-input {
        font-size: 1.05rem;
    }
    
    .header-content {
        gap: 2rem;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .auth-container {
        padding-top: 0.5rem;
    }
    
    .form-container {
        margin: 0.5rem;
        padding: 1rem;
        min-width: 260px;
    }
    
    .form-toggle button {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .input-group input {
        padding: 9px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .chat-header {
        padding: 0.6rem;
    }
    
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .message {
        max-width: 95%;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .welcome-message h2 {
        font-size: 1.2rem;
    }
    
    .welcome-message p {
        font-size: 0.9rem;
    }
    
    .input-container {
        padding: 0.6rem;
    }
    
    #message-input {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .btn.send {
        width: 35px;
        height: 35px;
    }
    
    #username-display {
        font-size: 0.9rem;
        max-width: 80px;
    }
    
    .btn.logout {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .verification-container h2 {
        font-size: 1.1rem;
    }
    
    .verification-container p {
        font-size: 0.9rem;
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-area {
        padding: 0.8rem;
    }
    
    .input-container {
        padding: 0.8rem;
    }
    
    .message {
        max-width: 75%;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Accessibility improvements for small text */
@media screen and (max-width: 480px) {
    body {
        font-size: 16px; /* Prevents automatic zoom on some mobile devices */
    }
    
    input, button, textarea {
        font-size: 16px; /* Ensures proper accessibility */
    }
}

/* Profile Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.profile-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.profile-content {
    padding: 2rem 1.5rem;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #667eea;
    position: relative;
}

.user-avatar-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details {
    text-align: left;
    margin-top: 1rem;
}

.profile-field {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.profile-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.profile-field label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.profile-field label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.profile-field span {
    display: block;
    font-size: 1.1rem;
    color: #333;
    padding: 0.3rem 0;
    word-break: break-all;
}

.profile-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.profile-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens */
@media (max-width: 768px) {
    .profile-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .profile-header {
        padding: 1.2rem;
    }
    
    .profile-header h2 {
        font-size: 1.3rem;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 3rem;
        margin: 0 auto 1.2rem;
    }
    
    .profile-field label {
        font-size: 0.9rem;
    }
    
    .profile-field span {
        font-size: 1rem;
    }
    
    .profile-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .profile-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .profile-header {
        padding: 1rem;
    }
    
    .profile-header h2 {
        font-size: 1.2rem;
    }
    
    .profile-content {
        padding: 1rem;
    }
    
    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
        margin: 0 auto 1rem;
    }
    
    .profile-field {
        margin-bottom: 1.2rem;
    }
    
    .profile-field label {
        font-size: 0.85rem;
    }
    
    .profile-field span {
        font-size: 0.95rem;
    }
    
    .profile-actions {
        padding: 1rem 0.8rem;
    }
}

/* Password Change Modal */
.password-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.password-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.password-content {
    padding: 2rem 1.5rem;
}

.password-content .input-group {
    margin-bottom: 1.5rem;
}

.password-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.password-content .input-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.password-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.password-content .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.password-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.password-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for password modal */
@media (max-width: 768px) {
    .password-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .password-header {
        padding: 1.2rem;
    }
    
    .password-header h2 {
        font-size: 1.3rem;
    }
    
    .password-content {
        padding: 1.5rem;
    }
    
    .password-content .input-group {
        margin-bottom: 1.2rem;
    }
    
    .password-content .input-group label {
        font-size: 0.9rem;
    }
    
    .password-content .input-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .password-actions {
        flex-direction: column;
    }
    
    .password-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for password modal */
@media (max-width: 480px) {
    .password-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .password-header {
        padding: 1rem;
    }
    
    .password-header h2 {
        font-size: 1.2rem;
    }
    
    .password-content {
        padding: 1rem;
    }
    
    .password-content .input-group {
        margin-bottom: 1rem;
    }
    
    .password-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .password-content .input-group input {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .password-actions {
        padding: 0.8rem 0;
    }
}

/* Edit Profile Modal */
.profile-avatar-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-avatar-container p {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.profile-avatar-edit {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-avatar-edit:hover {
    transform: scale(1.05);
}

.profile-avatar-edit i {
    font-size: 5rem;
    color: #667eea;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-avatar-edit:hover .avatar-overlay {
    opacity: 1;
}

.profile-content .input-group {
    margin-bottom: 1.5rem;
}

.profile-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.profile-content .input-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.profile-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.profile-content .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.profile-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.profile-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for edit profile modal */
@media (max-width: 768px) {
    .profile-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .profile-header {
        padding: 1.2rem;
    }
    
    .profile-header h2 {
        font-size: 1.3rem;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
    
    .profile-avatar-edit {
        width: 100px;
        height: 100px;
    }
    
    .profile-avatar-edit i {
        font-size: 4rem;
    }
    
    .profile-details {
        margin-top: 1rem;
    }
    
    .profile-content .input-group {
        margin-bottom: 1.2rem;
    }
    
    .profile-content .input-group label {
        font-size: 0.9rem;
    }
    
    .profile-content .input-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .profile-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for edit profile modal */
@media (max-width: 480px) {
    .profile-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .profile-header {
        padding: 1rem;
    }
    
    .profile-header h2 {
        font-size: 1.2rem;
    }
    
    .profile-content {
        padding: 1rem;
    }
    
    .profile-avatar-edit {
        width: 90px;
        height: 90px;
    }
    
    .profile-avatar-edit i {
        font-size: 3.5rem;
    }
    
    .profile-content .input-group {
        margin-bottom: 1rem;
    }
    
    .profile-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .profile-content .input-group input {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .profile-actions {
        padding: 0.8rem 0;
    }
}

/* Delete Account Confirmation Modal */
.delete-account-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.delete-account-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-account-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.delete-account-content {
    padding: 1.5rem;
    text-align: center;
}

.warning-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border: 1px solid #ffdddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.warning-message i {
    font-size: 2.5rem;
    color: #ff6b6b;
}

.warning-message p {
    margin: 0;
    color: #d32f2f;
    font-size: 1.05rem;
    line-height: 1.5;
}

.delete-account-content .input-group {
    margin: 1.5rem 0;
}

.delete-account-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.delete-account-content .input-group label i {
    margin-right: 0.5rem;
    color: #ff6b6b;
}

.delete-account-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.delete-account-content .input-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
    background: white;
}

.delete-account-warning {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 8px;
    padding: 0.8rem;
    margin-top: 1rem;
}

.delete-account-warning p {
    margin: 0;
    color: #ff8f00;
    font-size: 0.9rem;
    line-height: 1.4;
}

.delete-account-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.delete-account-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

.btn.danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.btn.danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.5);
}

/* Tablet and smaller screens for delete account modal */
@media (max-width: 768px) {
    .delete-account-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .delete-account-header {
        padding: 1.2rem;
    }
    
    .delete-account-header h2 {
        font-size: 1.3rem;
    }
    
    .delete-account-content {
        padding: 1.5rem;
    }
    
    .warning-message {
        padding: 0.8rem;
    }
    
    .warning-message i {
        font-size: 2rem;
    }
    
    .warning-message p {
        font-size: 1rem;
    }
    
    .delete-account-content .input-group {
        margin: 1.2rem 0;
    }
    
    .delete-account-content .input-group label {
        font-size: 0.9rem;
    }
    
    .delete-account-content .input-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .delete-account-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .delete-account-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for delete account modal */
@media (max-width: 480px) {
    .delete-account-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .delete-account-header {
        padding: 1rem;
    }
    
    .delete-account-header h2 {
        font-size: 1.2rem;
    }
    
    .delete-account-content {
        padding: 1rem;
    }
    
    .warning-message {
        padding: 0.6rem;
    }
    
    .warning-message i {
        font-size: 1.8rem;
    }
    
    .warning-message p {
        font-size: 0.95rem;
    }
    
    .delete-account-content .input-group {
        margin: 1rem 0;
    }
    
    .delete-account-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .delete-account-content .input-group input {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .delete-account-actions {
        padding: 0.8rem 0;
    }
}

/* Delete Chat Confirmation Modal */
.delete-chat-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.delete-chat-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.delete-chat-content {
    padding: 1.5rem;
    text-align: center;
}

.delete-chat-content .warning-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border: 1px solid #ffdddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.delete-chat-content .warning-message i {
    font-size: 2.5rem;
    color: #ff6b6b;
}

.delete-chat-content .warning-message p {
    margin: 0;
    color: #d32f2f;
    font-size: 1.05rem;
    line-height: 1.5;
}

.delete-chat-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.delete-chat-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for delete chat modal */
@media (max-width: 768px) {
    .delete-chat-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .delete-chat-header {
        padding: 1.2rem;
    }
    
    .delete-chat-header h2 {
        font-size: 1.3rem;
    }
    
    .delete-chat-content {
        padding: 1.5rem;
    }
    
    .delete-chat-content .warning-message {
        padding: 0.8rem;
    }
    
    .delete-chat-content .warning-message i {
        font-size: 2rem;
    }
    
    .delete-chat-content .warning-message p {
        font-size: 1rem;
    }
    
    .delete-chat-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .delete-chat-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for delete chat modal */
@media (max-width: 480px) {
    .delete-chat-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .delete-chat-header {
        padding: 1rem;
    }
    
    .delete-chat-header h2 {
        font-size: 1.2rem;
    }
    
    .delete-chat-content {
        padding: 1rem;
    }
    
    .delete-chat-content .warning-message {
        padding: 0.6rem;
    }
    
    .delete-chat-content .warning-message i {
        font-size: 1.8rem;
    }
    
    .delete-chat-content .warning-message p {
        font-size: 0.95rem;
    }
    
    .delete-chat-actions {
        padding: 0.8rem 0;
    }
}

/* User avatar image styling */
.user-avatar-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Logo styling for welcome screen */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.welcome-logo {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover; /* This will crop the image to fit */
    border-radius: 50%; /* This makes it round */
    /* Removed the border so it blends with the surrounding */
    /* Removed box-shadow for a more integrated look */
}

/* Responsive adjustments for welcome logo */
@media (max-width: 768px) {
    .logo-container {
        margin-bottom: 1rem;
    }
    
    .welcome-logo {
        max-width: 120px;
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .welcome-logo {
        max-width: 100px;
        max-height: 100px;
    }
}

/* Logout Confirmation Modal */
.logout-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.logout-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.logout-content {
    padding: 1.5rem;
    text-align: center;
}

.logout-content .warning-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.logout-content .warning-message i {
    font-size: 2.5rem;
    color: #667eea;
}

.logout-content .warning-message p {
    margin: 0;
    color: #333;
    font-size: 1.05rem;
    line-height: 1.5;
}

.logout-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.logout-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for logout modal */
@media (max-width: 768px) {
    .logout-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .logout-header {
        padding: 1.2rem;
    }
    
    .logout-header h2 {
        font-size: 1.3rem;
    }
    
    .logout-content {
        padding: 1.5rem;
    }
    
    .logout-content .warning-message {
        padding: 0.8rem;
    }
    
    .logout-content .warning-message i {
        font-size: 2rem;
    }
    
    .logout-content .warning-message p {
        font-size: 1rem;
    }
    
    .logout-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .logout-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for logout modal */
@media (max-width: 480px) {
    .logout-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .logout-header {
        padding: 1rem;
    }
    
    .logout-header h2 {
        font-size: 1.2rem;
    }
    
    .logout-content {
        padding: 1rem;
    }
    
    .logout-content .warning-message {
        padding: 0.6rem;
    }
    
    .logout-content .warning-message i {
        font-size: 1.8rem;
    }
    
    .logout-content .warning-message p {
        font-size: 0.95rem;
    }
    
    .logout-actions {
        padding: 0.8rem 0;
    }
}

/* Reveal Email Modal */
.reveal-email-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.reveal-email-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reveal-email-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.reveal-email-content {
    padding: 1.5rem;
}

.reveal-email-content .input-group {
    margin-bottom: 1.2rem;
}

.reveal-email-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.reveal-email-content .input-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.reveal-email-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.reveal-email-content .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.reveal-email-info {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.reveal-email-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.reveal-email-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.reveal-email-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for reveal email modal */
@media (max-width: 768px) {
    .reveal-email-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .reveal-email-header {
        padding: 1.2rem;
    }
    
    .reveal-email-header h2 {
        font-size: 1.3rem;
    }
    
    .reveal-email-content {
        padding: 1.5rem;
    }
    
    .reveal-email-content .input-group {
        margin-bottom: 1rem;
    }
    
    .reveal-email-content .input-group label {
        font-size: 0.9rem;
    }
    
    .reveal-email-content .input-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .reveal-email-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .reveal-email-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for reveal email modal */
@media (max-width: 480px) {
    .reveal-email-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .reveal-email-header {
        padding: 1rem;
    }
    
    .reveal-email-header h2 {
        font-size: 1.2rem;
    }
    
    .reveal-email-content {
        padding: 1rem;
    }
    
    .reveal-email-content .input-group {
        margin-bottom: 1rem;
    }
    
    .reveal-email-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .reveal-email-content .input-group input {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .reveal-email-actions {
        padding: 0.8rem 0;
    }
}

/* Auth screen app header */
.app-header {
    text-align: center;
    margin-bottom: 1rem; /* Reduced margin to save space */
    padding: 0 0.5rem; /* Reduced horizontal padding */
}

.auth-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.auth-logo {
    max-width: 55px;
    max-height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

.app-name {
    font-size: 1.6rem; /* Reduced font size */
    font-weight: 700;
    color: #667eea;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive adjustments for auth screen logo */
@media (max-width: 768px) {
    .app-header {
        margin-bottom: 0.8rem;
        padding: 0 0.5rem;
    }
    
    .app-name {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        max-width: 50px;
        max-height: 50px;
    }
}

@media (max-width: 480px) {
    .app-header {
        margin-bottom: 0.7rem;
        padding: 0 0.3rem;
    }
    
    .app-name {
        font-size: 1.4rem;
    }
    
    .auth-logo {
        max-width: 45px;
        max-height: 45px;
    }
    
    .form-container {
        padding: 1.5rem; /* Reduced padding in form container */
    }
    
    /* Specific adjustments for signup form on small screens */
    .form-content .input-group {
        margin-bottom: 0.8rem; /* Reduce margin between input groups */
    }
    
    .form-content .input-group input {
        padding: 9px; /* Reduce padding in inputs */
    }
}

/* Additional signup form adjustments */
#signup-form .input-group {
    margin-bottom: 0.8rem; /* Reduced spacing */
}

.form-content {
    padding-top: 0.5rem; /* Reduce top padding to save space */
}

.form-toggle {
    margin-bottom: 1rem; /* Reduced from default to save space */
}

/* Contact Support Modal */
.contact-support-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.contact-support-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-support-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.contact-support-content {
    padding: 1.5rem;
}

.contact-support-content .input-group {
    margin-bottom: 1.2rem;
}

.contact-support-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.contact-support-content .input-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.contact-support-content .input-group input,
.contact-support-content .input-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
    font-family: 'Poppins', sans-serif;
}

.contact-support-content .input-group input:focus,
.contact-support-content .input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.contact-support-content .input-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    display: block;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    margin-left: 0.5rem;
    display: none; /* Hidden by default */
}

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

.contact-support-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.contact-support-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for contact support modal */
@media (max-width: 768px) {
    .contact-support-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .contact-support-header {
        padding: 1.2rem;
    }
    
    .contact-support-header h2 {
        font-size: 1.3rem;
    }
    
    .contact-support-content {
        padding: 1.5rem;
    }
    
    .contact-support-content .input-group {
        margin-bottom: 1rem;
    }
    
    .contact-support-content .input-group label {
        font-size: 0.9rem;
    }
    
    .contact-support-content .input-group input,
    .contact-support-content .input-group textarea {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .contact-support-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .contact-support-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for contact support modal */
@media (max-width: 480px) {
    .contact-support-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .contact-support-header {
        padding: 1rem;
    }
    
    .contact-support-header h2 {
        font-size: 1.2rem;
    }
    
    .contact-support-content {
        padding: 1rem;
    }
    
    .contact-support-content .input-group {
        margin-bottom: 1rem;
    }
    
    .contact-support-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .contact-support-content .input-group input,
    .contact-support-content .input-group textarea {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .contact-support-actions {
        padding: 0.8rem 0;
    }
}

/* Overall form container adjustment */
.form-container {
    max-width: 400px; /* Slightly narrower for better focus */
    padding: 1.5rem 1.5rem; /* Reduced padding to prevent scrollbar */
}

/* Adjustments for auth form titles */
#login-form h2, #signup-form h2 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #333;
}

/* Required field indicators for password containers - use CSS positioning */
.password-input-container.required .required-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
    height: auto;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Ensure password input container has proper dimensions for indicator centering */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;  /* This centers contents vertically */
}

/* For input group required indicators, JavaScript will handle precise positioning */
.input-group.required .required-indicator {
    position: absolute;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
    height: auto;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Ensure proper positioning context */
.input-group,
.password-input-container {
    position: relative;
}

/* Make sure inputs have consistent height for proper indicator centering */
.input-group input,
.password-input-container input {
    height: calc(2.5em + 8px); /* Standard height to ensure consistent centering */
}

.input-group.required input,
.input-group.required .password-input-container input {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3) !important;
}



@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}



/* Theme Toggle Button - Perfectly round with glass effect */
#theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1rem;
    z-index: 1000;
    margin: 0;
    padding: 0;
    box-shadow: 
      0 8px 32px 0 rgba(31, 38, 135, 0.2),
      inset 0 4px 10px rgba(255, 255, 255, 0.2);
    outline: 1px solid rgba(255, 255, 255, 0.18);
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 
      0 8px 32px 0 rgba(31, 38, 135, 0.25),
      inset 0 4px 15px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e0e0e0;
    box-shadow: 
      0 8px 32px 0 rgba(0, 0, 0, 0.3),
      inset 0 4px 10px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
      0 8px 32px 0 rgba(0, 0, 0, 0.4),
      inset 0 4px 15px rgba(255, 255, 255, 0.15);
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 
      0 8px 32px 0 rgba(31, 38, 135, 0.25),
      inset 0 4px 15px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e0e0e0;
    box-shadow: 
      0 8px 32px 0 rgba(0, 0, 0, 0.3),
      inset 0 4px 10px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
      0 8px 32px 0 rgba(0, 0, 0, 0.4),
      inset 0 4px 15px rgba(255, 255, 255, 0.15);
}

/* Theme Toggle Button in Chat User Info */
.user-info #theme-toggle {
    position: static;
    margin-right: 1rem;
    top: auto;
    right: auto;
}

/* Theme Variables */
:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: linear-gradient(135deg, #f0f4f8 0%, #e6e9f0 100%);
    --bg-container: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-input: #f9f9f9;
    --bg-input-focus: white;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #888;
    --border-color: #e0e0e0;
    --border-light: rgba(0, 0, 0, 0.05);
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
    --danger: #ff6b6b;
    --success: #4CAF50;
    --info: #2196F3;
}

/* Dark theme variables */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    --bg-secondary: linear-gradient(135deg, #0f2027 0%, #1a2a3a 100%);
    --bg-container: rgba(25, 25, 35, 0.95);
    --bg-sidebar: rgba(25, 25, 35, 0.95);
    --bg-input: rgba(45, 45, 60, 0.8);
    --bg-input-focus: rgba(55, 55, 70, 0.9);
    --text-primary: #f0f0f0;
    --text-secondary: #c0c0c0;
    --text-light: #a0a0a0;
    --border-color: #4a4d6a;
    --border-light: rgba(255, 255, 255, 0.08);
    --accent-primary: #6a8eff;
    --accent-secondary: #7d9cff;
    --accent-gradient: linear-gradient(135deg, #6a8eff, #7d9cff, #8a9bff);
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.5);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.6);
    --danger: #ff6b6b;
    --success: #50fa7b;
    --info: #79d3ff;
}

/* Apply smooth transitions */
* {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}
  
/* Apply theme to main elements */
body {
    background: var(--bg-primary);
}
  
.auth-container {
    background: rgba(255, 255, 255, 0.05);
}
  
.form-container {
    background: var(--bg-container);
}
  
.chat-container {
    background: var(--bg-secondary);
}
  
.sidebar {
    background: var(--bg-sidebar);
}
  
.chat-header {
    background: var(--bg-container);
}

/* Password Reset Modal Styles */
.password-reset-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.password-reset-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-reset-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.password-reset-content {
    padding: 1.5rem;
}

.password-reset-content .input-group {
    margin-bottom: 1.2rem;
}

.password-reset-content .input-group label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.password-reset-content .input-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.password-reset-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.password-reset-content .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

.password-reset-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.password-reset-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Tablet and smaller screens for password reset modal */
@media (max-width: 768px) {
    .password-reset-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .password-reset-header {
        padding: 1.2rem;
    }
    
    .password-reset-header h2 {
        font-size: 1.3rem;
    }
    
    .password-reset-content {
        padding: 1.5rem;
    }
    
    .password-reset-content .input-group {
        margin-bottom: 1.2rem;
    }
    
    .password-reset-content .input-group label {
        font-size: 0.9rem;
    }
    
    .password-reset-content .input-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .password-reset-actions {
        flex-direction: column;
    }
    
    .password-reset-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Small mobile devices for password reset modal */
@media (max-width: 480px) {
    .password-reset-modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .password-reset-header {
        padding: 1rem;
    }
    
    .password-reset-header h2 {
        font-size: 1.2rem;
    }
    
    .password-reset-content {
        padding: 1rem;
    }
    
    .password-reset-content .input-group {
        margin-bottom: 1rem;
    }
    
    .password-reset-content .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .password-reset-content .input-group input {
        padding: 9px 11px;
        font-size: 0.95rem;
    }
    
    .password-reset-actions {
        padding: 0.8rem 0;
    }
}

/* Password Reset UI specific styles */
#password-reset-ui .form-container {
    padding: 2rem 1.8rem;
}

#password-reset-ui .input-group {
    margin-bottom: 1.2rem;
}

#password-reset-ui .input-group input {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

#password-reset-ui .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

#password-reset-ui .btn.primary {
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#password-reset-ui .btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.5);
}

#password-reset-ui a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

#password-reset-ui a:hover {
    text-decoration: underline;
}

/* Custom Scrollbar for Sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 8px 0;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: scale(1.1);
    border-radius: 4px;
}

/* Dark theme scrollbar */
[data-theme="dark"] .sidebar-content::-webkit-scrollbar-track {
    background: rgba(25, 25, 35, 0.3);
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6a8eff, #7d9cff);
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7d9cff, #6a8eff);
}

/* Forgot Password link styling */
.forgot-password-link {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* Checkbox styling for terms agreement */
.checkbox-group {
    margin-top: 0.5rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
}

.checkbox-label {
    display: block;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    user-select: none;
    line-height: 1.4;
    margin-top: 3px; /* Align with the text */
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #667eea;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #f8f9ff;
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(102, 126, 234, 0.3);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.checkmark:after {
    content: "✓";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    font-size: 10px;
    color: white;
    font-weight: bold;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
    animation: checkmarkAppear 0.2s ease-out forwards;
}

@keyframes checkmarkAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.agreement-text {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin-left: 8px;
    flex-grow: 1;
}

.agreement-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.agreement-text a:hover {
    text-decoration: underline;
}

/* Terms and Privacy Policy Modal */
.policy-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: modalSlideIn 0.4s forwards;
    margin: auto; /* Center the modal vertically */
}

@keyframes modalSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.policy-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.policy-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.policy-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 50vh;
    flex-grow: 1;
}

.policy-content h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.policy-content h4 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.policy-content p, .policy-content li {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.policy-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.policy-content li {
    margin-bottom: 0.5rem;
}

.policy-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    background-color: #f9f9f9;
}

.policy-actions .btn {
    width: auto;
    padding: 10px 20px;
    margin-left: 10px;
}

/* Ensure form fits on all screen sizes */
@media (max-height: 700px) {
    .form-container {
        margin-top: 10px;
        margin-bottom: 10px;
    }
}

/* Ensure input groups don't cause overflow */
.input-group {
    width: 100%;
    box-sizing: border-box;
}

/* Scrollbar styling for form content when needed */
.form-content::-webkit-scrollbar {
    width: 6px;
}

.form-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.form-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.form-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}