/* ==============
   AI-STYLES.CSS - KOMPLETT KORRIGIERTE VERSION
   Für Evita KI (Hauptseite) und Silas KI (CSV-Creator)
   ============== */

/* ======================================== */
/* GLOBALE AI-CONTAINER STYLES             */
/* ======================================== */

/* Basis-Container für alle AI-Interfaces */
.ai-container {
    width: 100%;
    margin: 0 auto;
}

.ai-container h3 {
    color: #ffc107;
    text-align: center;
    margin-bottom: 1rem;
}

.ai-container p {
    color: #ccc;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ======================================== */
/* EVITA KI - HAUPTSEITEN-FORMULAR         */
/* ======================================== */

/* Standard AI-Formular (für Evita auf der Hauptseite) */
.ai-container form:not(#silas-form) {
    display: flex;
    flex-direction: row;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #444;
    background-color: #2d2d2d;
    transition: all 0.3s ease-in-out;
    align-items: center;
}

.ai-container form:not(#silas-form):hover,
.ai-container form:not(#silas-form):focus-within {
    border-color: #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

/* Input-Feld für Evita (ai-question) */
#ai-question {
    flex-grow: 1;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    background-color: transparent;
    color: #fff;
    outline: none;
}

#ai-question::placeholder {
    color: #aaa;
}

#ai-question:focus {
    outline: none;
}

/* Standard AI-Button für Evita */
.ai-container form:not(#silas-form) button {
    background: transparent;
    border: none;
    color: #ffc107;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-container form:not(#silas-form) button:hover {
    color: #fff;
    background-color: rgba(255, 193, 7, 0.1);
}

/* ======================================== */
/* SILAS KI - CSV-CREATOR FORMULAR         */
/* ======================================== */

#silas-form,
.silas-input-container {
    display: flex;
    flex-direction: row;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #444;
    background-color: #2d2d2d;
    transition: all 0.3s ease-in-out;
    align-items: center;
    margin-bottom: 1.5rem;
}

#silas-form {
    align-items: stretch;
}

#silas-form:hover,
#silas-form:focus-within,
.silas-input-container:hover,
.silas-input-container:focus-within {
    border-color: #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.2);
}

#silas-keyword-input,
.silas-extra-input {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    padding: 15px 20px;
    font-size: 1rem;
    color: #eee;
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

#silas-keyword-input::placeholder,
.silas-extra-input::placeholder {
    color: #888;
    opacity: 1;
}

#silas-form button {
    background: #ffc107;
    border: none;
    color: #1a1a1a;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}

#silas-form button:hover {
    background: #e0a800;
}

#add-keyword-btn {
    background: transparent;
    border: none;
    color: #ffc107;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#add-keyword-btn:hover {
    color: #fff;
    background-color: rgba(255, 193, 7, 0.1);
}

/* ======================================== */
/* SILAS SELECT-BOX (TEXT-INTENT)          */
/* ======================================== */

.ai-container .input-group {
    display: flex;
    align-items: center;
    margin-top: 15px;
    gap: 15px;
    width: 100%;
    background-color: rgba(45, 45, 45, 0.3);
    padding: 12px 15px;
    border-radius: 7px;
    border: 1px solid #444;
    transition: all 0.3s ease-in-out;
}

.ai-container .input-group:hover {
    border-color: #ffc107;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

.ai-container .input-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
    white-space: nowrap;
    color: #f0f0f0;
    min-width: 80px;
    margin-right: 15px;
}

.ai-container .custom-select {
    flex-grow: 1;
    background-color: #2d2d2d;
    border: 1px solid #444;
    border-radius: 7px;
    color: #fff;
    padding: 10px 15px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc107' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.ai-container .custom-select:hover,
.ai-container .custom-select:focus {
    border-color: #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
    outline: none;
}

.ai-container .custom-select option {
    background-color: #2d2d2d;
    color: #fff;
    padding: 10px;
}

/* ======================================== */
/* SILAS KEYWORD-LISTE                     */
/* ======================================== */

.keyword-list-container {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid #444;
    border-radius: 10px;
    background-color: rgba(45, 45, 45, 0.5);
}

.keyword-list-container h4 {
    margin-top: 0;
    color: #ffc107;
    text-align: center;
}

#keyword-display-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.2);
    border-radius: 5px;
    padding: 0.5rem;
}

#keyword-display-list li {
    background-color: rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #fff;
    min-height: 50px;
    gap: 10px;
    transition: background-color 0.3s ease;
}

#keyword-display-list li:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

#keyword-display-list li button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    min-width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

#keyword-display-list li button:hover {
    background-color: #ff5252;
}

/* ======================================== */
/* SILAS BUTTON-CONTROLS                   */
/* ======================================== */

.keyword-list-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cta-button .fas {
    margin-right: 10px;
}

.cta-button:not(.secondary) {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #1a1a1a;
}

.cta-button:not(.secondary):hover {
    background-color: #ffca2c;
    border-color: #ffca2c;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.cta-button.secondary {
    background-color: transparent;
    border-color: #555;
    color: #aaa;
}

.cta-button.secondary:hover {
    background-color: #333;
    border-color: #777;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* ======================================== */
/* SILAS ERGEBNIS-ANZEIGE                  */
/* ======================================== */

#silas-response-container {
    margin-top: 1rem;
    text-align: left;
}

#silas-response-container h3 {
    color: #ffc107;
    text-align: center;
    margin-bottom: 1.5rem;
}

#silas-response-content {
    background-color: rgba(255,255,255,0.05);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 1rem;
}

.result-card {
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
}

.result-card h4 {
    color: #fff;
    margin: 0 0 10px 0;
}

.result-card p {
    margin: 5px 0;
    color: #ccc;
}

.result-card .error {
    color: #ff6b6b;
}

.preview-btn {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.preview-btn:hover {
    background-color: #005f8a;
}

#download-csv,
#download-csv-dynamic {
    width: 100%;
    text-align: center;
    border: 2px solid #ffc107;
    background-color: transparent;
    color: #ffc107;
    padding: 12px 20px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#download-csv:hover,
#download-csv-dynamic:hover {
    background-color: #ffc107;
    color: #2d2d2d;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

#download-csv .fas,
#download-csv-dynamic .fas {
    margin-right: 10px;
}

/* ======================================== */
/* SILAS PREVIEW MODAL - VEREINFACHTE LÖSUNG */
/* ======================================== */

/* ======================================== */
/* SILAS KI - Preview Modal (KORRIGIERT)   */
/* ======================================== */

/* Preview Modal (Lightbox) Overlay - KORRIGIERT MIT !important */
#silas-preview-modal {
    /* Positionierung & Sichtbarkeit */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(10, 10, 10, 0.9);
    
    /* Perfekte Zentrierung mit Flexbox (verstärkt!) */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Übergänge für sanftes Ein-/Ausblenden */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: hidden; /* Verhindert Scrollen des Overlays */
}

/* Zustand, wenn das Modal sichtbar ist */
#silas-preview-modal.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Der Inhalts-Container des Modals */
#silas-preview-modal .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-radius: 10px;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#silas-preview-modal.visible .modal-content {
    transform: scale(1);
}

/* Der scrollbare Bereich innerhalb des Modals */
#preview-content-area {
    overflow-y: auto;
    padding: 20px;
    flex-grow: 1;
    background: #2a2a2a;
    border-radius: 5px;
}

/* ======================================== */
/* EVITA RESPONSE-MODAL                    */
/* ======================================== */

#ai-response-content-area {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
    text-align: left;
    white-space: pre-wrap;
    color: #ccc;
    line-height: 1.6;
}

.modal-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
}

.modal-footer .button {
    background-color: #ffc107;
    color: #1a1a1a;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid #ffc107;
    font-size: 1rem;
    border-radius: 5px;
    text-decoration: none;
}

.modal-footer .button:hover {
    background-color: #ffca2c;
    border-color: #ffca2c;
    transform: translateY(-1px);
}

/* Status-Text */
#silas-status {
    text-align: center;
    width: 100%;
    margin-top: 1rem;
    color: #ffc107;
    font-weight: 500;
}

/* ======================================== */
/* RESPONSIVE DESIGN                       */
/* ======================================== */

@media (max-width: 768px) {
    /* Silas Form Mobile */
    #silas-form {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    #silas-keyword-input {
        width: 100%;
        margin-bottom: 10px;
        border: 1px solid #444;
        border-radius: 7px;
        padding: 15px;
        font-size: 16px;
    }
    
    #add-keyword-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
        border: 1px solid #ffc107;
        border-radius: 7px;
        font-size: 1.1rem;
        min-height: 50px;
    }

    /* Input Group Mobile */
    .ai-container .input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 20px;
        margin-top: 20px;
    }
    
    .ai-container .input-group label {
        text-align: center;
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0;
        font-size: 1rem;
    }
    
    .ai-container .custom-select {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        min-height: 50px;
    }

    /* Keyword List Mobile */
    .keyword-list-container {
        padding: 20px;
        margin-top: 25px;
    }
    
    .keyword-list-container h4 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    #keyword-display-list {
        padding: 10px;
        max-height: 300px;
    }
    
    #keyword-display-list li {
        padding: 20px 15px;
        margin-bottom: 15px;
        min-height: 70px;
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
    }
    
    #keyword-display-list li > div {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: flex-start !important;
    }
    
    #keyword-display-list li button {
        min-width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        border-radius: 8px !important;
        margin-left: 0 !important;
    }

    /* Button Controls Mobile */
    .keyword-list-controls {
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 18px 25px;
        font-size: 1.1rem;
        min-height: 55px;
    }

    /* Result Cards Mobile */
    .result-card {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .result-card h4 {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
    }
    
    .preview-btn {
        width: 100% !important;
        padding: 15px !important;
        font-size: 1rem !important;
        margin-top: 15px !important;
        min-height: 50px !important;
    }

    /* Download Button Mobile */
    #download-csv,
    #download-csv-dynamic {
        padding: 18px 20px !important;
        font-size: 1.1rem !important;
        min-height: 55px !important;
    }

    /* Preview Modal Mobile */
    body #silas-preview-modal .modal-content {
        width: 95vw !important;
        height: 95vh !important;
        border-radius: 5px !important;
    }
    
    body #silas-preview-modal #preview-content-area {
        padding: 15px !important;
    }
    
    body #silas-preview-modal .close-button {
        top: 10px !important;
        right: 15px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 1.3rem !important;
    }
}

/* ======================================== */
/* UTILITY CLASSES                         */
/* ======================================== */

.performance-tip .ai-container,
.performance-tip .keyword-list-container {
    max-width: none !important;
    width: 100% !important;
}



