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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a0000 0%, #000000 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    background: #0a0a0a;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.3);
    border: 1px solid #330000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #cc0000 0%, #660000 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #ff0000;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0a0a0a;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: white;
    border: 1px solid #ff0000;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #330000;
}

.chat-input-container {
    padding: 20px;
    background: #0f0f0f;
    border-top: 2px solid #330000;
    display: flex;
    gap: 10px;
    align-items: center;
}

.voice-button {
    padding: 12px;
    background: #1a1a1a;
    color: #cc0000;
    border: 2px solid #330000;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-button:hover {
    background: #330000;
    border-color: #cc0000;
    transform: scale(1.05);
}

.voice-button.listening {
    background: #cc0000;
    color: white;
    animation: pulse 1.5s infinite;
    border-color: #ff0000;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(204, 0, 0, 0);
    }
}

.voice-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #330000;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #e0e0e0;
}

.chat-input:focus {
    border-color: #cc0000;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.3);
}

.send-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #cc0000 0%, #660000 100%);
    color: white;
    border: 1px solid #ff0000;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.6);
    background: linear-gradient(135deg, #ff0000 0%, #990000 100%);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Generated image styling */
.generated-image {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 0;
}

.bot-message .message-content:has(.generated-image) {
    padding: 8px;
    max-width: 80%;
}

/* Speaker button styling */
.speaker-button {
    background: none;
    border: none;
    color: #cc0000;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.3s;
    vertical-align: middle;
    opacity: 0.7;
}

.speaker-button:hover {
    opacity: 1;
    background: rgba(204, 0, 0, 0.1);
}

.speaker-button.speaking {
    animation: speakerPulse 1s infinite;
    opacity: 1;
}

@keyframes speakerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #660000;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #cc0000;
}

/* Authentication Container */
.auth-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a0000 0%, #000000 100%);
}

.auth-box {
    width: 90%;
    max-width: 400px;
    background: #0a0a0a;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.3);
    border: 1px solid #330000;
    padding: 40px;
}

.auth-box h1 {
    color: #cc0000;
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-subtitle {
    color: #999;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form h2 {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 20px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 15px;
    border: 2px solid #330000;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #e0e0e0;
}

.auth-input:focus {
    border-color: #cc0000;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.3);
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #cc0000 0%, #660000 100%);
    color: white;
    border: 1px solid #ff0000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.auth-button:hover {
    background: linear-gradient(135deg, #ff0000 0%, #990000 100%);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.6);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-links a {
    color: #cc0000;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: #ff0000;
    text-decoration: underline;
}

.auth-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.auth-message.success {
    background: rgba(0, 204, 0, 0.1);
    border: 1px solid #00cc00;
    color: #00ff00;
    display: block;
}

.auth-message.error {
    background: rgba(204, 0, 0, 0.1);
    border: 1px solid #cc0000;
    color: #ff6666;
    display: block;
}

.password-requirements {
    font-size: 12px;
    color: #999;
    margin-top: -10px;
    margin-bottom: 15px;
}

.verify-message {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

/* User info in chat header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.logout-button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}
