/* ============================================
   THOTH.AI - Chat & Login Styles
   ============================================ */

/* === LOGIN MODAL === */
.login-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.login-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-content {
    background: #FFFFFF;
    padding: 50px 40px;
    border-radius: 15px;
    border: 3px solid #0E7490;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.4s ease;
}

:root[data-theme="dark"] .login-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--primary-gold);
    transform: rotate(90deg);
}

.login-icon {
    text-align: center;
    margin-bottom: 25px;
}

.login-icon i {
    font-size: 60px;
    color: var(--primary-gold);
}

.login-content h2 {
    font-family: var(--font-elegant);
    font-size: 32px;
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 15px;
}

.login-content > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid rgba(3, 105, 161, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-modern);
    transition: all 0.3s;
}

:root[data-theme="dark"] .form-group input {
    background: rgba(26, 35, 50, 0.6);
    border: 1px solid rgba(74, 155, 155, 0.3);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 10px rgba(74, 155, 155, 0.3);
}

.login-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    text-align: center;
}

.login-error.active {
    display: block;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient-gold);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-modern);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.4);
}

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

.login-hint {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    background: rgba(74, 155, 155, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(74, 155, 155, 0.2);
}

.login-hint p {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

/* === HEADER ACTIONS === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFB800 0%, #FF8C00 100%);
    border: none;
    border-radius: 10px;
    color: #0A0E27;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-modern);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 184, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.action-btn i {
    font-size: 16px;
}

/* Quick Login Button */
.quick-login {
    background: linear-gradient(135deg, #00D9FF 0%, #A855F7 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 217, 255, 0.4),
        0 0 30px rgba(168, 85, 247, 0.2);
}

.quick-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.quick-login:hover::before {
    width: 300px;
    height: 300px;
}

.quick-login i {
    animation: bolt 1.5s infinite;
}

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

/* === WELCOME MESSAGE === */
.welcome-message {
    text-align: center;
    padding: 60px 40px;
}

.welcome-icon {
    margin-bottom: 25px;
}

.welcome-icon i {
    font-size: 70px;
    color: var(--primary-gold);
    opacity: 0.8;
}

.welcome-message h3 {
    font-size: 28px;
    color: var(--primary-gold);
    font-family: var(--font-elegant);
    margin-bottom: 15px;
}

.welcome-message p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.welcome-instruction {
    font-size: 15px;
    color: var(--accent-teal);
    margin-top: 25px;
    padding: 15px;
    background: rgba(74, 155, 155, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(74, 155, 155, 0.2);
}

/* === CHAT MESSAGES === */
.message {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    animation: messageSlide 0.3s ease-out;
    margin-bottom: 20px;
}

.message.user-message {
    flex-direction: row;
}

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--soft-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #DC2626 0%, #7C2D12 100%);
}

:root[data-theme="dark"] .user-message .message-avatar {
    background: var(--gradient-gold);
}

.message-content {
    background: #F0F9FF;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(14, 116, 144, 0.5);
    max-width: 75%;
    word-wrap: break-word;
}

:root[data-theme="dark"] .message-content {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.user-message .message-content {
    background: linear-gradient(135deg, #FEE2E2 0%, #FEF3C7 100%);
    border: 2px solid rgba(220, 38, 38, 0.4);
}

:root[data-theme="dark"] .user-message .message-content {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(251, 191, 36, 0.12) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

:root[data-theme="dark"] .user-message .message-content {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
}

.message-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: #000000;
    font-weight: 500;
}

:root[data-theme="dark"] .message-content p {
    color: #F8FAFC;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    margin-top: 5px;
}

:root[data-theme="dark"] .message-time {
    color: #CBD5E1;
    opacity: 0.8;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.typing-indicator .message-avatar {
    animation: none;
}

.typing-dots {
    background: #F0F9FF;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(14, 116, 144, 0.5);
    display: flex;
    gap: 6px;
}

:root[data-theme="dark"] .typing-dots {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-teal);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* === FILE UPLOAD === */
.attach-btn {
    padding: 15px;
    background: rgba(74, 155, 155, 0.2);
    border: 1px solid rgba(74, 155, 155, 0.3);
    border-radius: 8px;
    color: var(--accent-teal);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.attach-btn:hover:not(:disabled) {
    background: rgba(74, 155, 155, 0.3);
    transform: translateY(-2px);
}

.attach-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.uploaded-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(74, 155, 155, 0.1);
    border: 1px solid rgba(74, 155, 155, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

.uploaded-file-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.file-info {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.remove-file {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
}

/* === ERROR MESSAGE === */
.error-message {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff6b6b;
    padding: 15px 20px;
    border-radius: 12px;
    margin: 20px;
    text-align: center;
}

/* === LOADING STATE === */
.chatbot-input.loading #sendBtn {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-input.loading #messageInput {
    opacity: 0.7;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .login-content {
        padding: 40px 30px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .welcome-message {
        padding: 40px 20px;
    }
}