/* ========================================
   FLYING BOOK - WIZARD STYLES
   ======================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --primary-light: #e0e7ff;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --border-focus: #667eea;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   WIZARD HEADER
   ======================================== */

.wizard-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo a:hover {
    opacity: 0.8;
}

.logo i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-container {
    flex: 1;
    max-width: 600px;
}

.progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-number {
    width: 2rem;
    height: 2rem;
    background: var(--bg-tertiary);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.step.completed .step-number::before {
    content: '✓';
    font-size: 0.75rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    min-height: 2.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 3rem;
}

/* ========================================
   WIZARD CONTENT
   ======================================== */

.wizard-content {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.wizard-step {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.wizard-step.active {
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    text-align: center;
    margin-bottom: 3rem;
}

.step-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.step-header h1 i {
    color: var(--primary-color);
}

.step-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   FORMS
   ======================================== */

.wizard-form {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    padding: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section h3 i {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group label.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.readonly {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    display: block;
}

/* ========================================
   THEME SELECTOR
   ======================================== */

.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.theme-option {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-primary);
}

.theme-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.theme-option input {
    display: none;
}

.theme-preview {
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.theme-preview.moderne {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-preview.classique {
    background: linear-gradient(135deg, #2c3e50, #3498db);
}

.theme-preview.corporate {
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

.theme-preview.minimal {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
}

.theme-preview.premium {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.theme-header {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.theme-content {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.theme-element {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    flex: 1;
    height: 20px;
}

.theme-element.small {
    flex: 0.6;
    height: 15px;
    align-self: flex-end;
}

.theme-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.theme-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   SLIDE COUNTER
   ======================================== */

.slide-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.counter-btn {
    width: 3rem;
    height: 3rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.counter-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.counter-btn:active {
    transform: scale(0.95);
}

.slide-counter input {
    width: 80px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: default;
}

/* ========================================
   TRANSITION SELECTOR
   ======================================== */

.transition-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.transition-option {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: var(--bg-primary);
}

.transition-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.transition-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.transition-option input {
    display: none;
}

.transition-preview {
    height: 60px;
    margin-bottom: 1rem;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.transition-demo {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide-demo {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: var(--transition);
}

.transition-demo.fade .slide-demo:nth-child(2) {
    opacity: 0.3;
}

.transition-demo.slide .slide-demo:nth-child(2) {
    transform: translateX(50%);
    opacity: 0.5;
}

.transition-demo.flip .slide-demo:nth-child(2) {
    transform: rotateY(45deg);
    opacity: 0.7;
}

.transition-demo.threed .slide-demo:nth-child(2) {
    transform: perspective(100px) rotateX(30deg);
    opacity: 0.6;
}

.transition-demo.premium .slide-demo:nth-child(2) {
    transform: perspective(100px) rotateY(45deg) rotateX(15deg);
    opacity: 0.8;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
}

.transition-option h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.transition-option p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   NAVIGATION SELECTOR
   ======================================== */

.navigation-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.nav-option {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: var(--bg-primary);
}

.nav-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.nav-option input {
    display: none;
}

.nav-preview {
    height: 60px;
    margin-bottom: 1rem;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-content {
    width: 60%;
    height: 60%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.nav-preview i {
    color: var(--primary-color);
    font-size: 1rem;
}

.nav-thumbs {
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
}

.thumb {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
}

.thumb.active {
    background: var(--primary-color);
}

.keyboard-hint {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    opacity: 0.6;
}

.all-nav {
    flex-direction: column;
    gap: 0.25rem;
}

.nav-option h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.nav-option p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   FORM ACTIONS
   ======================================== */

.form-actions {
    padding: 2rem;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert i {
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .header-container {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .progress-container {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .theme-selector {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .transition-selector {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .navigation-selector {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .step-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .form-actions {
        padding: 1.5rem;
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .theme-selector {
        grid-template-columns: 1fr;
    }
    
    .transition-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navigation-selector {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        gap: 1rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    .wizard-content {
        padding: 1rem 0;
    }
    
    .step-header {
        margin-bottom: 2rem;
    }
    
    .step-header h1 {
        font-size: 1.5rem;
    }
    
    .step-header p {
        font-size: 1rem;
    }
    
    .transition-selector {
        grid-template-columns: 1fr;
    }
    
    .slide-counter {
        gap: 0.5rem;
    }
    
    .counter-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .slide-counter input {
        width: 60px;
        font-size: 1.25rem;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   LOADING STATES
   ======================================== */

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}