/**
 * Advanced User Management Ultimate - Frontend Styles
 * Version: 6.0.2
 * Author: Toker Telecom
 */

/* Frontend User Management Styles */
.umf-dashboard {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.umf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.umf-header h2 {
    margin: 0;
    color: #333;
}

.umf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}

/* Dashicons im Frontend aktivieren */
.dashicons {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    font-family: dashicons;
    text-decoration: inherit;
    font-weight: normal;
    font-style: normal;
    vertical-align: middle;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.umf-btn:hover {
    background: #e0e0e0;
}

.umf-btn.primary {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.umf-btn.primary:hover {
    background: #005d87;
}

.umf-btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.umf-btn.small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Noch kleinere Buttons für die Tabelle */
.umf-table .umf-btn.small {
    padding: 4px 8px;
    font-size: 11px;
    min-width: 30px;
}

.umf-table .umf-btn.small .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    margin: 0;
}

/* Icon-only Buttons */
.umf-table .umf-btn.small:has(.dashicons:only-child) {
    padding: 4px;
}

/* Statistiken - Kompakter */
.umf-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.umf-stat-box {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.umf-stat-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.umf-stat-label {
    color: #666;
    font-size: 13px;
}

/* Tabs */
.umf-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.umf-tab-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #e0e0e0;
    align-items: stretch;
}

.umf-tab-nav li {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.umf-tab-nav li:hover {
    background: #f8f8f8;
}

.umf-tab-nav li.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: bold;
}

/* Live-Suche Tab - Suchfeld Design */
.umf-search-tab {
    flex: 1;
    padding: 0 !important;
    display: flex;
    align-items: center;
    cursor: default !important;
}

.umf-search-tab:hover {
    background: transparent !important;
}

.umf-live-search-input {
    width: 100%;
    border: 1px solid #ddd;
    background: #f5f5f5;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    border-radius: 4px;
    margin: 8px 15px;
}

.umf-live-search-input:focus {
    background: #fff;
    border-color: #0073aa;
}

.umf-tab-content {
    display: none;
    padding: 20px;
}

.umf-tab-content.active {
    display: block;
}

/* Tabelle */
.umf-table-wrapper {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.umf-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 1200px;
}

.umf-table th,
.umf-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.umf-table th {
    background: #f8f8f8;
    font-weight: bold;
    color: #333;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.umf-table tr:hover {
    background: #f8f8f8;
}

/* Spaltenbreiten optimiert */
.umf-table th:nth-child(1),
.umf-table td:nth-child(1) { width: 60px; } /* ID - schmaler */
.umf-table th:nth-child(2),
.umf-table td:nth-child(2) { width: 265px; min-width: 240px; white-space: normal; } /* Firma - breiter */
.umf-table th:nth-child(3),
.umf-table td:nth-child(3) { width: 75px; } /* Name - schmaler */
.umf-table th:nth-child(4),
.umf-table td:nth-child(4) { width: 85px; } /* E-Mail - schmaler */
.umf-table th:nth-child(5),
.umf-table td:nth-child(5) { width: 70px; } /* Vodafone - schmaler */
.umf-table th:nth-child(6),
.umf-table td:nth-child(6) { width: 70px; } /* VF SoHo - schmaler */
.umf-table th:nth-child(7),
.umf-table td:nth-child(7) { width: 70px; } /* Freenet - schmaler */
.umf-table th:nth-child(8),
.umf-table td:nth-child(8) { width: 70px; } /* ayyildiz - schmaler */
.umf-table th:nth-child(9),
.umf-table td:nth-child(9) { width: 65px; } /* yourfone - schmaler */
.umf-table th:nth-child(10),
.umf-table td:nth-child(10) { width: 65px; } /* 1&1 - schmaler */
.umf-table th:nth-child(11),
.umf-table td:nth-child(11) { width: 65px; } /* Energy - schmaler */
.umf-table th:nth-child(12),
.umf-table td:nth-child(12) { width: 70px; } /* Aktionen - schmaler */

/* Kompaktere Darstellung */
.umf-table td {
    font-size: 13px;
}

/* Aktionen-Spalte */
.umf-table td:last-child {
    white-space: nowrap;
}

.umf-table td:last-child button {
    margin-right: 5px;
    display: inline-block;
}

/* Badges */
.umf-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.umf-badge.type-haendler {
    background: #e8f4f8;
    color: #0073aa;
}

.umf-badge.type-mitarbeiter {
    background: #f3e8ff;
    color: #8b5cf6;
}

.umf-badge.type-kunde {
    background: #e8f5e9;
    color: #00a32a;
}

.umf-badge.status-aktiv {
    background: #d4edda;
    color: #155724;
}

.umf-badge.status-inaktiv {
    background: #fff3cd;
    color: #856404;
}

.umf-badge.status-gesperrt {
    background: #f8d7da;
    color: #721c24;
}

/* Formulare */
.umf-form-group {
    margin-bottom: 20px;
}

.umf-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.umf-form-group input,
.umf-form-group select,
.umf-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.umf-form-group input:focus,
.umf-form-group select:focus,
.umf-form-group textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.umf-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.umf-form-row .umf-form-group {
    flex: 1;
    margin-bottom: 0;
}

.umf-field-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.required {
    color: #dc3545;
}

/* Form Tabs */
.umf-form-tabs {
    margin-bottom: 30px;
}

.umf-form-tab-nav {
    display: flex;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 2px solid #e0e0e0;
}

.umf-form-tab-nav li {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.umf-form-tab-nav li.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: bold;
}

.umf-form-tab-content {
    display: none;
}

.umf-form-tab-content.active {
    display: block;
}

/* Provider Grid */
.umf-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.umf-provider-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f8f8;
}

.umf-provider-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Suchbereich */
.umf-search-form {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Container für volle Breite */
.umf-user-list,
.umf-create-form,
.umf-edit-form,
.umf-search,
.umf-profile {
    max-width: 100%;
}

/* Pagination */
.umf-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.umf-page-link {
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
}

.umf-page-link:hover {
    background: #f0f0f0;
}

.umf-page-link.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Loading */
.umf-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Notices */
.umf-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.umf-notice.error {
    background: #fef1f1;
    border-color: #dc3545;
    color: #721c24;
}

.umf-notice.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Filter */
.umf-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.umf-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1200px) {
    .umf-table {
        table-layout: auto;
    }
    
    .umf-table th,
    .umf-table td {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .umf-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .umf-stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .umf-form-row {
        flex-direction: column;
    }
    
    .umf-tab-nav {
        flex-wrap: wrap;
    }
    
    .umf-tab-nav li {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .umf-table {
        font-size: 14px;
    }
    
    .umf-table th,
    .umf-table td {
        padding: 8px;
        white-space: normal;
    }
    
    /* Aktionen-Buttons untereinander auf mobil */
    .umf-table td:last-child button {
        display: block;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .umf-filters {
        flex-wrap: wrap;
    }
}