/* style.css - Zentrales Stylesheet für die Vereinsverwaltung */
/* Modernes Design angelehnt an Vereinsantrag.online */

/* --- GOOGLE FONTS --- */
@import url('https://fonts.bunny.net/css?family=inter:400,500,600');

:root {
    /* Farbpalette */
    --primary-color: #ea782c;       /* Indigo/Lila */
    --primary-dark: #D5ECD4;        
    --secondary-color: #ec4899;     /* Pink Akzent */
    
    --bg-color: #f3f4f6;            /* Hellgrauer Gesamthintergrund */
    --card-bg: #ffffff;             /* Weiß für Karten */
    
    --text-color: #1f2937;          /* Dunkles Grau */
    --text-muted: #6b7280;          /* Helles Grau */
    
    --border-color: #e5e7eb;        
    --danger-color: #ef4444;
    --success-color: #10b981;
    --white: #ffffff;
    --light-gray: #f3f4f6;
    
    /* Schatten */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Inter', sans-serif;
}

/* --- GLOBAL --- */
body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-color);
    margin-top: 0;
    line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

* { box-sizing: border-box; }

/* --- BUTTONS & INPUTS --- */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    /* margin-top: 2%;  <-- ENTFERNT, damit Buttons in der Leiste bündig sind */
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
	color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-danger { background-color: var(--danger-color); color: #fff; }
.btn-danger:hover { background-color: #dc2626; }

.btn-secondary { background-color: #f3f4f6; color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: #e5e7eb; }

.newmember { width: 100%; }
.margintop {margin-top: 2%; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #fff;
    color: var(--text-color);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
	margin-top: 5%;
}

/* --- ALERTS --- */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background-color: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.alert-error { background-color: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* --- LAYOUT: SIDEBAR & CONTENT --- */
.app-layout { display: flex; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: #ffffff;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background-color: #e5e7eb;}

.sidebar-header {
    padding: 1.5rem 1rem;
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    flex-grow: 1;
	border-top: 1px solid #e5e5e5;
}

.sidebar-menu li {
    border-bottom: none;
    margin-bottom: 0.25rem;
}

.sidebar-menu a, .sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-menu a svg, .sidebar-footer a svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s;
}

.sidebar-menu a:hover {
    background-color: #f3f4f6;
    color: var(--text-color);
}
.sidebar-menu a:hover svg { stroke: var(--primary-color); }

.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.sidebar-menu a.active svg { stroke: #ffffff; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer a {
    border-bottom: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sidebar-footer a:hover {
    background: #f3f4f6;
    color: var(--text-color);
}
.sidebar-footer a:hover svg { stroke: var(--text-color); }

.sidebar-footer a.btn-logout { color: var(--danger-color); }
.sidebar-footer a.btn-logout:hover {
    background: #fef2f2;
    color: var(--danger-color);
}
.sidebar-footer a.btn-logout:hover svg { stroke: var(--danger-color); }

/* Main Content */
.main-content {
    flex-grow: 1;
    background-color: var(--bg-color);
    padding: 2rem;
    overflow-y: auto;
    margin-left: 260px;
    min-height: 100vh;
}

.content-card {
    background: var(--card-bg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: none;
    max-width: 100%;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        height: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content { margin-left: 0; padding: 1rem; }
    
    .sidebar-menu { 
        display: flex; 
        overflow-x: auto; 
        padding: 1rem;
        gap: 0.5rem;
    }
    .sidebar-menu li { margin-bottom: 0; flex-shrink: 0; }
    .sidebar-menu a { white-space: nowrap; padding: 0.5rem 1rem; }
    
    .sidebar-footer {
        flex-direction: row;
        justify-content: space-around;
    }
}

/* --- MEMBERS PAGE SPECIFIC --- */
.members-header {
    display: block;
    margin-bottom: 1.5rem;
    text-align: center;
}

.members-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

.members-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* KORREKTUR: Hier steht jetzt justify-content: center */
.controls-center { 
    display: flex; 
    flex-wrap: wrap;
    gap: 1rem; 
    align-items: center; 
    justify-content: flex-end; /* Zentriert die Elemente horizontal */
    margin-top: 1rem;
    width: 100%;
}

/* Table Styles */
.table-responsive { 
    overflow-x: auto; 
    background: #fff;
}

.members-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

/* Erzwingt das Design der Tabellen-Header */
.members-table th {
    background-color: transparent !important;
    color: #000000 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 2px solid #e5e7eb !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.members-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.95rem;
    vertical-align: middle;
}

.members-table tr:last-child td { border-bottom: none; }

.members-table tr:hover {
    background-color: #f9fafb;
}

.members-table tr:hover td:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.members-table tr:hover td:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.status-active { background: #ecfdf5; color: #059669; }
.status-archived { background: #fef2f2; color: #dc2626; }
.status-pending { background: #fffbeb; color: #d97706; }

.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell a, .actions-cell button {
    margin-left: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.actions-cell a svg, .actions-cell button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.actions-cell .btn-edit:hover { color: var(--primary-color); background: #eef2ff; }
.actions-cell .btn-log:hover { color: var(--secondary-color); background: #fdf2f8; }
.actions-cell button.delete:hover { color: var(--danger-color); background: #fef2f2; }

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--white);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.close-modal {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.close-modal:hover { color: var(--text-color); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}
.form-group { margin-bottom: 0; }
.form-group.full { grid-column: span 2; }

.modal-actions {
    margin-top: 2rem;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1.25rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background-color: #059669; }
.toast-error { background-color: #dc2626; }

/* --- LOADING OVERLAY --- */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20;
    
}
.loading-overlay.active { display: flex; }


/* VAA Modal Styles */
#vaaModal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
}

#vaaModal.active {
    display: flex !important; 
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

#vaaModal .modal-content {
    background-color: #fefefe;
    margin: 0;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

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

@keyframes slideDown {
    from {transform: translateY(-30px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

.vaa-input {
    width: 100%; 
    padding: 10px; 
    margin: 8px 0 20px 0; 
    box-sizing: border-box;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.vaa-message {
    padding: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}
.vaa-message.error { background:#dc3545; color:white; }
.vaa-message.success { background:#28a745; color:white; }
.vaa-message.loading { color:#007bff; font-weight: 500; }

/* Tab System Styles */
        .tabs-header { display: flex; margin-bottom: 1.5rem; overflow-x: auto; }
        .tab-btn {
            padding: 0.8rem 1.5rem;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-weight: 600;
            color: #666;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .tab-btn:hover { color: var(--primary-color); background: #f9f9f9; }
        .tab-btn.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }
        .tab-btn.admin-only { color: #c62828; }
        .tab-btn.admin-only.active { border-bottom-color: #c62828; color: #c62828; }

        .tab-content { display: none; animation: fadeIn 0.3s; }
        .tab-content.active { display: block; }
        
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        .form-section { margin-bottom: 2rem; }
        .form-section h3 { border-bottom: 1px solid #eee; padding-bottom: 0.5rem; margin-bottom: 1rem; color: #444; }
        
        .levels-list { border: 1px solid #eee; border-radius: 4px; margin-bottom: 1rem; }
        .level-item { display: flex; gap: 1rem; padding: 0.8rem; border-bottom: 1px solid #eee; align-items: center; background: #fff; }
        .level-item:last-child { border-bottom: none; }
        .level-item input[type="text"], .level-item input[type="number"] { width: auto; flex-grow: 1; }
        .level-item input[type="checkbox"] { width: auto; }
        .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
        
        .logo-preview { max-width: 200px; margin-top: 1rem; border: 1px solid #eee; padding: 0.5rem; border-radius: 4px; }
        .logo-preview img { max-width: 100%; height: auto; }
		
		
/* HTML: <div class="loader"></div> */
.spinner {
  width: 120px;
  height: 22px;
  border-radius: 20px;
  color: #514b82;
  border: 2px solid;
  position: relative;
}
.spinner::before {
  content: "";
  position: absolute;
  margin: 2px;
  inset: 0 100% 0 0;
  border-radius: inherit;
  background: currentColor;
  animation: l6 2s infinite;
}
@keyframes l6 {
    100% {inset:0}
}


/* --- LOGIN PAGE SPECIFIC --- */

/* Der Hintergrund für die gesamte Login-Seite */
.login-wrapper {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: var(--font-body);
}

/* Die weiße Karte in der Mitte */
.login-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 420px; /* Begrenzt die Breite, damit es nicht zu breit wird */
    text-align: center; /* Zentriert Text und das Logo */
}

/* Überschrift im Login */
.login-container h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Formular-Gruppierung im Login */
.login-container .form-group {
    margin-bottom: 1.25rem;
    text-align: left; /* Labels und Inputs linksbündig für bessere Lesbarkeit */
}

/* Button im Login auf volle Breite */
.login-container .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Fehlermeldung */
.login-container .error {
    background-color: #fef2f2;
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
    text-align: left;
}