/**
 * RistoBoost Plugin Styles
 * 
 * Responsive, mobile-first CSS for the marketing strategy form
 */

/* Reset and base styles */
.ristoboost-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ristoboost-form-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.ristoboost-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.ristoboost-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

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

/* Progress bar */
.ristoboost-progress {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    position: relative;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.step.active {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.step.completed {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

/* Form styles */
.ristoboost-form {
    padding: 30px;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.form-step.active {
    display: block;
}

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

.form-step h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background: #fff;
    min-height: 48px;
    line-height: 1.4;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

/* Radio buttons */
.radio-group {
    display: grid;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.radio-option:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #3498db;
    background: #3498db;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ span {
    color: #3498db;
    font-weight: 600;
}

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: 10px;
    position: relative;
}

.checkbox-option:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 3px solid #e9ecef;
    border-radius: 6px;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    flex-shrink: 0;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #27ae60;
    background: #27ae60;
    transform: scale(1.1);
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-option input[type="checkbox"]:checked ~ span {
    color: #27ae60;
    font-weight: 600;
}

.checkbox-option.selected {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
}

/* Privacy consent */
.privacy-consent {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.privacy-consent a {
    color: #3498db;
    text-decoration: none;
}

.privacy-consent a:hover {
    text-decoration: underline;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Confirmation step */
.confirmation-content {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.confirmation-content h3 {
    color: #28a745;
    font-size: 28px;
    margin-bottom: 15px;
}

.confirmation-content p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

.strategy-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    text-align: left;
}

.strategy-preview h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.preview-content {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.cta-section {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.cta-section h4 {
    margin-top: 0;
    font-size: 20px;
}

.cta-section .btn {
    background: white;
    color: #3498db;
    margin-top: 15px;
}

.cta-section .btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* Loading state */
.ristoboost-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.loading-message {
    text-align: center;
    padding: 40px 20px;
}

.loading-message h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.loading-message p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Responsive design */
@media (max-width: 768px) {
    .ristoboost-form-container {
        padding: 10px;
    }
    
    .ristoboost-header {
        padding: 20px 15px;
    }
    
    .ristoboost-header h2 {
        font-size: 24px;
    }
    
    .ristoboost-form {
        padding: 20px 15px;
    }
    
    .form-step h3 {
        font-size: 20px;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 10px;
    }
    
    .step {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .confirmation-content {
        padding: 20px 15px;
    }
    
    .success-icon {
        font-size: 48px;
    }
    
    .confirmation-content h3 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .ristoboost-header h2 {
        font-size: 20px;
    }
    
    .ristoboost-header p {
        font-size: 14px;
    }
    
    .form-step h3 {
        font-size: 18px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark theme support */
.ristoboost-form-container.dark {
    background: #1a1a1a;
    color: #fff;
}

.ristoboost-form-container.dark .ristoboost-form-wrapper {
    background: #2d2d2d;
    border: 1px solid #404040;
}

.ristoboost-form-container.dark .form-group input[type="text"],
.ristoboost-form-container.dark .form-group input[type="email"],
.ristoboost-form-container.dark .form-group select {
    background: #404040;
    border-color: #555;
    color: #fff;
}

.ristoboost-form-container.dark .radio-option,
.ristoboost-form-container.dark .checkbox-option {
    background: #404040;
    border-color: #555;
}

.ristoboost-form-container.dark .strategy-preview {
    background: #404040;
}

.ristoboost-form-container.dark .preview-content {
    background: #2d2d2d;
}
