/* Modern Chat Interface Styles */
:root {
    --primary-blue: #0073aa;
    --secondary-blue: #005b8f;
    --light-blue: #e6f2f8;
    --dark-blue: #003b5f;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --success: #4caf50;
    --danger: #f44336;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.chat-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.chat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    z-index: 10;
}

.chat-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.5);
}

.chat-icon img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.chat-bubble {
    position: absolute;
    top: -50px;
    right: 85px;
    background: white;
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 250px;
    font-weight: 500;
    animation: pulse 2s infinite;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.chat-icon:hover .chat-bubble {
    opacity: 1;
    transform: translateY(0);
}

.chat-bubble:after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10px;
    border-width: 10px 0 10px 15px;
    border-style: solid;
    border-color: transparent transparent transparent white;
    transform: translateY(-50%);
}

@keyframes pulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.chat-box {
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: var(--transition);
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 5;
}

.chat-box.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-header img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid rgba(255,255,255,0.5);
}

.chat-header-info {
    flex: 1;
}

.chat-header h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 3px;
}

.chat-status {
    font-size: 0.8rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
}

.chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-close:hover {
    color: white;
    background: rgba(255,255,255,0.2);
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fbfd;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.welcome-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid var(--light-blue);
    animation: fadeIn 0.5s ease;
}

.welcome-section h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-section h3 i {
    font-size: 1.5rem;
}

.welcome-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.email-input {
    display: flex;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.email-input input {
    flex: 1;
    padding: 14px;
    border: none;
    font-size: 0.95rem;
    background: #f5f9ff;
}

.email-input button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 22px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.email-input button:hover {
    background: var(--secondary-blue);
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    margin-bottom: 15px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.assistant {
    background: white;
    align-self: flex-start;
    border: 1px solid var(--light-blue);
    border-bottom-left-radius: 5px;
}

.message.user {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.chat-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    background: var(--light-blue);
    border: none;
    border-radius: 8px;
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: #d4e8f0;
    transform: translateY(-2px);
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f9fbfd;
    transition: var(--transition);
}

.chat-input-area input:focus {
    background: white;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

.chat-input-area button {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 50px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 767px) {
    .chat-assistant {
        bottom: 15px;
        right: 15px;
        left: auto;
    }
    
    .chat-box {
        width: calc(100vw - 30px) !important;
        max-width: 100vw !important;
        height: 70vh;
        left: 15px !important;
        right: 15px !important;
        bottom: 80px;
        transform-origin: bottom right;
    }
    
    .chat-icon {
        width: 60px;
        height: 60px;
        bottom: 15px;
        right: 15px;
    }
    
    .chat-icon img {
        width: 44px;
        height: 44px;
    }
    
    .chat-bubble {
        right: 70px;
        width: 220px;
        font-size: 13px;
        top: -60px;
    }
    
    .welcome-section {
        padding: 20px;
    }
    
    .action-btn {
        min-width: calc(50% - 5px);
    }
    
    .chat-actions {
        gap: 8px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-header img {
        width: 38px;
        height: 38px;
        margin-right: 12px;
    }
    
    .chat-header h3 {
        font-size: 1.1rem;
    }
    
    .chat-body {
        padding: 15px;
    }
    
    .message {
        padding: 12px 16px;
        font-size: 0.9rem;
        max-width: 90%;
    }
    
    .chat-footer {
        padding: 12px;
    }
    
    .chat-input-area input {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .chat-box {
        height: 80vh;
        bottom: 70px;
    }
    
    .chat-bubble {
        width: 180px;
        right: 65px;
        top: -70px;
    }
    
    .action-btn {
        min-width: 100%;
    }
    
    .chat-icon {
        width: 55px;
        height: 55px;
    }
    
    .chat-icon img {
        width: 40px;
        height: 40px;
    }
}

/* Mobile landscape orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .chat-box {
        height: 60vh;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .chat-box {
        height: 85vh;
    }
    
    .chat-bubble {
        width: 160px;
        font-size: 12px;
        padding: 10px 15px;
    }
    
    .welcome-section {
        padding: 15px;
    }
    
    .welcome-section h3 {
        font-size: 1.1rem;
    }
    
    .welcome-section p {
        font-size: 0.85rem;
    }
    
    .email-input input {
        padding: 12px;
        font-size: 0.85rem;
    }
}