/**
 * FY Network Manager — Frontend Styles
 */

/* === Basis-Schriftart (mit !important um Theme-Overrides zu verhindern) === */
.fy-nm-registration-wrap,
.fy-nm-registration-wrap *,
.fy-nm-approvals-wrap,
.fy-nm-approvals-wrap *,
.fy-nm-profile-wrap,
.fy-nm-profile-wrap *,
.fy-nm-tree-wrap,
.fy-nm-tree-wrap *,
.fy-nm-stats,
.fy-nm-stats *,
.fy-nm-table,
.fy-nm-table *,
.fy-nm-kontakt-wrap,
.fy-nm-kontakt-wrap *,
.fy-nm-kontakt-login-wrap,
.fy-nm-kontakt-login-wrap * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* === Allgemein === */
.fy-nm-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
}
.fy-nm-notice-info { background: #e8f4fd; color: #1a5276; border-left: 4px solid #3498db; }
.fy-nm-notice-warning { background: #fef9e7; color: #7d6608; border-left: 4px solid #f1c40f; }
.fy-nm-notice-success { background: #eafaf1; color: #1e8449; border-left: 4px solid #2ecc71; }
.fy-nm-notice-error { background: #fdedec; color: #922b21; border-left: 4px solid #e74c3c; }

/* === Registrierungsformular === */
.fy-nm-registration-wrap {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    font-family: Arial, Helvetica, sans-serif;
}

.fy-nm-registration-header {
    text-align: center;
    margin-bottom: 30px;
}

.fy-nm-registration-header h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.fy-nm-registration-header p {
    color: #7f8c8d;
    font-size: 15px;
}

.fy-nm-form-row {
    display: flex;
    gap: 15px;
}

.fy-nm-form-row .fy-nm-form-group {
    flex: 1;
}

.fy-nm-form-group {
    margin-bottom: 20px;
}

.fy-nm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px;
}

.fy-nm-form-group label .required,
.fy-nm-form-group label .fy-nm-required {
    color: #e74c3c;
}

.fy-nm-form-group input[type="text"],
.fy-nm-form-group input[type="email"],
.fy-nm-form-group input[type="tel"],
.fy-nm-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.fy-nm-form-group input:focus,
.fy-nm-form-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.fy-nm-help-text {
    font-size: 13px;
    color: #95a5a6;
    margin-top: 4px;
}

/* Info-Icon mit Popup */
.fy-nm-info-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    color: #1A7AB5;
    font-size: 15px;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
    margin-left: 4px;
}

.fy-nm-info-icon:hover,
.fy-nm-info-icon:focus {
    color: #145f8a;
}

.fy-nm-info-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    padding: 10px 14px;
    border-radius: 6px;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: left;
    white-space: normal;
}

.fy-nm-info-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.fy-nm-info-icon:hover .fy-nm-info-popup,
.fy-nm-info-icon:focus .fy-nm-info-popup {
    display: block;
}

@media (max-width: 480px) {
    .fy-nm-info-popup {
        left: auto;
        right: -10px;
        transform: none;
        width: 220px;
    }
    .fy-nm-info-popup::after {
        left: auto;
        right: 16px;
        transform: none;
    }
}

.fy-nm-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.fy-nm-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
}

/* Telefon-Vorwahl + Nummer nebeneinander */
.fy-nm-phone-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.fy-nm-phone-row select {
    flex: 0 0 auto;
    width: 110px;
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.fy-nm-phone-row select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.fy-nm-phone-row input[type="tel"] {
    flex: 1;
    min-width: 0;
}

.fy-nm-sponsor-check {
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 13px;
}

.fy-nm-sponsor-check.found {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #2ecc71;
}

.fy-nm-sponsor-check.not-found {
    background: #fdedec;
    color: #922b21;
    border: 1px solid #e74c3c;
}

/* === Buttons === */
.fy-nm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.fy-nm-btn-primary {
    background: #3498db;
    color: #fff;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}
.fy-nm-btn-primary:hover { background: #2980b9; }
.fy-nm-btn-primary:disabled { background: #bdc3c7; cursor: not-allowed; }

.fy-nm-btn-success { background: #2ecc71; color: #fff; }
.fy-nm-btn-success:hover { background: #27ae60; }

.fy-nm-btn-danger { background: #e74c3c; color: #fff; }
.fy-nm-btn-danger:hover { background: #c0392b; }

.fy-nm-btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.fy-nm-form-note {
    text-align: center;
    font-size: 13px;
    color: #95a5a6;
    margin-top: 15px;
}

/* === Statistiken === */
.fy-nm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.fy-nm-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.fy-nm-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.fy-nm-stat-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fy-nm-stat-pending {
    border-color: #f39c12;
}

.fy-nm-stat-pending .fy-nm-stat-number {
    color: #e67e22;
}

/* === Tabs === */
.fy-nm-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.fy-nm-tabs .fy-nm-tab,
.fy-nm-tabs .fy-nm-tab:link,
.fy-nm-tabs .fy-nm-tab:visited {
    display: inline-block !important;
    padding: 12px 24px !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #7f8c8d !important;
    cursor: pointer !important;
    transition: color 0.2s, border-bottom-color 0.2s !important;
    margin-bottom: -2px !important;
    box-shadow: none !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
    outline: none !important;
}

.fy-nm-tabs .fy-nm-tab:hover {
    color: #2c3e50 !important;
    background-color: #f8f9fa !important;
    text-decoration: none !important;
}

.fy-nm-tabs .fy-nm-tab.active,
.fy-nm-tabs .fy-nm-tab.active:link,
.fy-nm-tabs .fy-nm-tab.active:visited {
    color: #3498db !important;
    border-bottom-color: #3498db !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
}

.fy-nm-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #e74c3c;
    color: #fff;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

.fy-nm-tab-content {
    display: none;
}

.fy-nm-tab-content.active {
    display: block;
}

/* === Section-Titel (statt Tabs) === */
.fy-nm-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Klickbare Profil-Links in Tabellen */
.fy-nm-profile-link,
.fy-nm-profile-link:link,
.fy-nm-profile-link:visited {
    color: #2c3e50;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.fy-nm-profile-link:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Suchfeld für Fachberater-Liste */
.fy-nm-list-search {
    margin-bottom: 15px;
}

.fy-nm-list-search input {
    width: 100%;
    max-width: 400px;
    padding: 8px 14px;
    border: 1px solid #dcdfe3;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.fy-nm-list-search input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

/* === Freigaben-Tabelle === */
.fy-nm-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fy-nm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    font-size: 14px;
}

.fy-nm-table thead th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fy-nm-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50;
    vertical-align: middle;
}

.fy-nm-table tbody tr:hover {
    background: #f8f9fa;
}

.fy-nm-table tbody tr:last-child td {
    border-bottom: none;
}

.fy-nm-table code {
    background: #e8f4fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #2980b9;
}

.fy-nm-table small {
    display: block;
    color: #95a5a6;
    font-size: 12px;
}

/* === Freigaben === */
.fy-nm-approvals-wrap {
    max-width: 1000px;
    margin: 0 auto 30px;
}

.fy-nm-approvals-list {
    display: grid;
    gap: 15px;
}

.fy-nm-approval-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s;
}

.fy-nm-approval-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.fy-nm-approval-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.fy-nm-avatar img {
    border-radius: 50%;
}

.fy-nm-approval-info h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #2c3e50;
}

.fy-nm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.fy-nm-badge-pending { background: #fef9e7; color: #d4ac0d; }
.fy-nm-badge-approved { background: #eafaf1; color: #1e8449; }
.fy-nm-badge-rejected { background: #fdedec; color: #922b21; }

.fy-nm-approval-details {
    margin-bottom: 15px;
}

.fy-nm-detail-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.fy-nm-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 140px;
    font-size: 14px;
}

.fy-nm-detail-value {
    color: #2c3e50;
    font-size: 14px;
}

.fy-nm-approval-actions {
    display: flex;
    gap: 10px;
}

.fy-nm-approval-actions .fy-nm-btn {
    flex: 1;
    justify-content: center;
}

/* === Toolbar === */
.fy-nm-tree-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.fy-nm-tree-view-switch {
    display: flex;
    gap: 15px;
}

.fy-nm-tree-view-switch label {
    cursor: pointer;
    font-size: 14px;
}

.fy-nm-tree-search {
    flex: 1;
    min-width: 200px;
}

.fy-nm-tree-search input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.fy-nm-tree-search input:focus {
    border-color: #3498db;
    outline: none;
}

.fy-nm-tree-controls {
    display: flex;
    gap: 8px;
}

/* === Spinner === */
.fy-nm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: fy-nm-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

.fy-nm-tree-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* === Profilseite === */
.fy-nm-profile-wrap {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.fy-nm-profile-wrap h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 25px 0 15px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.fy-nm-profile-wrap h3:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* Avatar-Bereich */
.fy-nm-profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.fy-nm-profile-avatar-preview {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e8ecef;
}

.fy-nm-profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fy-nm-profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fy-nm-btn-outline {
    background: #fff;
    color: #3498db;
    border: 2px solid #3498db;
    cursor: pointer;
    text-align: center;
}
.fy-nm-btn-outline:hover {
    background: #3498db;
    color: #fff;
}

.fy-nm-btn-text {
    background: none;
    color: #e74c3c;
    border: none;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.fy-nm-btn-text:hover {
    text-decoration: underline;
}

/* Info-Karte (nur lesen) */
.fy-nm-profile-info-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
    border: 1px solid #e8ecef;
}

.fy-nm-profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e8ecef;
}

.fy-nm-profile-info-row:last-child {
    border-bottom: none;
}

.fy-nm-profile-info-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
}

.fy-nm-profile-info-value {
    color: #2c3e50;
    font-size: 14px;
}

.fy-nm-profile-info-value code {
    background: #e8f4fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #2980b9;
}

/* Readonly-Felder (ausgegraut, nicht editierbar) */
.fy-nm-input-readonly {
    background: #f0f2f4 !important;
    color: #6c7a89 !important;
    border-color: #dce1e6 !important;
    cursor: not-allowed;
    user-select: all;
}

.fy-nm-input-readonly:focus {
    border-color: #dce1e6 !important;
    box-shadow: none !important;
}

/* Passwort-Felder */
.fy-nm-form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.fy-nm-form-group input[type="password"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

/* === Kontaktseite === */
.fy-nm-kontakt-wrap {
    max-width: 800px;
    margin: 0 auto 30px;
    font-family: Arial, Helvetica, sans-serif;
}

.fy-nm-kontakt-login-wrap {
    max-width: 600px;
    margin: 0 auto 30px;
    font-family: Arial, Helvetica, sans-serif;
}

.fy-nm-kontakt-cards {
    display: grid;
    gap: 15px;
}

.fy-nm-kontakt-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.fy-nm-kontakt-card h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #2c3e50;
}

.fy-nm-kontakt-role {
    font-size: 14px;
    color: #3498db;
    font-weight: 600;
    margin-bottom: 12px;
}

.fy-nm-kontakt-details {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.fy-nm-kontakt-row {
    display: flex;
    padding: 6px 0;
    font-size: 14px;
}

.fy-nm-kontakt-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 100px;
}

.fy-nm-kontakt-row a {
    color: #3498db;
    text-decoration: none;
}

.fy-nm-kontakt-row a:hover {
    text-decoration: underline;
}

.fy-nm-kontakt-info {
    color: #95a5a6;
    font-style: italic;
    font-size: 13px;
}

/* === Aktuelles / News === */
.fy-nm-news-wrap {
    max-width: 800px;
    margin: 0 auto 30px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left !important;
}

.fy-nm-news-wrap,
.fy-nm-news-wrap * {
    font-family: Arial, Helvetica, sans-serif !important;
    text-align: left;
}

.fy-nm-news-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    margin-bottom: 15px;
    text-align: left !important;
}

.fy-nm-news-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.fy-nm-news-emoji {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.fy-nm-news-title {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    text-align: left !important;
}

.fy-nm-news-date {
    flex-shrink: 0;
    font-size: 13px;
    color: #95a5a6;
    white-space: nowrap;
}

.fy-nm-news-content {
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.6;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
    text-align: left !important;
}

.fy-nm-news-content p:first-child {
    margin-top: 0;
}

.fy-nm-news-content p:last-child {
    margin-bottom: 0;
}

.fy-nm-news-content a {
    color: #3498db;
    text-decoration: none;
}

.fy-nm-news-content a:hover {
    text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 600px) {
    .fy-nm-form-row {
        flex-direction: column;
        gap: 0;
    }

    .fy-nm-registration-wrap {
        padding: 20px;
        margin: 0 10px;
    }

    .fy-nm-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .fy-nm-tree-toolbar {
        flex-direction: column;
    }

    .fy-nm-approval-actions {
        flex-direction: column;
    }

    .fy-nm-profile-wrap {
        padding: 20px;
        margin: 0 10px;
    }

    .fy-nm-profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .fy-nm-profile-avatar-actions {
        align-items: center;
    }

    .fy-nm-profile-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .fy-nm-tabs {
        overflow-x: auto;
    }

    .fy-nm-tab {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .fy-nm-table {
        font-size: 13px;
    }

    .fy-nm-table thead th,
    .fy-nm-table tbody td {
        padding: 8px 10px;
    }

    .fy-nm-news-wrap {
        margin: 0 10px 30px;
    }

    .fy-nm-news-card {
        padding: 16px;
    }

    .fy-nm-news-header {
        gap: 10px;
    }

    .fy-nm-news-emoji {
        font-size: 26px;
    }

    .fy-nm-news-title {
        font-size: 16px;
    }

    .fy-nm-news-date {
        font-size: 12px;
    }
}
