/* MyRyde Frontend Chat Styles */

/* Chat Container */
.myryde-chat-container {
    max-width: 400px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Header */
.myryde-chat-header {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.myryde-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.myryde-chat-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.myryde-chat-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Chat Body */
.myryde-chat-body {
    padding: 20px;
}

.myryde-chat-messages {
    height: 350px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f9f9f9;
}

/* Welcome Message */
.myryde-welcome-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #0073aa;
}

/* Guest Form */
.myryde-guest-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
}

.myryde-guest-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.myryde-guest-form input:focus {
    outline: none;
    border-color: #0073aa;
}

/* Message Form */
.myryde-message-form {
    display: flex;
    gap: 12px;
}

.myryde-message-form textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 50px;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.myryde-message-form textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.myryde-message-form button {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
}

.myryde-message-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.myryde-message-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Chat Messages */
.myryde-chat-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.myryde-message-user {
    background: linear-gradient(135deg, #e3f2fd, #c7e0ff);
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
}

.myryde-message-support {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.myryde-message-content {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.myryde-message-meta {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    opacity: 0.8;
}

/* Chat Widget */
.myryde-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.myryde-chat-bubble {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,115,170,0.3);
    transition: all 0.3s ease;
}

.myryde-chat-bubble:hover {
    transform: scale(1.1);
}

.myryde-chat-bubble.myryde-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0,115,170,0.7); }
    70% { box-shadow: 0 0 0 20px rgba(0,115,170,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,115,170,0); }
}

.myryde-chat-bubble.myryde-has-new-message {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.myryde-chat-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.myryde-chat-popup.active {
    display: block;
}

.myryde-chat-popup .myryde-chat-header {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.myryde-chat-popup .myryde-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.myryde-chat-popup .myryde-chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.myryde-chat-popup .myryde-chat-header button:hover {
    background: rgba(255,255,255,0.1);
}

.myryde-chat-popup .myryde-chat-body {
    padding: 16px;
    height: calc(100% - 64px);
    display: flex;
    flex-direction: column;
}

.myryde-chat-popup .myryde-chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    padding: 12px;
    margin-bottom: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.myryde-chat-popup .myryde-chat-input-container {
    display: flex;
    gap: 8px;
}

.myryde-chat-popup textarea {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 80px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.myryde-chat-popup textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.myryde-chat-popup button {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.myryde-chat-popup button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

/* Notifications */
.myryde-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.myryde-notification-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.myryde-notification-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* .myryde-chat-widget {
        bottom: 10px;
        right: 10px;
    }
     */
    .myryde-chat-popup {
        width: calc(100vw - 40px);
        right: -10px;
        height: 400px;
    }
    
    .myryde-chat-container {
        margin: 10px;
        max-width: 100%;
    }
    
    .myryde-guest-form {
        grid-template-columns: 1fr;
    }
    
    .myryde-message-form {
        flex-direction: column;
    }
    
    .myryde-message-form button {
        width: 100%;
    }
}

/* Loading States */
.send-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.myryde-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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


@media (max-width: 768px) {
    .myryde-chat-widget {
        bottom: 75px;
        right: 5px;
    }
}