/**
 * ITA Massnahmen Online - Card Layout Styles
 * Version: 1.0.8 - Größere Feldhöhe (42px) für optimale Bedienbarkeit
 */

.ita-massnahmen-katalog {
    max-width: 98%;
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ita-katalog-header {
    border-bottom: 2px solid #dc2626;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.ita-katalog-header h1 {
    color: #dc2626;
    margin: 0 0 10px 0;
}

.ita-client-info h2 {
    margin: 10px 0 5px 0;
    font-size: 1.3em;
}

.ita-progress-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 6px;
}

.ita-progress-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.ita-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transition: width 0.5s ease;
}

.ita-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ita-stat-box {
    padding: 15px;
    background: white;
    border-radius: 6px;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.ita-stat-box.status-open { border-color: #64748b; }
.ita-stat-box.status-in-progress { border-color: #f59e0b; }
.ita-stat-box.status-completed { border-color: #10b981; }

.ita-stat-label {
    display: block;
    font-size: 0.9em;
    color: #64748b;
    margin-bottom: 5px;
}

.ita-stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #1e293b;
}

.ita-priority-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.ita-priority-box {
    padding: 15px;
    background: white;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid;
}

.ita-priority-box.priority-hoch { border-color: #dc2626; }
.ita-priority-box.priority-mittel { border-color: #f59e0b; }
.ita-priority-box.priority-niedrig { border-color: #10b981; }

.ita-priority-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.ita-priority-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
}

.ita-user-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.ita-user-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.ita-user-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #374151;
}

.ita-user-field label .required {
    color: #dc2626;
    font-size: 1.1em;
}

.ita-user-field input {
    width: 100%;
    padding: 10px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}

.ita-user-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ita-user-field input:invalid {
    border-color: #dc2626;
}

.ita-user-hint {
    display: block;
    color: #64748b;
    font-size: 0.85em;
    margin-top: 8px;
}

.ita-priority-section {
    margin-bottom: 30px;
}

.ita-priority-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0 0 12px 0;
}

.priority-hoch .ita-priority-header { background: #fef2f2; border-left: 4px solid #dc2626; }
.priority-mittel .ita-priority-header { background: #fffbeb; border-left: 4px solid #f59e0b; }
.priority-niedrig .ita-priority-header { background: #f0fdf4; border-left: 4px solid #10b981; }

.ita-priority-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
}

.priority-hoch .ita-priority-badge { background: #dc2626; }
.priority-mittel .ita-priority-badge { background: #f97316; }
.priority-niedrig .ita-priority-badge { background: #10b981; }

.ita-priority-count {
    color: #64748b;
    font-size: 0.9em;
}

/* Card-Layout */
.ita-massnahmen-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ita-massnahmen-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.ita-massnahmen-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ita-massnahmen-card.status-completed {
    background: #f0fdf4;
    border-color: #86efac;
}

.ita-massnahmen-card.status-in_progress {
    background: #fffbeb;
    border-color: #fed7aa;
}

.ita-massnahmen-card.status-open {
    background: #fef2f2;
    border-color: #fecaca;
}

/* Card Header */
.ita-card-header {
    padding: 12px;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}

.ita-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.85em;
}

.ita-priority-indicator {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75em;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ita-priority-indicator.priority-hoch {
    background: #dc2626;
}

.ita-priority-indicator.priority-mittel {
    background: #f97316;
}

.ita-priority-indicator.priority-niedrig {
    background: #10b981;
}

.ita-card-number {
    font-weight: 600;
    color: #475569;
}

.ita-card-divider {
    color: #cbd5e1;
}

.ita-card-bereich {
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.ita-card-title {
    font-size: 1em;
    line-height: 1.2;
    margin-bottom: 4px;
    color: #1e293b;
}

.ita-card-question {
    margin-top: 4px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    color: #64748b;
    font-size: 0.8em;
    font-style: italic;
    line-height: 1.3;
}

.ita-card-timeframe {
    margin-top: 6px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
    font-size: 0.85em;
    color: #475569;
    line-height: 1.3;
}

/* Behebungsempfehlung */
.ita-card-recommendation {
    padding: 10px 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 2px solid #e2e8f0;
}

.ita-recommendation-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #1e40af;
}

.ita-recommendation-icon {
    font-size: 1em;
    flex-shrink: 0;
}

.ita-recommendation-header strong {
    font-size: 0.9em;
    line-height: 1.2;
}

.ita-recommendation-content {
    padding: 8px 10px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
    line-height: 1.15;
    color: #475569;
    font-size: 0.85em;
    white-space: pre-line;
}

/* Bearbeitungsfelder */
.ita-card-fields {
    padding: 12px;
}

.ita-field-row {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.ita-field-row:last-child {
    margin-bottom: 0;
}

.ita-field-row:first-child {
    grid-template-columns: 0.95fr 1.35fr 0.85fr;
}

.ita-field-col label,
.ita-field-full label {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
    color: #374151;
    font-size: 0.8em;
    line-height: 1.1;
}

.ita-textarea-wrapper {
    position: relative;
}

.ita-char-counter {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.7em;
    color: #64748b;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ita-char-counter.warning {
    color: #f59e0b;
    background: rgba(254, 243, 199, 0.95);
}

.ita-char-counter.danger {
    color: #dc2626;
    font-weight: 600;
    background: rgba(254, 226, 226, 0.95);
}

.ita-editable-field {
    width: 100%;
    height: 42px;
    padding: 10px 6px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.2s ease;
    line-height: 1.3;
    box-sizing: border-box;
    vertical-align: middle;
}

.ita-editable-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ita-editable-field:hover {
    border-color: #94a3b8;
}

textarea.ita-editable-field {
    resize: vertical;
    height: auto;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.35;
    padding: 6px 8px;
}

.ita-status-select {
    font-weight: 600;
    height: 42px;
    padding: 10px 6px;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1.3;
    box-sizing: border-box;
}

/* Status-Farben für Cards */
.ita-massnahmen-card.status-open .ita-status-select {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #dc2626;
}

.ita-massnahmen-card.status-in_progress .ita-status-select {
    background-color: #fed7aa;
    color: #9a3412;
    border-color: #f97316;
}

.ita-massnahmen-card.status-completed .ita-status-select {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.ita-status-select option[value="open"] {
    background-color: #fee2e2;
    color: #991b1b;
}

.ita-status-select option[value="in_progress"] {
    background-color: #fed7aa;
    color: #9a3412;
}

.ita-status-select option[value="completed"] {
    background-color: #d1fae5;
    color: #065f46;
}

.ita-auto-fill-hint {
    display: block;
    color: #3b82f6;
    font-size: 0.7em;
    margin-top: 3px;
    font-style: italic;
    line-height: 1.2;
}

/* Auto-gefüllte Datumsfelder */
.ita-beheben-bis-field[data-auto-filled="true"] {
    background-color: #eff6ff;
    border-color: #3b82f6;
    transition: all 0.3s ease;
}

.ita-beheben-bis-field[data-auto-filled="true"]:hover,
.ita-beheben-bis-field[data-auto-filled="true"]:focus {
    background-color: #fff;
    border-color: #3b82f6;
}

.ita-save-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #10b981;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    font-weight: 600;
    font-size: 14px;
}

.ita-save-feedback.error {
    background: #dc2626;
}

.ita-save-feedback:before {
    content: '✓ ';
    font-size: 16px;
}

.ita-save-feedback.error:before {
    content: '✗ ';
}

@media (max-width: 1200px) {
    .ita-field-row:first-child {
        grid-template-columns: 1fr;
    }

    .ita-card-header {
        padding: 15px;
    }

    .ita-card-fields {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .ita-massnahmen-katalog {
        padding: 10px;
        max-width: 100%;
    }

    .ita-user-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ita-priority-header {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ita-massnahmen-cards {
        gap: 12px;
    }

    .ita-massnahmen-card:hover {
        transform: none;
    }

    .ita-card-header {
        padding: 10px;
    }

    .ita-card-title {
        font-size: 0.95em;
    }

    .ita-card-recommendation {
        padding: 10px;
    }

    .ita-recommendation-content {
        font-size: 0.8em;
        padding: 8px 10px;
        line-height: 1.4;
    }

    .ita-card-fields {
        padding: 10px;
    }

    .ita-field-row {
        gap: 10px;
        margin-bottom: 10px;
    }

    .ita-field-row:first-child {
        grid-template-columns: 1fr;
    }

    .ita-editable-field {
        padding: 7px 8px;
        font-size: 0.85em;
    }

    textarea.ita-editable-field {
        min-height: 60px;
    }

    .ita-field-col label,
    .ita-field-full label {
        font-size: 0.8em;
        margin-bottom: 4px;
    }
}
