/* Veo 3 Prompt Builder CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

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

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Step Indicators */
.step-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    min-width: 60px;
}

.step-indicator i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.step-indicator.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.step-indicator.active i {
    background: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.step-indicator.completed {
    color: #48bb78;
}

.step-indicator.completed i {
    background: #48bb78;
    color: white;
}

.step-indicator.clickable:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.step-indicator.clickable:hover i {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.step-indicator span {
    margin-top: 4px;
    font-weight: 500;
}

/* Form Container */
.form-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    position: relative;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeInStep 0.4s ease-out;
}

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

/* Force visibility for steps that should be shown */
.step-content[data-force-visible="true"] {
    display: block !important;
}

.step-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.step-header h2 {
    color: #4a5568;
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.step-header h2 i {
    color: #667eea;
}

.step-header p {
    color: #718096;
    font-size: 1.1rem;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.template-card:hover::before {
    transform: scaleX(1);
}

.template-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.template-card.selected::before {
    transform: scaleX(1);
}

.template-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.template-card:hover .template-preview {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.template-preview i {
    color: white;
    font-size: 1.5rem;
}

.template-card h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.template-card p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.template-tags span {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.template-card:hover .template-tags span {
    background: #667eea;
    color: white;
}

.template-card.selected .template-tags span {
    background: #667eea;
    color: white;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.85rem;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.btn-nav {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    animation: pulse 2s infinite;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.btn-reset {
    background: #e53e3e;
    color: white;
}

.btn-reset:hover {
    background: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

.btn-copy {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #48bb78;
    color: white;
}

.btn-copy:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.btn-copy {
    background: #48bb78;
    color: white;
    font-size: 0.9rem;
    padding: 8px 15px;
}

.btn-copy:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Results */
.results-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.results-container h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-section:last-child {
    margin-bottom: 0;
}

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

.copy-header h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin: 0;
}

#jsonOutput {
    background: #1a202c;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.llm-prompt {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.natural-prompt {
    background: #f0fff4;
    color: #22543d;
    padding: 20px;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    border: 1px solid #c6f6d5;
}

/* Instructions */
.instructions {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.instructions h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ol {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
}

.instructions li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    position: relative;
}

.instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.instructions strong {
    color: #2d3748;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: white;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-container,
    .results-container,
    .instructions {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .step-indicators {
        justify-content: center;
        gap: 5px;
    }
    
    .step-indicator {
        min-width: 50px;
        font-size: 0.7rem;
    }
    
    .step-indicator i {
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .template-card {
        padding: 20px;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-nav {
        width: 100%;
        max-width: 300px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    .copy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-copy {
        align-self: flex-start;
    }
    
    #jsonOutput,
    .llm-prompt {
        font-size: 0.8rem;
    }
    
    .instructions li::before {
        left: -10px;
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .section h2 {
        font-size: 1.3rem;
    }
    
    .form-container,
    .results-container,
    .instructions {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

.results-container {
    animation: fadeIn 0.5s ease-out;
}

.results-content {
    animation: fadeIn 0.6s ease-out;
}

/* Custom Scrollbar */
#jsonOutput::-webkit-scrollbar,
.llm-prompt::-webkit-scrollbar {
    height: 8px;
}

#jsonOutput::-webkit-scrollbar-track,
.llm-prompt::-webkit-scrollbar-track {
    background: #2d3748;
}

#jsonOutput::-webkit-scrollbar-thumb,
.llm-prompt::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

#jsonOutput::-webkit-scrollbar-thumb:hover,
.llm-prompt::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Loading State */
.btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Locked Form Fields */
.form-group input[readonly],
.form-group select[disabled] {
    background-color: #f7fafc;
    color: #4a5568;
    cursor: not-allowed;
    border-color: #e2e8f0;
    opacity: 0.8;
}

.form-group input[readonly]:focus,
.form-group select[disabled]:focus {
    border-color: #e2e8f0;
    box-shadow: none;
}

.form-group small {
    color: #718096;
    font-style: italic;
    margin-top: 5px;
    display: block;
}