/* UI Improvements - Non-breaking enhancements */
/* Diese Datei überschreibt KEINE bestehenden Styles */

/* ===== LOADING STATES ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Loading States für alle Buttons */
button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Avoid duplicate spinners: rely on .btn-spinner element, not ::after */
button.loading,
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

button.loading::after,
.btn.loading::after {
    content: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    pointer-events: auto;
    border-left: 4px solid #06b6d4;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #06b6d4;
}

/* ===== FOCUS STATES ===== */
.focus-enhanced:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
}

.focus-enhanced:focus-visible {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* Enhanced Focus States für alle Eingabefelder */
input:focus,
textarea:focus,
select:focus,
button:focus,
.btn:focus,
a:focus,
[tabindex]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
    border-color: #0891b2;
}

/* Focus States für Form Controls */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
    border-color: #0891b2;
    background-color: #f8fafc;
}

/* Focus States für Buttons */
button:focus,
.btn:focus,
[role="button"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
    transform: translateY(-1px);
}

/* Focus States für Links */
a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
    border-radius: 4px;
}

/* Focus States für Navigation */
nav a:focus,
.nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
    border-radius: 4px;
}

/* Focus States für Cards */
.card:focus,
.bg-white:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Enhanced Hover Effects für alle Cards und interaktive Elemente */
.card,
.bg-white,
.shadow-sm,
.shadow-lg {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.bg-white:hover,
.shadow-sm:hover,
.shadow-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hover Effects für Buttons */
button,
.btn,
[role="button"] {
    transition: all 0.2s ease;
}

button:hover,
.btn:hover,
[role="button"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hover Effects für Links */
a {
    transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
    transform: translateY(-1px);
}

/* Hover Effects für Navigation Items */
nav a,
.nav-link {
    transition: all 0.2s ease;
}

nav a:hover,
.nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 2.5rem;
    width: 6rem;
}

/* ===== PROGRESS INDICATORS ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #0891b2;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== ERROR STATES ===== */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.25rem;
}

/* ===== SUCCESS STATES ===== */
.input-success {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.input-success:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.success-message::before {
    content: "✅";
    margin-right: 0.25rem;
}

/* ===== PAGE TRANSITIONS ===== */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .hover-lift:hover {
        transform: none; /* Disable hover effects on mobile */
    }
}

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

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .skeleton {
        background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
        background-size: 200% 100%;
    }
    
    .progress-bar {
        background-color: #374151;
    }
}
