/**
 * Dynamic Book Personalization Form Styles
 * Incorporates styles from existing static step files
 */

/* Main Container */
.book-personalization-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.form-header h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.form-description {
    color: #666;
    font-size: 16px;
    margin: 0;
}

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

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

.progress-fill {
    height: 100%;
    background-color: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Form Steps */
.form-step {
    display: none;
}

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

.step-content {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fafafa;
}

.step-header {
    margin-bottom: 25px;
    text-align: center;
}

.step-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.step-description {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.step-body {
    margin-bottom: 30px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.required {
    color: #dc3545;
    margin-left: 4px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Color Picker Styles */
.color-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

.color-option {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-swatch {
    width: 60px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.color-swatch.selected {
    border: 3px solid #007cba;
    transform: scale(1.1);
}

/* Step Actions */
.step-actions {
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.col-md-6 {
    flex: 1;
}

.text-end {
    text-align: right;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background-color: #007cba;
    color: #fff;
}

.btn-primary:hover {
    background-color: #005a8b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

/* Button Icons */
.btn i {
    margin-left: 8px;
}

.btn-prev i {
    margin-left: 0;
    margin-right: 8px;
}

/* Form Validation */
.form-validation {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.form-validation.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-validation.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
    padding: 25px;
    border: 2px solid #28a745;
    border-radius: 8px;
    background: #f8fff9;
}

.preview-header {
    text-align: center;
    margin-bottom: 20px;
}

.preview-header h3 {
    color: #28a745;
    font-size: 24px;
    margin-bottom: 8px;
}

.preview-header p {
    color: #666;
    margin: 0;
}

.preview-content {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.preview-actions {
    text-align: center;
}

.preview-actions .btn {
    margin: 0 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .book-personalization-container {
        padding: 15px;
        margin: 10px;
    }
    
    .step-content {
        padding: 15px;
    }
    
    .color-options {
        gap: 15px;
    }
    
    .color-swatch {
        width: 50px;
        height: 50px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .row {
        flex-direction: column;
        gap: 10px;
    }
    
    .text-end {
        text-align: center;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.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 #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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