/* SEODesignLab AI Widget Styles - Final Version */

.seodesignlab-widget {
    max-width: 600px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e1e5e9;
}

.widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 25px;
    text-align: center;
}

.widget-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.widget-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.widget-content {
    padding: 30px 25px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.service-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: #495057;
}

.service-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.service-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.input-section {
    margin-bottom: 20px;
}

.message-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

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

.message-input::placeholder {
    color: #6c757d;
}

.submit-section {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.priority-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.priority-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.response-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    display: none;
}

.response-section.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.response-content h1,
.response-content h2,
.response-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
}

.response-content h1 {
    font-size: 20px;
}

.response-content h2 {
    font-size: 18px;
}

.response-content h3 {
    font-size: 16px;
}

.response-content ul,
.response-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.response-content li {
    margin-bottom: 5px;
}

.response-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

.response-content th,
.response-content td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
}

.response-content th {
    background: #e9ecef;
    font-weight: 600;
}

.capabilities-info {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4fd;
    border-radius: 8px;
    font-size: 13px;
    color: #0c5460;
}

.capabilities-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.capability-badge {
    background: #0c5460;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #dc3545;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .seodesignlab-widget {
        margin: 10px;
        border-radius: 12px;
    }
    
    .widget-header {
        padding: 20px 15px;
    }
    
    .widget-header h2 {
        font-size: 20px;
    }
    
    .widget-content {
        padding: 20px 15px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
    
    .service-btn {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .message-input {
        min-height: 100px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .submit-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .submit-btn {
        min-width: auto;
    }
    
    .priority-toggle {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .service-btn {
        font-size: 12px;
        padding: 10px 6px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .seodesignlab-widget {
        border: 2px solid #000;
    }
    
    .service-btn {
        border-color: #000;
    }
    
    .message-input {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .service-btn,
    .submit-btn,
    .loading-spinner {
        transition: none;
        animation: none;
    }
    
    .response-section.show {
        animation: none;
    }
}

