/* ========================================
   ACA Branchen Adapter - Frontend Styles
   Mobile First Design
   ======================================== */

/* ========================================
   SELEKTOR (Standalone)
   ======================================== */

.aca-selektor {
    max-width: 800px; /* Breiter für lange Texte */
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aca-selektor__title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.aca-selektor__hinweis {
    margin: 0 0 1.5rem;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.aca-selektor__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aca-selektor__fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aca-selektor__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0; /* Verhindert Overflow */
}

.aca-selektor__field label {
    font-weight: 500;
    font-size: 0.95rem;
}

.aca-selektor__select {
    width: 100%; /* Wichtig für Container-Begrenzung */
    padding: 0.75rem;
    padding-bottom: 0.85rem; /* Extra Platz für g, y, p, q */
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    line-height: 1.5;
    min-height: 48px; /* Garantierte Mindesthöhe */
    box-sizing: border-box;
}

.aca-selektor__button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.aca-selektor__button:hover {
    opacity: 0.9;
}

.aca-selektor__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aca-selektor__message {
    padding: 0.75rem;
    margin-top: 1rem;
    border-radius: 4px;
    text-align: center;
}

.aca-selektor__message--success {
    background: #d4edda;
    color: #155724;
}

.aca-selektor__message--error {
    background: #f8d7da;
    color: #721c24;
}

/* Tablet & Desktop */
/* Tablet & Desktop - Bleibt STACKED wegen langer Texte */
@media (min-width: 768px) {
    .aca-selektor {
        max-width: 700px;
    }
    
    .aca-selektor__fields {
        /* Bleibt column */
        flex-direction: column;
    }
    
    .aca-selektor__button {
        width: auto;
        align-self: center;
        padding: 0.75rem 3rem;
        margin-top: 1rem;
    }
}

@media (min-width: 1024px) {
    .aca-selektor__button {
        width: auto; /* Auto-width nur auf Desktop */
        margin-top: 0;
        padding: 0.75rem 2rem;
        align-self: flex-end; /* Bottom-aligned mit fields */
    }
}

/* ========================================
   HUB
   ======================================== */

.aca-hub {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Kompakter Selektor im Hub */
.aca-hub__selektor-compact {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.aca-hub__selektor-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.aca-hub__selektor-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.aca-hub__selektor-edit {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.aca-hub__selektor-edit:hover {
    background: #555;
    color: #fff;
}

.aca-hub__selektor-form {
    margin-top: 1rem;
}

.aca-hub__selektor-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.aca-hub__select {
    padding: 0.5rem;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    min-width: 150px;
    line-height: 1.6; /* Fix für abgeschnittene Buchstaben */
}

.aca-hub__selektor-save {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.aca-hub__selektor-save:hover {
    opacity: 0.9;
}

.aca-hub__selektor-cancel {
    padding: 0.5rem 1rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.aca-hub__selektor-cancel:hover {
    background: #555;
    color: #fff;
}

.aca-hub__header {
    margin-bottom: 2rem;
    text-align: center;
}

.aca-hub__title {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Filter */
.aca-hub__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aca-hub__filter {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aca-hub__filter label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
}

.aca-hub__filter-select {
    padding: 0.6rem;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Blocks */
.aca-hub__block {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aca-hub__block-header {
    margin-bottom: 1.5rem;
}

.aca-hub__block-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.aca-hub__block-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.aca-hub__progress-label {
    font-weight: 500;
    font-size: 0.9rem;
}

.aca-hub__progress-bar {
    flex: 1;
    min-width: 150px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.aca-hub__progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.aca-hub__progress-text {
    font-size: 0.9rem;
    color: #666;
}

.aca-hub__load-more {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.aca-hub__load-more:hover {
    background: #555;
    color: #fff;
}

.aca-hub__empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #666;
}

/* ========================================
   FRAGE ITEM
   ======================================== */

.aca-frage {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    transition: box-shadow 0.2s;
}

.aca-frage:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.aca-frage__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.aca-frage__checkbox {
    flex-shrink: 0;
    padding-top: 0;
    display: flex;
    align-items: center;
}

.aca-checkbox {
    /* Force remove default styling - cross-browser */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -ms-appearance: none !important;
    
    /* Size - professionell */
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    
    /* Visual - dezenter unchecked state */
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    
    /* Behavior */
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    display: block;
    
    /* Remove margins */
    margin: 0;
    padding: 0;
}

/* Unchecked state - grauer Haken immer sichtbar */
.aca-checkbox::before {
    content: '';
    position: absolute;
    left: 6.5px;
    top: 2.5px;
    width: 6px;
    height: 11px;
    border: solid #ddd;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 1;
    transition: all 0.2s;
}

.aca-checkbox:hover {
    border-color: #999;
}

.aca-checkbox:hover::before {
    border-color: #bbb;
}

.aca-checkbox:checked {
    background: #88b441;
    border-color: #88b441;
}

/* Checked state - weißer Haken */
.aca-checkbox:checked::before {
    border-color: #fff;
}

.aca-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6.5px;
    top: 2.5px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.aca-frage__title-wrap {
    flex: 1;
    min-width: 0;
}

.aca-frage__title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.aca-frage__kategorien {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aca-frage__kategorie {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    background: #e8e8e8;
    border-radius: 12px;
    color: #555;
}

.aca-frage__wichtigkeit {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    position: relative;
}

.aca-tooltip-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: help;
}

.aca-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a243b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 1000;
    pointer-events: none;
}

.aca-tooltip-overlay:hover .aca-tooltip {
    display: block;
}

.aca-frage__wichtigkeit--essentiell {
    background: #88b441;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
}

.aca-frage__wichtigkeit--empfohlen {
    background: #dfe6e9;
    color: #2d3436;
    font-weight: 600;
}

.aca-frage__wichtigkeit--optional {
    background: #f5f5f5;
    color: #999;
    font-weight: 500;
}

.aca-frage__content {
    padding-left: 2rem;
}

.aca-frage__frage {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.aca-frage__hinweis {
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.aca-frage__antwort-toggle {
    margin-bottom: 1rem;
}

.aca-frage__antwort-toggle summary {
    padding: 0.75rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    list-style: none;
}

.aca-frage__antwort-toggle summary::-webkit-details-marker {
    display: none;
}

.aca-frage__antwort-toggle summary::before {
    content: '▶ ';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
}

.aca-frage__antwort-toggle[open] summary::before {
    transform: rotate(90deg);
}

.aca-frage__antwort {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    line-height: 1.6;
}

.aca-frage__video {
    margin-bottom: 1rem;
}

.aca-frage__video iframe {
    max-width: 100%;
    border-radius: 4px;
}

.aca-frage__pdf {
    margin-top: 1rem;
}

.aca-frage__pdf-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background 0.2s;
}

.aca-frage__pdf-link:hover {
    background: #e8e8e8;
}

/* Selbstpräsentation - bessere Lesbarkeit */
.aca-sp-text {
    line-height: 1.7;
}

.aca-sp-text p {
    margin-bottom: 1.2em;
}

/* ========================================
   TEASER (Preview + Full)
   ======================================== */

/* Teaser Preview (Marketing) */
.aca-teaser-preview {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aca-teaser__title {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.aca-teaser__list {
    margin-bottom: 2rem;
}

.aca-teaser__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #ddd;
}

.aca-teaser__item-title {
    font-weight: 500;
}

.aca-teaser__badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.aca-teaser__badge--essentiell {
    background: #fef3c7;
    color: #92400e;
}

.aca-teaser__badge--empfohlen {
    background: #dbeafe;
    color: #1e40af;
}

.aca-teaser__badge--optional {
    background: #e5e7eb;
    color: #374151;
}

.aca-teaser__cta {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.aca-teaser__count {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #666;
}

.aca-teaser__button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #88b441;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.aca-teaser__button:hover {
    background: #6d9033;
}

.aca-teaser__button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Teaser Full (Mini-Hub) */
.aca-teaser-full {
    max-width: 1000px;
    margin: 2rem auto;
}

.aca-teaser-full__title {
    margin: 0 0 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.aca-teaser-full__selektor {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.aca-teaser-full__current {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aca-teaser-full__edit,
.aca-teaser-full__save {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.aca-teaser-full__edit:hover,
.aca-teaser-full__save:hover {
    background: #555;
    color: #fff;
}

.aca-teaser-full__form {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.aca-teaser-full__select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.aca-teaser-full__empty {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.aca-teaser-full__load-more {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 2rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.aca-teaser-full__load-more:hover {
    background: #e5e7eb;
}

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

@media (max-width: 767px) {
    .aca-frage__header {
        flex-wrap: wrap;
    }
    
    .aca-frage__wichtigkeit {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .aca-frage__content {
        padding-left: 0;
    }
    
    .aca-hub__filters {
        flex-direction: column;
    }
    
    .aca-hub__filter {
        min-width: 100%;
    }
}

@media (min-width: 768px) {
    .aca-hub {
        padding: 2rem;
    }
    
    .aca-hub__block {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .aca-hub__title {
        font-size: 2.5rem;
    }
}

/* ========================================
   FALLSTUDIEN
   ======================================== */

/* Badges */
.aca-fs-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    vertical-align: middle;
    letter-spacing: 0.2px;
}

.aca-fs-badge--fremd {
    background: #88b441;
    color: white;
}

.aca-fs-badge--bezogen {
    background: #1a243b;
    color: white;
}

/* Sections */
.aca-fs-section {
    margin-bottom: 20px;
}

.aca-fs-section__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a243b;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #88b441;
    display: inline-block;
}

.aca-fs-section__content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.aca-fs-section__content ul {
    padding-left: 18px;
    margin: 8px 0;
}

.aca-fs-section__content li {
    margin-bottom: 4px;
}

/* Zahlen & Fakten: preformatted to preserve table alignment */
.aca-fs-pre {
    background: #f7f8fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Separator between branchenfremd and branchenbezogen groups */
.aca-fs-separator {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    letter-spacing: 1px;
    padding: 12px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
}

/* Block Widgets (Framework-Toolbox + Fallstudien-Coach side by side) */
.aca-block-widgets {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Fallstudien Actions (Copy Case) */
.aca-fs-actions {
    margin-bottom: 14px;
}
