/**
 * DRV Admin UX Enhancements
 * Version: 1.0.0
 * Datum: 2025-12-17
 * 
 * Verbessert:
 * - Loading States
 * - Mobile Responsiveness
 * - Touch-friendly Buttons
 * - Better Visual Hierarchy
 */

/* ========================================
   LOADING STATES & SKELETONS
   ======================================== */

.drv-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.drv-loading-content {
    text-align: center;
}

.drv-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.drv-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.drv-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.drv-skeleton-heading {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

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

/* ========================================
   DISABLED STATES
   ======================================== */

.drv-btn:disabled,
.drv-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.drv-form-group.disabled input,
.drv-form-group.disabled select,
.drv-form-group.disabled textarea {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Responsiver Admin-Header */
    .drv-admin-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start !important;
    }
    
    .drv-admin-header h2 {
        font-size: 20px;
    }
    
    .drv-admin-header .drv-btn {
        width: 100%;
    }
    
    /* Filter-Buttons stack vertical */
    .drv-admin-filter {
        flex-direction: column;
        gap: 8px;
    }
    
    .drv-admin-filter-btn {
        width: 100%;
        text-align: left;
    }
    
    /* Tabellen horizontal scrollbar */
    .drv-admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding: 0 20px;
    }
    
    .drv-admin-table {
        min-width: 600px;
    }
    
    /* Form Rows stack */
    .drv-form-row {
        flex-direction: column !important;
    }
    
    .drv-form-group.drv-half {
        width: 100% !important;
    }
    
    /* Modals full-width */
    .drv-modal-content {
        width: 95vw !important;
        max-width: none !important;
        margin: 20px;
    }
    
    /* Dropdown-Actions vergroessern */
    .drv-actions-dropdown-menu {
        min-width: 200px;
    }
    
    .drv-actions-dropdown-item {
        padding: 14px 16px;
        font-size: 16px;
    }
}

/* Touch-friendly auf Tablets */
@media (max-width: 1024px) {
    /* Mindestgroesse fuer Touch-Targets (44x44px iOS Standard) */
    .drv-btn,
    .drv-admin-filter-btn,
    .drv-actions-btn,
    .drv-status-badge {
        min-height: 44px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    /* Groessere Dropdowns */
    .drv-actions-dropdown-item {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    /* Groessere Checkboxen/Radios */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   VISUAL HIERARCHY IMPROVEMENTS
   ======================================== */

/* PrimÃ¤re Aktionen hervorheben */
.drv-btn-primary {
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: all 0.2s;
}

.drv-btn-primary:hover {
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.drv-btn-primary:active {
    transform: translateY(0);
}

/* GefÃ¤hrliche Aktionen deutlicher */
.drv-btn-danger {
    background: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.drv-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* Status-Badges lesbarer */
.drv-status-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    padding: 6px 12px;
}

/* ========================================
   FOCUS STATES (Accessibility)
   ======================================== */

.drv-btn:focus,
.drv-admin-filter-btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   TABLE IMPROVEMENTS
   ======================================== */

/* Hover auf Zeilen */
.drv-admin-table tbody tr {
    transition: background-color 0.15s;
}

.drv-admin-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Sticky Header bei langem Scrollen */
.drv-admin-table-sticky thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Leere States */
.drv-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.drv-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.drv-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.drv-empty-state-text {
    font-size: 14px;
    margin-bottom: 24px;
}

/* ========================================
   CONFIRMATION DIALOGS
   ======================================== */

.drv-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
}

.drv-confirm-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

.drv-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.drv-confirm-icon.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.drv-confirm-icon.danger {
    background: #fee2e2;
    color: #ef4444;
}

.drv-confirm-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    color: #111827;
}

.drv-confirm-message {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.drv-confirm-actions {
    display: flex;
    gap: 12px;
}

.drv-confirm-actions .drv-btn {
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   QUICK ACTIONS BAR
   ======================================== */

.drv-quick-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.drv-quick-action-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    white-space: nowrap;
}

.drv-quick-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.drv-quick-action-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ========================================
   PROGRESS INDICATORS
   ======================================== */

.drv-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.drv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
}

.drv-progress-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    text-align: right;
}

/* ========================================
   COLLAPSIBLE SECTIONS
   ======================================== */

.drv-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.drv-collapsible-header:hover {
    background: #f3f4f6;
}

.drv-collapsible-header.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.drv-collapsible-icon {
    transition: transform 0.3s;
}

.drv-collapsible-header.active .drv-collapsible-icon {
    transform: rotate(180deg);
}

.drv-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.drv-collapsible-content.active {
    max-height: 1000px;
    padding: 16px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .drv-admin-nav,
    .drv-admin-filter,
    .drv-actions-dropdown,
    .drv-btn {
        display: none !important;
    }
    
    .drv-admin-table {
        border: 1px solid #000;
    }
    
    .drv-admin-table th,
    .drv-admin-table td {
        border: 1px solid #000;
        padding: 8px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.drv-hidden { display: none !important; }
.drv-invisible { visibility: hidden !important; }
.drv-pointer { cursor: pointer; }
.drv-text-center { text-align: center; }
.drv-text-right { text-align: right; }
.drv-mt-4 { margin-top: 16px; }
.drv-mb-4 { margin-bottom: 16px; }
.drv-p-4 { padding: 16px; }
