/**
 * SmartWeb CRM Frontend Styles
 */

/* Contact Forms */
.smartweb-crm-contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.smartweb-crm-contact-form h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.5rem;
    text-align: center;
}

.smartweb-crm-contact-form .form-group {
    margin-bottom: 1.5rem;
}

.smartweb-crm-contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.smartweb-crm-contact-form input,
.smartweb-crm-contact-form textarea,
.smartweb-crm-contact-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
}

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

.smartweb-crm-contact-form input.error,
.smartweb-crm-contact-form textarea.error {
    border-color: #ef4444;
}

.smartweb-crm-contact-form button[type="submit"] {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.smartweb-crm-contact-form button[type="submit"]:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.smartweb-crm-contact-form button[type="submit"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Messages */
.form-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.form-message.success-message {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Lead Capture Forms */
.smartweb-lead-capture {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.smartweb-lead-capture h4 {
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.25rem;
}

.smartweb-lead-capture p {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.smartweb-lead-capture form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.smartweb-lead-capture input[type="email"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
}

.smartweb-lead-capture button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.smartweb-lead-capture button:hover {
    background: #5a67d8;
}

/* Exit Intent Popup */
.exit-intent-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.exit-intent-popup-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: popup-fade-in 0.3s ease-out;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exit-intent-popup .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.exit-intent-popup .close-btn:hover {
    background: #e5e7eb;
}

.exit-intent-popup .close-btn::before {
    content: '×';
    font-size: 24px;
    color: #6b7280;
}

/* Chat Widget */
#smartweb-crm-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: #667eea;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-toggle svg {
    width: 24px;
    height: 24px;
}

.chat-box {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #667eea;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f9fafb;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 80%;
}

.message.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.agent-message {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-form {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
}

.chat-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.chat-form button {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-form button:hover {
    background: #5a67d8;
}

/* Responsive */
@media (max-width: 768px) {
    .smartweb-crm-contact-form {
        padding: 1.5rem;
    }
    
    .exit-intent-popup-content {
        padding: 2rem;
    }
    
    .chat-box {
        width: 100%;
        max-width: 350px;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    #smartweb-crm-chat {
        bottom: 10px;
        right: 10px;
    }
}