/**
 * RDCC Event Suite — Zentrale Styles
 * Block 3: Darstellung & Konsistenz
 */

/* =============================================================================
   FEHLERMARKIERUNG
   ============================================================================= */

.field-error {
    border-color: #d32f2f !important;
    background-color: #ffebee !important;
}

.field-error:focus {
    outline-color: #d32f2f !important;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2) !important;
}

.field-error-msg {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 4px;
    min-height: 1.2em;
}

/* =============================================================================
   LADESPINNER
   ============================================================================= */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e4de;
    border-top-color: #9e1d2c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Inline-Spinner (kleiner, für Buttons) */
.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* =============================================================================
   TOAST-BENACHRICHTIGUNGEN
   ============================================================================= */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 280px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #4caf50;
    color: #fff;
}

.toast-error {
    background: #f44336;
    color: #fff;
}

.toast-info {
    background: #2196f3;
    color: #fff;
}

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

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    /* Tabellen horizontal scrollbar */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 16px 12px;
    }
    
    input, select, textarea {
        font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
    }
    
    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        min-width: auto;
    }
}

/* =============================================================================
   BARRIEREFREIHEIT
   ============================================================================= */

/* Fokus-Indikatoren */
*:focus-visible {
    outline: 2px solid #9e1d2c;
    outline-offset: 2px;
}

/* Skip-Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #9e1d2c;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen-Reader-only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =============================================================================
   UTILITY-KLASSEN
   ============================================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #6b645c; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
