/* Template Builder Styles */
.template-builder {
    padding: 40px 0 80px;
    background: var(--bg-light);
    min-height: calc(100vh - 100px);
}

.builder-header {
    text-align: center;
    margin-bottom: 3rem;
}

.builder-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.builder-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 3rem;
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 20%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.step-indicator {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    padding-left: 1.5rem;
}

.step-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid var(--border-color);
}

.step-indicator.active {
    color: var(--primary-color);
    font-weight: 600;
}

.step-indicator.active::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.step-indicator.completed::before {
    background: var(--success-color);
    border-color: var(--success-color);
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

/* Form Steps */
.builder-form {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-step h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.step-description {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Agenda & Speakers Items */
.agenda-item,
.speaker-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
    position: relative;
}

.agenda-item::before,
.speaker-item::before {
    content: attr(data-index);
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.remove-item {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-item:hover {
    background: #dc2626;
}

/* Review Section */
.review-section {
    margin-top: 2rem;
}

.review-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.review-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.review-item p {
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.review-item strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Prompt Display / Generation Display */
.prompt-display {
    margin-top: 3rem;
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.prompt-display h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.prompt-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#generatedPrompt {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-light);
}

.prompt-content .btn {
    align-self: flex-start;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-spinner p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.error-message p {
    color: #991b1b;
    margin: 0.5rem 0;
}

/* Success Message */
.success-message {
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success-message p {
    color: #166534;
    font-size: 1.125rem;
    margin: 0;
}

/* Generated HTML Section */
.generated-html-section {
    margin-top: 2rem;
}

.html-preview {
    margin-bottom: 2rem;
}

.html-preview h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.html-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.html-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Responsive */
@media (max-width: 768px) {
    .builder-form {
        padding: 2rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .progress-steps {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-indicator {
        font-size: 0.8rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

