.chat-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    max-height: 800px;
    min-height: 500px;
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(10px);
    width: calc(100% - 4rem);
    box-sizing: border-box;
}

.user-status {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    display: none;
}

.user-status.logged-in {
    background: rgba(34, 197, 94, 0.2);
    color: #10b981;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

.user-status.anonymous {
    background: rgba(255, 165, 0, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(255, 165, 0, 0.3);
    display: block;
}

.chat-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.login-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.logout-btn, .clear-history-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.4);
}

.clear-history-btn {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.clear-history-btn:hover {
    background: rgba(156, 163, 175, 0.3);
    border-color: rgba(156, 163, 175, 0.4);
}

.show-login-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(79, 70, 229, 0.2);
    color: #6366f1;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.show-login-btn:hover {
    background: rgba(79, 70, 229, 0.3);
    border-color: rgba(79, 70, 229, 0.4);
}

.login-section {
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.quick-login-form h3 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.login-form-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.login-form-row input {
    flex: 1;
    min-width: 180px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

.login-form-row input:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

.login-form-row input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quick-login-btn, .quick-register-btn, .cancel-login-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-login-btn {
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.9) 100%);
    color: #333;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

.quick-login-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 255, 255, 0.3);
}

.quick-register-btn {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.quick-register-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.cancel-login-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.cancel-login-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.login-message {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.login-message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #10b981;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

.login-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

.chat-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h2 {
    color: #ffffff;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chat-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.25) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) inset, 0 1px 0 rgba(255, 255, 255, 0.05) inset;
    max-height: calc(100% - 200px);
    min-height: 200px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.system-message {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.system-message p {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-size: 1rem;
    margin: 0;
}

.message {
    margin-bottom: 1.2rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    max-width: fit-content;
    min-width: 120px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.4) 0%, rgba(79, 70, 229, 0.25) 100%);
    margin-left: auto;
    margin-right: 10px;
    text-align: right;
    border: 1px solid rgba(79, 70, 229, 0.3);
    max-width: 70%;
}

.message.discord {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.4) 0%, rgba(88, 101, 242, 0.25) 100%);
    margin-left: 10px;
    margin-right: auto;
    border: 1px solid rgba(88, 101, 242, 0.3);
    max-width: 70%;
}

.message.admin {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.4) 0%, rgba(255, 165, 0, 0.25) 100%);
    margin-left: 10px;
    margin-right: auto;
    border: 1px solid rgba(255, 165, 0, 0.3);
    position: relative;
    max-width: 70%;
    margin-top: 1.5rem;
}

.message.admin::before {
    content: "🛡️ Admin Response";
    position: absolute;
    top: -8px;
    left: 12px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.9) 0%, rgba(255, 140, 0, 0.9) 100%);
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message.system {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    margin: 0 auto;
    text-align: center;
    max-width: 65%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-author {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.message-content {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.2rem;
    font-weight: 300;
    font-style: italic;
}

.chat-input-container {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#chatInput {
    flex: 1;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

#chatInput:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

#chatInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#chatName {
    width: 140px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

#chatName:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1) inset;
}

#chatName::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#sendButton {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.9) 100%);
    color: #000000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

#sendButton:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

#sendButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#sendButton:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Custom scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Message animations */
.message {
    animation: messageSlideIn 0.3s ease-out;
}

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

@media (max-width: 768px) {
    .chat-container {
        height: 80vh;
        max-height: 700px;
        min-height: 450px;
        padding: 0.8rem;
        margin: 2rem 0.5rem 6rem 0.5rem;
        max-width: none;
        width: calc(100% - 1rem);
    }
    
    .chat-header {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    
    .chat-header h2 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    
    .chat-header p {
        font-size: 0.9rem;
    }
    
    .chat-messages {
        padding: 0.8rem;
        margin-bottom: 1rem;
        flex: 1;
        min-height: 180px;
        max-height: calc(100% - 180px);
    }
    
    .chat-input-container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.8rem;
        align-items: stretch;
    }
    
    #chatInput {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    #chatName {
        width: 100px;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .message {
        max-width: 85%;
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .message-author {
        font-size: 0.75rem;
    }
    
    .message-content {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .message-time {
        font-size: 0.65rem;
    }
    
    #sendButton {
        padding: 0.8rem 1.2rem;
        font-size: 0.8rem;
        white-space: nowrap;
        min-width: 60px;
    }
    
    .login-section {
        padding: 1rem;
        margin-top: 0.8rem;
    }
    
    .quick-login-form h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .login-form-row {
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    .login-form-row input {
        min-width: auto;
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .login-buttons {
        gap: 0.6rem;
        flex-direction: column;
    }
    
    .quick-login-btn, .quick-register-btn, .cancel-login-btn {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
        width: 100%;
    }
    
    .chat-footer {
        margin-top: 0.8rem;
        padding-top: 0.8rem;
    }
    
    .login-options {
        gap: 0.6rem;
        justify-content: space-around;
    }
    
    .show-login-btn, .logout-btn, .clear-history-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .user-status {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        margin-top: 0.3rem;
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: 85vh;
        max-height: 650px;
        min-height: 400px;
        padding: 0.5rem;
        margin: 1.5rem 0.25rem 6rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .chat-header h2 {
        font-size: 1.2rem;
    }
    
    .chat-header p {
        font-size: 0.8rem;
    }
    
    .chat-messages {
        padding: 0.6rem;
        min-height: 150px;
        max-height: calc(100% - 160px);
    }
    
    .message {
        max-width: 90%;
        padding: 0.6rem 0.7rem;
    }
    
    .message-content {
        font-size: 0.85rem;
    }
    
    #chatInput {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    #sendButton {
        padding: 0.7rem 1rem;
        font-size: 0.75rem;
    }
    
    .login-form-row input {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}
