/* VereinsLokator - Main Styles */

/* Inter Font: Lokal geladen via /fonts/inter.css (DSGVO-konform) */

/* CSS Variables */
:root {
    --primary-blue: #2563EB;
    --primary-blue-dark: #1D4ED8;
    --success-green: #059669;
    --warning-orange: #EA580C;
    --error-red: #DC2626;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
    /* Prevent accidental horizontal scrolling from long flex rows / wide tables on mobile */
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Form Elements */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-blue-dark);
}

.btn-secondary {
    background-color: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background-color: var(--gray-50);
}

.btn-success {
    background-color: var(--success-green);
    color: white;
}

.btn-success:hover {
    background-color: #047857;
}

.btn-danger {
    background-color: var(--error-red);
    color: white;
}

.btn-danger:hover {
    background-color: #B91C1C;
}

/* Cards */
.dashboard-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-200);
}

/* Compact stat cards for dashboard metric blocks */
.dashboard-stat-card {
    padding: 1rem;
}

.dashboard-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-hover {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background-color: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.data-table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Allow width overrides via Tailwind max-w utilities used in HTML. */
.modal-content.max-w-2xl { max-width: 42rem; }
.modal-content.max-w-3xl { max-width: 48rem; }
.modal-content.max-w-4xl { max-width: 56rem; }
.modal-content.max-w-7xl { max-width: 80rem; }

/* Payment history modal: wider and a bit more compact than default modals. */
#paymentHistoryModal .modal-content { padding: 1.25rem; }

/* Notifications */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: var(--success-green);
}

.notification.error {
    background-color: var(--error-red);
}

.notification.warning {
    background-color: var(--warning-orange);
}

.notification.info {
    background-color: var(--primary-blue);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #DCFCE7;
    color: #166534;
}

.status-inactive {
    background-color: #FEE2E2;
    color: #991B1B;
}

.status-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-trial {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--gray-50);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Charts */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* Ensure charts fill their containers */
.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-card {
        padding: 1rem;
    }

    .dashboard-stat-card {
        padding: 0.875rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    #paymentHistoryModal .modal-content { padding: 1rem; }
}

/* Utility Classes */
.p-5 { padding: 1.25rem; } /* Tailwind p-5 (20px) */
.flex-wrap { flex-wrap: wrap; }
.overflow-y-auto { overflow-y: auto; }
.max-h-80 { max-height: 20rem; } /* Tailwind max-h-80 */
.max-h-\[500px\] { max-height: 500px; }

@media (min-width: 640px) {
    .sm\:p-5 { padding: 1.25rem; }
}

.mt-auto { margin-top: auto; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .dashboard-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Accessibility */
.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;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dashboard-card {
        border: 2px solid var(--gray-400);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}
/* Dashboard Events: filter tabs (moved from inline style) */
.filter-tab {
  padding: 0.5rem 1rem; /* px-4 py-2 */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  border-radius: 0.375rem; /* rounded-md */
  border: 1px solid transparent;
  color: var(--gray-700);
  background-color: transparent;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.filter-tab:hover {
  color: var(--primary-blue);
  background-color: #EFF6FF; /* blue-50 */
}
.filter-tab.active {
  background-color: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}
