/**
 * Template Wizard v2.0 - Styles (Dark Theme)
 * Modern UI for AI generation wizard - matching admin panel theme
 */

/* Container */
.wizard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.wizard-header {
    text-align: center;
    margin-bottom: 30px;
}

.wizard-header h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
    color: #e9eef4;
}

.wizard-header p {
    color: #9fb0c3;
    margin: 0;
}

/* Progress Steps */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1b2731;
    color: #9fb0c3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid #2d3a47;
}

.progress-step.active .step-number {
    background: #b02a2a;
    border-color: #b02a2a;
    color: white;
}

.progress-step.completed .step-number {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #9fb0c3;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: #e9eef4;
    font-weight: 600;
}

.step-connector {
    width: 60px;
    height: 3px;
    background: #2d3a47;
    margin: 0 10px;
    margin-bottom: 20px;
}

/* Template Categories - WIZARD SPECIFIC (scoped to .wizard-container) */
.wizard-container .template-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wizard-container .template-category {
    border: 1px solid #1b2731;
    border-radius: 12px;
    padding: 20px;
    background: #0f1318;
}

.wizard-container .category-title {
    font-size: 16px;
    font-weight: 600;
    color: #e9eef4;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #16a34a;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* Template Card */
.template-card {
    background: #111923;
    border: 2px solid #1b2731;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.template-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    background: #0f1a2a;
}

.template-card.selected {
    border-color: #16a34a;
    background: #0f2818;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.template-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.template-name {
    font-weight: 600;
    font-size: 14px;
    color: #e9eef4;
    margin-bottom: 5px;
}

.template-description {
    font-size: 12px;
    color: #9fb0c3;
    line-height: 1.4;
    margin-bottom: 8px;
}

.template-subcategories-count {
    font-size: 11px;
    color: #9fb0c3;
    background: #1b2731;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* Subcategory Selection */
.subcategory-selection h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #e9eef4;
}

/* Subcategory Grid - WIZARD SPECIFIC */
.wizard-container .subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Subcategory Card - WIZARD SPECIFIC */
.wizard-container .subcategory-card {
    background: #111923;
    border: 2px solid #1b2731;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wizard-container .subcategory-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    background: #0f1a2a;
}

.wizard-container .subcategory-card.selected {
    border-color: #16a34a;
    background: #0f2818;
}

.subcategory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wizard-container .subcategory-name,
.wizard-container .subcategory-card strong {
    font-weight: 600;
    font-size: 15px;
    color: #e9eef4;
}

.word-count-badge {
    background: #16a34a;
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: 600;
}

.wizard-container .subcategory-description,
.wizard-container .subcategory-card small {
    font-size: 13px;
    color: #9fb0c3;
    line-height: 1.4;
}

/* Questions Form */
.questions-form {
    max-width: 700px;
    margin: 0 auto;
}

.questions-form h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #e9eef4;
}

.form-subtitle {
    text-align: center;
    color: #9fb0c3;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #e9eef4;
    font-size: 14px;
}

.form-group .required {
    color: #f87171;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #1b2731;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #111923;
    color: #e9eef4;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3b82f6;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #64748b;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    color: #e9eef4;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
}

.form-divider {
    font-size: 14px;
    font-weight: 600;
    color: #9fb0c3;
    margin: 30px 0 20px 0;
    padding: 10px 0;
    border-top: 1px solid #1b2731;
    border-bottom: 1px solid #1b2731;
    text-align: center;
    background: #0f1318;
}

/* Confirmation Panel */
.confirmation-panel {
    max-width: 600px;
    margin: 0 auto;
}

.confirmation-panel h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #e9eef4;
}

.summary-card {
    background: #111923;
    border: 1px solid #1b2731;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #1b2731;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.highlight {
    background: #0f2818;
    margin: 0 -20px;
    padding: 12px 20px;
    border-radius: 8px;
}

.summary-label {
    color: #9fb0c3;
    font-size: 14px;
}

.summary-value {
    font-weight: 600;
    color: #e9eef4;
    font-size: 14px;
}

.generation-notice {
    background: #0f2818;
    border: 1px solid #16a34a40;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.generation-notice p {
    margin: 0;
    font-size: 13px;
    color: #4ade80;
    line-height: 1.5;
}

/* Generation Result */
.generation-result {
    margin-top: 25px;
}

.generation-result.hidden {
    display: none;
}

.generation-progress {
    text-align: center;
    padding: 40px;
    background: #0f1318;
    border-radius: 12px;
    border: 1px solid #1b2731;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #1b2731;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.wizard-container .progress-bar {
    width: 100%;
    height: 8px;
    background: #1b2731;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.generation-success {
    background: #0f2818;
    border: 1px solid #16a34a40;
    border-radius: 12px;
    padding: 25px;
}

.generation-success h4 {
    margin: 0 0 20px 0;
    color: #4ade80;
    text-align: center;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #4ade80;
}

.stat-label {
    font-size: 12px;
    color: #9fb0c3;
}

.result-preview {
    background: #111923;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #1b2731;
}

.result-preview h5 {
    margin: 0 0 10px 0;
    color: #e9eef4;
}

.result-preview p {
    margin: 0;
    color: #9fb0c3;
    font-size: 14px;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.generation-error {
    background: #1c1917;
    border: 1px solid #b91c1c40;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.generation-error h4 {
    margin: 0 0 10px 0;
    color: #f87171;
}

.generation-error p {
    color: #9fb0c3;
    margin-bottom: 15px;
}

/* Navigation */
.wizard-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #1b2731;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.wizard-container .btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wizard-container .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-container .btn-primary {
    background: #16a34a;
    color: white;
}

.wizard-container .btn-primary:hover:not(:disabled) {
    background: #15803d;
    transform: translateY(-1px);
}

.wizard-container .btn-secondary {
    background: #1b2731;
    color: #e9eef4;
    border: 1px solid #2d3a47;
}

.wizard-container .btn-secondary:hover:not(:disabled) {
    background: #2d3a47;
}

.wizard-container .btn-success {
    background: #16a34a;
    color: white;
}

.wizard-container .btn-success:hover:not(:disabled) {
    background: #15803d;
    transform: translateY(-1px);
}

/* Word range badge for subcategory cards */
.word-range {
    font-size: 11px;
    color: #9fb0c3;
    background: #1b2731;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

/* Notification */
.wizard-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.wizard-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.wizard-notification.success {
    background: #16a34a;
    color: white;
}

.wizard-notification.error {
    background: #dc2626;
    color: white;
}

.wizard-notification.info {
    background: #3b82f6;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-container {
        padding: 15px;
    }
    
    .wizard-header h2 {
        font-size: 22px;
    }
    
    .wizard-progress {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step-connector {
        width: 30px;
    }
    
    .template-grid,
    .wizard-container .subcategory-grid {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-buttons .btn {
        width: 100%;
    }
}
