/* === Wrapper === */
.ki-app-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #fff;
    line-height: 1.6;
}

/* === Header === */
.ki-app-header {
    text-align: center;
    margin-bottom: 30px;
}
.ki-app-header h2 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ki-app-header p {
    color: #aaa;
    font-size: 1rem;
    margin: 0;
}

/* === Form === */
.ki-app-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* === Button Loading === */
.ki-app-wrapper button.loading .btn-text {
    visibility: hidden !important;
}
.ki-app-wrapper button .btn-loader {
    display: none !important;
}
.ki-app-wrapper button.loading .btn-loader {
    display: block !important;
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ki-spin 0.8s linear infinite;
}
@keyframes ki-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Error === */
.ki-error {
    text-align: center;
    color: #ff6b6b;
    margin-top: 15px;
    font-weight: 500;
}
.ki-error.hidden { display: none; }

/* === Loading Text === */
.ki-loading {
    text-align: center;
    margin-top: 25px;
    font-size: 1.1rem;
    color: #00d4ff;
    animation: ki-pulse 1.5s ease-in-out infinite;
}
.ki-loading.hidden { display: none; }
@keyframes ki-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === Results Wrapper === */
.ki-results-wrapper {
    position: relative;
    margin-top: 30px;
}
.ki-results-wrapper.hidden { display: none; }

/* === Results Container === */
.ki-results {
    padding: 30px;
    padding-top: 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.8;
}

/* === Alle Texte in Results === */
.ki-results, .ki-results * {
    color: #ffffff !important;
}

/* === Überschriften === */
.ki-results h1, .ki-results h2, .ki-results h3, .ki-results h4 {
    color: #00d4ff !important;
    margin: 1.5em 0 0.5em 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    -webkit-text-fill-color: #00d4ff !important;
}
.ki-results h1 { font-size: 1.6rem; }
.ki-results h2 { font-size: 1.4rem; }
.ki-results h3 { font-size: 1.2rem; }

/* === Text === */
.ki-results p { margin: 0.8em 0; }
.ki-results strong, .ki-results b { color: #ffffff !important; font-weight: 700; }

/* === Listen === */
.ki-results ul, .ki-results ol { margin: 1em 0 1em 1.5em; }
.ki-results ul { list-style: disc; }
.ki-results ol { list-style: decimal; }
.ki-results li { margin-bottom: 8px; }

/* === Tabellen === */
.ki-results table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
}
.ki-results th {
    padding: 14px 16px;
    text-align: left;
    background: rgba(0, 212, 255, 0.25);
    color: #00d4ff !important;
    font-weight: 700;
    border-bottom: 2px solid rgba(0, 212, 255, 0.4);
}
.ki-results td {
    padding: 14px 16px;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ki-results tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.3);
}

/* === Links === */
.ki-results a { color: #00d4ff !important; text-decoration: underline; }
.ki-results a:hover { color: #7b2cbf !important; }

/* === E-Mail Section === */
.ki-email-section {
    margin-top: 25px;
    padding: 25px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}
.ki-email-section.hidden { display: none; }

.ki-email-form h4 {
    margin: 0 0 15px 0;
    color: #00d4ff;
    font-size: 1.2rem;
    -webkit-text-fill-color: #00d4ff;
}

.ki-email-input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ki-email-hint {
    margin: 12px 0 0 0;
    font-size: 0.85rem;
    color: #aaa;
}

/* === E-Mail Feedback === */
.ki-email-feedback {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}
.ki-email-feedback.hidden { display: none; }
.ki-email-feedback.success {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
    border: 1px solid rgba(0, 200, 83, 0.3);
}
.ki-email-feedback.error {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

/* === Responsive === */
@media (max-width: 600px) {
    .ki-app-wrapper { margin: 20px; padding: 25px; }
    .ki-app-header h2 { font-size: 1.5rem; }
    .ki-app-form, .ki-email-input-group { flex-direction: column; }
}
