/**
 * AI UseCase Assessment - BEM Styles (SLIM)
 * Version: 3.0.0-BEM-SLIM
 * NUR Klassennamen-Umbenennung - KEINE Style-Änderungen, KEINE Erweiterungen!
 * 1:1 Konvertierung von usecase.css nach BEM
 */

/* === CONTAINER SETTINGS - Volle Breite durch negative Margins === */
.ai-usecase__container {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    background: white !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    position: relative !important;
}

/* Reset für alle Kinder */
.ai-usecase__container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === HEADER - EXAKT GLEICH WIE CONTENT === */
.ai-usecase__header {
    background: linear-gradient(135deg, #196297 0%, #2475b3 100%) !important;
    color: white !important;
    padding: 30px 40px !important;
    text-align: center !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    border-radius: 15px 15px 0 0 !important;
    box-sizing: border-box !important;
}

/* === CONTENT - Identische Werte wie Header === */
.ai-usecase__content {
    padding: 40px !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Auf großen Bildschirmen - beide gleich */
@media (min-width: 1920px) {
    .ai-usecase__header,
    .ai-usecase__content {
        padding: 50px 80px !important;
        max-width: 1800px !important;
    }
}

/* === SECTIONS === */
.ai-usecase__section {
    margin-bottom: 40px;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.ai-usecase__section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Section Variants */
.ai-usecase__section--save-load {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 6px solid #17a2b8;
}

.ai-usecase__section--criteria {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-left: 6px solid #ff6b6b;
}

.ai-usecase__section--evaluation {
    background: linear-gradient(135deg, #f0fff4 0%, #e0ffe0 100%);
    border-left: 6px solid #51cf66;
}

.ai-usecase__section--results {
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f0ff 100%);
    border-left: 6px solid #4facfe;
}

/* === START: FINALIZED BUTTON STYLES (PMPS STANDARD) === */

:root {
  --ai-primary:   #196297;
  --ai-primary-light: #2a7ec0;
  --ai-success:   #059669;
  --ai-success-light: #34d399;
  --ai-secondary: #475569;
  --ai-secondary-light: #64748b;
  --ai-danger:    #dc2626;
  --ai-danger-light: #ef4444;
}

/* Grundform */
.ai-usecase__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* Farbvarianten */
.ai-usecase__btn--primary   { background: linear-gradient(135deg,var(--ai-primary),var(--ai-primary-light)); }
.ai-usecase__btn--success   { background: linear-gradient(135deg,var(--ai-success),var(--ai-success-light)); }
.ai-usecase__btn--secondary { background: linear-gradient(135deg,var(--ai-secondary),var(--ai-secondary-light)); }
.ai-usecase__btn--danger    { background: linear-gradient(135deg,var(--ai-danger),var(--ai-danger-light)); }

/* Hover-Effekt (Mouse-over) */
.ai-usecase__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

/* Active-Zustand */
.ai-usecase__btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Fokus (Tastatur) */
.ai-usecase__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Gruppe */
.ai-usecase__btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* SVG-Icons */
.btn-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: middle;
}
.btn-icon--end {
  margin-right: 0;
  margin-left: 8px;
}

/* === END: FINALIZED BUTTON STYLES === */

/* === TABLES - CI-konform === */
.ai-usecase__table {
    width: 100% !important;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    table-layout: auto !important;
}

/* Header mit CI-Blau */
.ai-usecase__table thead {
    background: linear-gradient(135deg, #196297 0%, #2475b3 100%) !important;
}

.ai-usecase__table thead th {
    color: white !important;
    padding: 15px !important;
    font-weight: 600 !important;
    text-align: left !important;
}

/* Footer mit CI-Blau */
.ai-usecase__table tfoot {
    background: linear-gradient(135deg, #196297 0%, #2475b3 100%) !important;
}

.ai-usecase__table tfoot th {
    color: white !important;
    padding: 15px !important;
    font-weight: 600 !important;
    text-align: left !important;
}

.ai-usecase__table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

/* Hover nur für tbody */
.ai-usecase__table tbody tr:hover {
    background: #f8f9fa;
    transition: background 0.2s ease;
}

/* Breitere Use-Case-Spalte */
#evaluationTable th:first-child,
#evaluationTable td:first-child {
    width: 280px !important;
    min-width: 280px !important;
}

/* === INPUTS === */
.ai-usecase__input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.ai-usecase__input:focus {
    outline: none;
    border-color: #196297;
    box-shadow: 0 0 0 3px rgba(25, 98, 151, 0.1);
}

input[type="number"].ai-usecase__input {
    width: 80px;
    text-align: center;
}

select.ai-usecase__input {
    cursor: pointer;
    background: white;
}

/* === WEIGHT SUM INFO === */
.ai-usecase__weight-sum-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.ai-usecase__weight-sum-value {
    font-size: 1.3em;
    color: #2c3e50;
}

#weightWarning {
    color: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === SCALE INFO === */
.ai-usecase__scale-info {
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f2 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 5px solid #196297;
}

.ai-usecase__scale-info h3 {
    color: #196297;
    margin-bottom: 15px;
}

.ai-usecase__scale-info p {
    margin-bottom: 10px;
    color: #495057;
    line-height: 1.6;
}

/* === VALIDATION WARNING === */
.ai-usecase__validation-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    display: none;
}

.ai-usecase__validation-warning.show {
    display: block;
}

/* === ADD BUTTONS === */
.ai-usecase__add-criterion-btn,
.ai-usecase__add-usecase-btn {
    background: linear-gradient(135deg, #196297 0%, #2475b3 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.ai-usecase__add-criterion-btn:hover,
.ai-usecase__add-usecase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(25, 98, 151, 0.3);
}

/* === CALCULATE BUTTON === */
.ai-usecase__calculate-btn {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
}

.ai-usecase__calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(86, 171, 47, 0.3);
}

/* === REMOVE BUTTON === */
.ai-usecase__remove-btn {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.ai-usecase__remove-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* === PRIORITY BADGES === */
.ai-usecase__priority-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.ai-usecase__priority-badge--hoch {
    background: #d4edda;
    color: #155724;
}

.ai-usecase__priority-badge--mittel {
    background: #fff3cd;
    color: #856404;
}

.ai-usecase__priority-badge--niedrig {
    background: #f8d7da;
    color: #721c24;
}

/* === QUADRANT BADGES === */
.ai-usecase__quadrant-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.ai-usecase__quadrant-badge--quick-wins {
    background: #d4edda;
    color: #155724;
}

.ai-usecase__quadrant-badge--strategisch {
    background: #d1ecf1;
    color: #0c5460;
}

.ai-usecase__quadrant-badge--fill-ins {
    background: #fff3cd;
    color: #856404;
}

.ai-usecase__quadrant-badge--vermeiden {
    background: #f8d7da;
    color: #721c24;
}

/* === MATRIX CONTAINER === */
.ai-usecase__matrix-container {
    width: 100% !important;
    max-width: 1400px !important;
    height: 700px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    padding: 30px !important;
    margin: 30px auto !important;
    position: relative !important;
}

/* Auf großen Bildschirmen noch größer */
@media (min-width: 1920px) {
    .ai-usecase__matrix-container {
        height: 800px !important;
        max-width: 1600px !important;
    }
}

/* Matrix Grid */
.ai-usecase__matrix-grid {
    width: 100%;
    height: 100%;
    position: relative;
    background: 
        linear-gradient(to right, 
            rgba(40,167,69,0.15) 0%, 
            rgba(40,167,69,0.15) 50%, 
            rgba(255,193,7,0.15) 50%, 
            rgba(255,193,7,0.15) 100%),
        linear-gradient(to top, 
            rgba(220,53,69,0.15) 0%, 
            rgba(220,53,69,0.15) 50%, 
            rgba(40,167,69,0.15) 50%, 
            rgba(40,167,69,0.15) 100%);
    border: 2px solid #333;
    border-radius: 8px;
}

/* === USE CASE LEGEND === */
.ai-usecase__legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ai-usecase__legend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.ai-usecase__legend-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* === ERROR MESSAGES === */
.ai-usecase__error {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #f87171;
    color: #7f1d1d;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.ai-usecase__error h3 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.ai-usecase__error .button {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 15px;
}

/* === LOADING SPINNER === */
.ai-usecase__loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #196297;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === AUTO-SAVE INDICATOR === */
.ai-usecase__auto-save-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.ai-usecase__auto-save-indicator.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.ai-usecase__save-status {
    font-size: 0.9em;
    color: #28a745;
    font-weight: 600;
}

/* === SAVE STATUS MESSAGE === */
#saveStatus {
    margin-top: 10px;
    font-weight: 600;
    text-align: center;
    display: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .ai-usecase__container {
        width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    .ai-usecase__header,
    .ai-usecase__content {
        padding: 15px !important;
        max-width: 100% !important;
    }
    
    .ai-usecase__header {
        border-radius: 0 !important;
    }

    .ai-usecase__table {
        font-size: 0.9em !important;
        display: block !important;
        overflow-x: auto !important;
    }

    input[type="number"].ai-usecase__input {
        width: 60px !important;
        padding: 6px !important;
    }

    .ai-usecase__btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .ai-usecase__matrix-container {
        height: 400px !important;
        padding: 15px !important;
    }

    .ai-usecase__header h1 {
        font-size: 1.8em !important;
    }
    
    #evaluationTable th:first-child,
    #evaluationTable td:first-child {
        min-width: 200px !important;
        width: auto !important;
    }
}

/* Tablet-Anpassungen */
@media (min-width: 769px) and (max-width: 1199px) {
    .ai-usecase__header,
    .ai-usecase__content {
        max-width: 100% !important;
        padding: 30px !important;
    }
    
    .ai-usecase__matrix-container {
        height: 600px !important;
    }
}
/* === BUTTON-FARBEN-OVERRIDES FÜR PMPS-CI (SCOPED MIT CONTAINER) === */
/* Diese Regeln überschreiben das Theme-CSS gezielt nur im Modulbereich */

.ai-usecase__container .btn--primary {
  background: linear-gradient(135deg, #196297, #2a7ec0) !important;
  color: #fff !important;
}

.ai-usecase__container .btn--success {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: #fff !important;
}

.ai-usecase__container .btn--secondary {
  background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
  color: #fff !important;
}

.ai-usecase__container .btn--danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: #fff !important;
}

/* Optional: Hover-Effekte für visuelles Feedback */
.ai-usecase__container .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}
