/* === RESET & VARIABLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* LIA.at inspirierte Farben */
    --primary-blue: #0066b3;
    --primary-dark: #004680;
    --primary-light: #3399cc;
    --accent-orange: #ff6b35;
    --accent-teal: #00a896;
    --accent-light-blue: #4ecdc4;
    
    /* Grautöne */
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Funktionale Farben */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Schatten */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-100);
    min-height: 100vh;
}

/* === CONTAINER === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: var(--shadow-xl);
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.header h1::after {
    content: "🚣";
    font-size: 32px;
}

/* === NAVIGATION === */
.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-info {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: white;
}

.nav-link, .nav-button {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    border: none;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    font-family: inherit;
}

.nav-form {
    margin: 0;
}

.nav-link:hover, .nav-button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-link:active, .nav-button:active {
    transform: translateY(0);
}

/* === CONTENT === */
.content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* === ALERTS === */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success);
}

.alert-success::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-weight: bold;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-error::before,
.alert-danger::before {
    content: "✕";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-weight: bold;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info);
}

.alert-info::before {
    content: "ℹ";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--info);
    color: white;
    font-weight: bold;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

.alert-warning::before {
    content: "⚠";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--warning);
    color: white;
    font-weight: bold;
}

/* === CARDS === */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h2, .card h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-blue);
    color: var(--primary-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h2 {
    font-size: 24px;
}

.card h3 {
    font-size: 20px;
}

/* Logo in Card-Überschriften */
.page-logo {
    height: 32px;
    width: auto;
    background: white;
    padding: 4px;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Mobile: Standardmäßig versteckt */
.mobile-show {
    display: none;
}

.mobile-expand-icon {
    display: none;
}

/* Desktop-only: Standardmäßig sichtbar, aber versteckt auf Mobile und Tablet */
.desktop-only {
    display: table-cell;
}

.expand-btn {
    color: var(--primary-blue);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.expand-icon {
    text-align: center;
    cursor: pointer;
    user-select: none;
}

/* Details Row */
.details-row {
    background: var(--gray-50);
}

.details-content {
    padding: 20px;
    border-top: 2px solid var(--primary-blue);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item strong {
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: var(--gray-900);
    font-size: 14px;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-base);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 179, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 179, 0.4);
}

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

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* === TABLES === */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

table th {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

table th a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

table th a:hover {
    opacity: 0.9;
    transform: translateX(2px);
}

table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    vertical-align: middle;
}

table td small {
    font-size: 12px;
}

table tbody tr {
    transition: var(--transition-fast);
}

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

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

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.5px;
}

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

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

.badge-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

/* === FORMS === */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition-base);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 179, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--gray-600);
    font-size: 12px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* === LOGIN PAGE === */
body.login-page {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--gray-900);
    margin-bottom: 8px;
    font-weight: 700;
}

.icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.login-header p {
    color: var(--gray-600);
    font-size: 15px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 102, 179, 0.4);
}

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

.info-box {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--gray-700);
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 14px;
}

/* === STAT CARDS === */
.stat-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-blue {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
}

.stat-teal {
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-light-blue) 100%);
}

.stat-orange {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #ff8c42 100%);
}

.stat-success {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
}

/* === UTILITIES === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
    /* Mobile: Header nicht sticky wenn Navigation aufgeklappt */
    .header {
        position: relative;
        /* Nicht mehr sticky auf Mobile, scrollt mit */
    }
    
    /* Mobile: Verstecke nicht-essentielle Spalten */
    .mobile-hidden {
        display: none !important;
    }
    
    /* Mobile: Zeige mobile Spalten */
    .mobile-show {
        display: table-cell !important;
    }
    
    /* Mobile: Verstecke desktop-only Spalten */
    .desktop-only {
        display: none !important;
    }
    
    /* Mobile: Zeige nur wichtige Spalten */
    .anmeldungen-table thead th {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .anmeldungen-table tbody td {
        padding: 12px 8px;
        font-size: 13px;
        vertical-align: middle;
    }
    
    /* Mobile Expand Icon */
    .mobile-expand-icon {
        display: inline-block !important;
        color: var(--primary-blue);
        font-weight: bold;
        margin-right: 8px;
        cursor: pointer;
        transition: transform 0.3s ease;
        font-size: 14px;
    }
    
    /* Anklickbare Zeilen */
    .anmeldung-row td {
        cursor: pointer;
    }
    
    .anmeldung-row:hover {
        background: var(--gray-50);
    }
    
    /* Details Row Styling */
    .details-row {
        background: var(--gray-50) !important;
    }
    
    .details-row:hover {
        background: var(--gray-50) !important;
    }
    
    .details-content {
        padding: 16px;
        border-top: 2px solid var(--primary-blue);
    }
    
    .detail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .detail-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-item.full-width {
        grid-column: 1 / -1;
    }
    
    .detail-item strong {
        color: var(--gray-700);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .detail-item span {
        color: var(--gray-900);
        font-size: 14px;
    }
    
    .detail-item .actions {
        margin-top: 8px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .header h1::after {
        font-size: 26px;
    }

    .nav {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .user-info,
    .nav-link,
    .nav-button {
        width: 100%;
        text-align: center;
        display: block;
    }

    .nav-form {
        width: 100%;
    }

    .nav-button {
        width: 100%;
    }

    .content {
        padding: 20px;
    }

    .card {
        padding: 20px;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 12px;
    }

    table th, table td {
        padding: 10px 8px;
    }

    .login-container {
        padding: 32px 24px;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }
}

/* === SORTIERBARE TABELLEN === */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(0, 102, 179, 0.1);
}

.sort-icon {
    margin-left: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    display: inline-block;
}

.sortable.sort-asc .sort-icon,
.sortable.sort-desc .sort-icon {
    color: var(--accent-orange);
    font-weight: bold;
}

.sortable.sort-asc,
.sortable.sort-desc {
    background-color: rgba(0, 102, 179, 0.15);
}

@media (max-width: 768px) {
    .sort-icon {
        font-size: 0.8em;
        margin-left: 3px;
    }
}

/* Tablet-Ansicht: 768px - 1200px (inkl. iPad Mini, iPad, kleine Laptops) */
@media (min-width: 768px) and (max-width: 1200px) {
    /* Verstecke desktop-only Spalten auf Tablet */
    .desktop-only {
        display: none !important;
    }
}
