/* ==========================================================================
   COMFYDEPLOY GENERATOR (CENTERED & SHARP LAYOUT)
   ========================================================================== */

.comfy-generator-section {
    width: 100%;
    padding: 60px 0;
}

.comfy-container {
    max-width: 800px; /* Kompaktere Breite für perfekte Zentrierung */
    margin: 0 auto;
    padding: 0 20px;
    text-align: center; /* Zentriert Überschriften, Text & Buttons */
}

/* Header & Typografie */
.comfy-header {
    margin-bottom: 32px;
}

.comfy-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.comfy-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 16px;
    opacity: 0.8;
}

/* Perfekt zentrierte Description */
.comfy-description {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0 auto; /* Zentriert das Element selbst */
    text-align: center; /* Zentriert den Fließtext */
}

/* Der Container für den Text */
.comfy-description {
    margin: 0 auto;
    text-align: center;
}

/* Der Abstand NACH jedem Absatz */
.comfy-description p {
    margin-bottom: 16px; /* HIER den Abstand nach Wunsch anpassen (z.B. 12px - 20px) */
    line-height: 1.6;
}

/* Entfernt den Abstand beim allerletzten Satz vor der Eingabebox */
.comfy-description p:last-child {
    margin-bottom: 0;
}

/* Untereinander liegende Eingabe-Gruppe */
.comfy-input-group {
    display: flex;
    flex-direction: column; /* Ordnet Input & Button untereinander an */
    gap: 16px;
    margin-bottom: 12px;
    width: 100%;
}

/* Dauerhaft sichtbare Eingabebox (ohne Ecken-Radius) */
.comfy-input-group input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.2); /* Klar sichtbarer Rahmen */
    border-radius: 0; /* Keinerlei Ecken-Radius (scharfe Kanten) */
    background: #ffffff; /* Fester weißer Hintergrund für klare Sichtbarkeit */
    color: #111111;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.comfy-input-group input:focus {
    border-color: #18bfef;
    box-shadow: 0 0 0 1px #18bfef;
}

/* Full-width Button unter dem Input (ohne Ecken-Radius) */
.comfy-input-group button {
    width: 100%;
    padding: 3px 32px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    border-radius: 0; /* Keinerlei Ecken-Radius (scharfe Kanten) */
    background: #ffffff;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.comfy-input-group button:hover {
    background: #ffffff;
}

.comfy-input-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status-Text */
.comfy-status {
    font-size: 0.95rem;
    min-height: 24px;
    margin-bottom: 24px;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   IMAGE WRAPPER & SKELETON LOADER
   ========================================================================== */

.comfy-image-wrapper {
    position: relative;
    width: 100%;
    min-height: 200px; /* Minimalhöhe vor der ersten Generierung */
    border-radius: 12px;
    overflow: hidden;
}

.comfy-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: opacity 0.4s ease;
}

/* Skeleton Container (Reserviert 16:9 Platz) */
.comfy-skeleton {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Reserviert das Format des gerenderten Bildes */
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Fließender Glanz-Effekt (Shimmer) */
.comfy-skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Eleganter Ladebalken am unteren Rand des Skeletons */
.comfy-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #18bfef;
    box-shadow: 0 0 10px #18bfef;
    animation: indeterminateProgress 50s linear forwards;
}

@keyframes indeterminateProgress {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 60%; }
    85% { width: 88%; }
    100% { width: 98%; } /* Baut sich über ~50s organisch auf */
}

/* ==========================================================================
   DYNAMIC IMAGE CONTAINER & INITIAL TEXT
   ========================================================================== */

/* Initiale Textzeile unter dem Button (bevor generiert wird) */
.comfy-initial-text {
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.4);
    text-align: center;
    margin-top: 12px;
    letter-spacing: 0.02em;
    font-style: italic;
}

/* Bild-Container (Wird erst beim Klick eingeblendet) */
.comfy-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* 1024x1024 Format */
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    overflow: hidden;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.comfy-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Shimmer & Timer */
.comfy-shimmer-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.comfy-shimmer-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        #f4f4f4 0%, 
        #ffffff 25%, 
        #e8e8e8 50%, 
        #ffffff 75%, 
        #f4f4f4 100%
    );
    animation: lightShimmer 2.5s infinite linear;
}

@keyframes lightShimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

.comfy-timer-wrapper {
    position: relative;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111111;
    font-family: inherit;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.timer-unit {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.5;
}

/* ==========================================================================
   MOBILE OPTIMIZATION (KNAPPIGER RAND AUF SMARTPHONES)
   ========================================================================== */

@media (max-width: 640px) {
    /* Reduziert den Seitenabstand des gesamten Generators auf Mobilgeräten */
    .comfy-container {
        padding: 0 4px; /* Standard war 20px -> 8px bringt die Elemente nah an den Rand */
    }

    /* Optional: Passt die Überschrift auf kleinen Displays etwas an */
    .comfy-title {
        font-size: 2rem;
    }

    /* Verringert den Abstand zwischen Button und Bild-Container */
    .comfy-image-wrapper {
        margin-top: 16px; 
    }
}