/**
 * SB Wizard Frontend Styles
 * 
 * @package SB_Wizard
 * @since 1.0.0
 */

/* Main Container */
.sb-wizard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Progress Bar */
.sb-wizard-progress-container {
    margin-bottom: 30px;
}

.sb-wizard-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sb-wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.sb-wizard-progress-text {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Header */
.sb-wizard-header {
    margin-bottom: 30px;
    text-align: center;
}

.sb-wizard-title {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
}

.sb-wizard-description {
    margin: 0;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
}

/* Questions */
.sb-wizard-questions {
    margin-bottom: 30px;
}

.sb-wizard-question {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.sb-wizard-question.current {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.sb-wizard-question-header {
    margin-bottom: 15px;
}

.sb-wizard-question-text {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}

.sb-wizard-required {
    color: #ef4444;
    margin-left: 3px;
}

.sb-wizard-stale-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 10px;
    color: #92400e;
    font-size: 14px;
    margin-top: 10px;
}

.sb-wizard-question-error {
    margin-top: 10px;
    padding: 10px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    font-size: 14px;
}

/* Inputs */
.sb-wizard-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.sb-wizard-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.sb-wizard-text,
.sb-wizard-number,
.sb-wizard-email,
.sb-wizard-date,
.sb-wizard-select {
    max-width: 400px;
}

.sb-wizard-textarea {
    min-height: 100px;
    resize: vertical;
}

.sb-wizard-file {
    padding: 8px;
}

/* Radio and Checkbox */
.sb-wizard-radio-label,
.sb-wizard-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 16px;
}

.sb-wizard-radio,
.sb-wizard-checkbox {
    width: auto !important;
    margin-right: 10px;
    transform: scale(1.2);
}

.sb-wizard-radio-text,
.sb-wizard-checkbox-text {
    color: #374151;
    line-height: 1.4;
}

.sb-wizard-radio-label:hover,
.sb-wizard-checkbox-label:hover {
    background: #f3f4f6;
    border-radius: 4px;
    padding: 5px;
    margin: 0 -5px 10px -5px;
}

/* Rating */
.sb-wizard-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Star-based ratings (1-5) */
.sb-wizard-rating-stars .sb-wizard-rating-item {
    font-size: 24px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.sb-wizard-rating-stars .sb-wizard-rating-item:hover,
.sb-wizard-rating-stars .sb-wizard-rating-item.active {
    color: #fbbf24;
}

.sb-wizard-rating-stars .sb-wizard-rating-item:hover ~ .sb-wizard-rating-item {
    color: #d1d5db;
}

/* Number-based ratings (1-10) */
.sb-wizard-rating-numbers {
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 15px auto;
}

.sb-wizard-rating-numbers .sb-wizard-rating-item {
    width: 40px;
    height: 40px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    background: #fff;
}

.sb-wizard-rating-numbers .sb-wizard-rating-item:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    transform: scale(1.1);
}

.sb-wizard-rating-numbers .sb-wizard-rating-item.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
    transform: scale(1.1);
}

.sb-wizard-rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .sb-wizard-rating-numbers {
        gap: 5px;
    }
    
    .sb-wizard-rating-numbers .sb-wizard-rating-item {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .sb-wizard-rating-labels {
        font-size: 11px;
        padding: 0 10px;
    }
}

/* File Upload */
.sb-wizard-file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s;
}

.sb-wizard-file-upload:hover {
    border-color: #4f46e5;
}

.sb-wizard-file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
}

.sb-wizard-file-preview a {
    color: #4f46e5;
    text-decoration: none;
}

.sb-wizard-file-preview a:hover {
    text-decoration: underline;
}

/* Navigation */
.sb-wizard-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.sb-wizard-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.sb-wizard-btn-prev,
.sb-wizard-btn-next,
.sb-wizard-btn-submit {
    background: #4f46e5;
    color: white;
}

.sb-wizard-btn-prev:hover,
.sb-wizard-btn-next:hover,
.sb-wizard-btn-submit:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.sb-wizard-btn:disabled {
    background: #9ca3af;
    color: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.sb-wizard-btn-prev {
    background: #6b7280;
}

.sb-wizard-btn-prev:hover:not(:disabled) {
    background: #4b5563;
}

/* Loading */
.sb-wizard-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

.sb-wizard-loading span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sb-wizard-loading span:before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages */
.sb-wizard-messages {
    margin-top: 20px;
}

.sb-wizard-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

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

.sb-wizard-message.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.sb-wizard-message.warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* Error state */
.sb-wizard-error {
    text-align: center;
    padding: 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sb-wizard-container {
        margin: 10px;
        padding: 15px;
    }
    
    .sb-wizard-title {
        font-size: 20px;
    }
    
    .sb-wizard-question-text {
        font-size: 16px;
    }
    
    .sb-wizard-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sb-wizard-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .sb-wizard-radio-label,
    .sb-wizard-checkbox-label {
        padding: 8px;
    }
}

/* Hidden questions */
.sb-wizard-question[data-conditional-hidden="true"] {
    display: none !important;
}

/* Validation states */
.sb-wizard-question.has-error .sb-wizard-input {
    border-color: #ef4444;
}

.sb-wizard-question.has-error .sb-wizard-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Auto-save indicator */
.sb-wizard-auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.sb-wizard-auto-save-indicator.show {
    opacity: 1;
}

.sb-wizard-auto-save-indicator.saving {
    background: #f59e0b;
}

.sb-wizard-auto-save-indicator.error {
    background: #ef4444;
}