/* Text on Image Generator - Public Styles */

.text-on-image-generator {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 2rem 0;
}

.text-on-image-standalone {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 !important;
}

/* Steps */
.step-container {
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    margin-right: 1rem;
}

/* Template Selection */
.template-option {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e9ecef !important;
}

.template-option:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-color: #667eea !important;
}

.template-option.selected {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transform: scale(1.02);
}

.template-option .template-preview {
    position: relative;
    overflow: hidden;
}

.template-option.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    z-index: 1;
    pointer-events: none;
}

.template-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    background: #667eea;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

/* Text Input Form */
.text-field-input {
    margin-bottom: 1.5rem;
}

.text-field-input label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.text-field-input .field-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.text-field-input input,
.text-field-input textarea {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.text-field-input input:focus,
.text-field-input textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.text-field-input.required label::after {
    content: '*';
    color: #dc3545;
    margin-left: 0.25rem;
}

/* Preview Container */
.preview-container {
    position: sticky;
    top: 2rem;
}

.preview-wrapper {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

#canvasPreview canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Generated Image */
#generatedImageContainer img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(86, 171, 47, 0.6);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.template-option:hover .template-preview img {
    animation: pulse 2s infinite;
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #fd7e14;
}

.char-counter.danger {
    color: #dc3545;
}

/* Progress Steps */
.steps-progress {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.steps-progress .step {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.steps-progress .step.active {
    color: #667eea;
    font-weight: 600;
}

.steps-progress .step.completed {
    color: #28a745;
}

.steps-progress .step::after {
    content: '';
    width: 50px;
    height: 2px;
    background: #e9ecef;
    margin: 0 1rem;
}

.steps-progress .step:last-child::after {
    display: none;
}

.steps-progress .step.completed::after {
    background: #28a745;
}

/* Responsive Design */
@media (max-width: 768px) {
    .text-on-image-generator {
        padding: 1rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 2rem 1rem;
    }
    
    .preview-container {
        position: static;
        margin-top: 2rem;
    }
    
    .template-option {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .text-on-image-generator .card {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .text-on-image-generator .card-header {
        background: #4a5568 !important;
        color: white !important;
    }
    
    .text-on-image-generator .text-muted {
        color: #a0aec0 !important;
    }
    
    .text-on-image-generator input,
    .text-on-image-generator textarea {
        background: #4a5568;
        color: white;
        border-color: #718096;
    }
    
    .text-on-image-generator .preview-wrapper {
        background: #4a5568;
        border-color: #718096;
    }
}