/**
 * Bidooh AI Frontend Styles
 */

/* Modal Styles */
.bidooh-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.bidooh-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.bidooh-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

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

.bidooh-modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.bidooh-modal-close:hover {
    opacity: 1;
}

.bidooh-modal-body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Chat Styles */
.bidooh-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
    background: #f8f9fa;
}

.bidooh-chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.bidooh-user-message {
    align-items: flex-end;
}

.bidooh-ai-message {
    align-items: flex-start;
}

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

.bidooh-user-message .bidooh-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bidooh-ai-message .bidooh-message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
}

.bidooh-error-message .bidooh-message-content {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

.bidooh-message-content p {
    margin: 0;
    line-height: 1.4;
}

.bidooh-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 16px;
}

/* Typing Indicator */
.bidooh-typing-indicator .bidooh-message-content {
    padding: 16px;
}

.bidooh-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bidooh-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.bidooh-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.bidooh-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input */
.bidooh-chat-input-container {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 8px 8px;
}

.bidooh-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#bidooh-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

#bidooh-chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.bidooh-send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.bidooh-send-button:hover {
    transform: scale(1.05);
}

.bidooh-send-button:active {
    transform: scale(0.95);
}

.bidooh-chat-actions {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bidooh-usage-info {
    color: #666;
    font-size: 12px;
}

/* Social Feed Styles */
.bidooh-social-feed {
    max-width: 600px;
    margin: 0 auto;
}

.bidooh-post {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.bidooh-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bidooh-post-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bidooh-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.bidooh-post-meta {
    flex: 1;
}

.bidooh-author-name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.bidooh-post-time {
    font-size: 12px;
    color: #666;
}

.bidooh-post-content {
    padding: 0 16px 16px 16px;
}

.bidooh-post-content p {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

.bidooh-post-actions {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 20px;
}

.bidooh-like-btn,
.bidooh-comment-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.bidooh-like-btn:hover,
.bidooh-comment-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.bidooh-like-btn.liked {
    color: #e74c3c;
}

.bidooh-like-btn.liked i {
    color: #e74c3c;
}

/* Connection Styles */
.bidooh-connection-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.bidooh-connection-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.bidooh-connection-info {
    flex: 1;
}

.bidooh-connection-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #333;
}

.bidooh-connection-company {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.bidooh-connect-btn,
.bidooh-accept-connection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.bidooh-connect-btn:hover,
.bidooh-accept-connection:hover {
    transform: translateY(-1px);
}

.bidooh-connect-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Form Styles */
.bidooh-form {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bidooh-form-group {
    margin-bottom: 16px;
}

.bidooh-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.bidooh-form-input,
.bidooh-form-textarea,
.bidooh-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.bidooh-form-input:focus,
.bidooh-form-textarea:focus,
.bidooh-form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.bidooh-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.bidooh-form-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.bidooh-form-submit:hover {
    transform: translateY(-1px);
}

/* Notification Styles */
.bidooh-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    border-left: 4px solid #667eea;
}

.bidooh-notification-success {
    border-left-color: #27ae60;
}

.bidooh-notification-error {
    border-left-color: #e74c3c;
}

.bidooh-notification-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.bidooh-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.bidooh-notification-close:hover {
    color: #666;
}

/* Loading and Empty States */
.bidooh-loading,
.bidooh-no-posts,
.bidooh-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.bidooh-loading {
    position: relative;
}

.bidooh-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .bidooh-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .bidooh-chat-messages {
        max-height: 300px;
    }
    
    .bidooh-connection-card {
        flex-direction: column;
        text-align: center;
    }
    
    .bidooh-post-actions {
        justify-content: center;
    }
    
    .bidooh-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Dashboard Integration */
.dashboard-nav .bidooh-menu-item {
    position: relative;
}

.bidooh-menu-item .nav-tag {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    text-align: center;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bidooh-modal-content {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    
    .bidooh-chat-messages {
        background: #34495e;
    }
    
    .bidooh-ai-message .bidooh-message-content {
        background: #3c4f66;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .bidooh-post {
        background: #2c3e50;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .bidooh-form {
        background: #2c3e50;
        border-color: #4a5f7a;
    }
    
    .bidooh-form-input,
    .bidooh-form-textarea,
    .bidooh-form-select {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
}

