/* assets/style.css - Komplette Version für das MSC SchiriPortal */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ========== LAYOUT - MOBIL FIRST ========== */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar - kompakter */
.navbar {
    background: white;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
}

.nav-user {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

/* Sidebar - immer sichtbar (nicht versteckt) */
.sidebar {
    background: #2d3748;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.nav-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: max-content;
}

.nav-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.3s;
    font-size: 0.85rem;
}

.nav-menu li a:hover {
    background: #4a5568;
}

.nav-menu li a.active {
    background: #667eea;
}

/* Hauptinhalt - weniger Abstand oben */
.main-content {
    padding: 1rem;
    flex: 1;
}

.main-content h1 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    margin-top: 0;
    color: #2d3748;
}

/* ========== KARTEN & WIDGETS ========== */
.card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

/* Statistik-Karten - kompakter */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    color: #718096;
    margin-top: 0.2rem;
}

/* ========== FORMULARE ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

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

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.filter-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input,
.filter-form select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.btn-reset {
    padding: 0.5rem 1rem;
    background: #e2e8f0;
    color: #4a5568;
    text-decoration: none;
    border-radius: 5px;
}

/* ========== TABELLEN ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: white;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.3rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f7fafc;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== BUTTONS ========== */
.btn-small {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: #edf2f7;
    color: #4a5568;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.7rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #667eea;
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-icon {
    text-decoration: none;
    margin: 0 0.2rem;
    font-size: 1rem;
}

.btn-cancel {
    padding: 0.5rem 1rem;
    background: #e2e8f0;
    color: #4a5568;
    text-decoration: none;
    border-radius: 5px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: bold;
}

.badge-active, .badge.valid { background: #c6f6d5; color: #22543d; }
.badge-inactive, .badge.expired { background: #fed7d7; color: #742a2a; }
.badge-pending { background: #feebc8; color: #7b341e; }
.badge.warning { background: #feebc8; color: #7b341e; }
.badge-admin { background: #e53e3e; color: white; }
.badge-trainer { background: #ecc94b; color: #744210; }
.badge-schiri { background: #48bb78; color: white; }

/* ========== TABS ========== */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 0.5rem 1rem;
    background: #edf2f7;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: #e2e8f0;
}

.nav-tab.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

/* ========== LEHRGANGS-KARTEN ========== */
.courses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.course-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.course-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.6rem 1rem;
}

.course-header h3 {
    font-size: 1rem;
    margin: 0;
}

.course-body {
    padding: 0.75rem;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.info-row .icon {
    min-width: 22px;
    text-align: center;
}

.info-row strong {
    min-width: 75px;
    font-weight: 600;
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    background: #f7fafc;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.75rem;
}

/* ========== IFRAME ========== */
.iframe-container {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.iframe-container iframe {
    width: 100%;
    height: 400px;
    border: none;
}

/* ========== STATS BAR ========== */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: #edf2f7;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.stat-badge.pending {
    background: #feebc8;
    color: #7b341e;
}

/* ========== ERROR & SUCCESS ========== */
.error {
    background: #fed7d7;
    color: #c53030;
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.success {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.info {
    background: #ebf8ff;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* ========== MEDIA QUERIES ========== */

/* Tablet (ab 640px) */
@media (min-width: 640px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content {
        padding: 1.25rem;
    }
}

/* Desktop (ab 1024px) */
@media (min-width: 1024px) {
    .container {
        flex-direction: row;
    }
    
    .sidebar {
        width: 260px;
        min-height: calc(100vh - 45px);
        position: sticky;
        top: 45px;
        overflow-y: auto;
        overflow-x: visible;
        height: calc(100vh - 45px);
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li a {
        white-space: normal;
        padding: 0.7rem 1.2rem;
    }
    
    .main-content {
        margin-left: 0;
        flex: 1;
        padding: 1.25rem 1.5rem;
    }
    
    .main-content h1 {
        margin-top: 0;
    }
    
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 0.5rem 1.5rem;
    }
    
    .sidebar {
        margin-top: 45px;
    }
    
    .main-content {
        margin-left: 260px;
        margin-top: 45px;
    }
}

/* Große Desktop-Bildschirme (ab 1440px) */
@media (min-width: 1440px) {
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== MOBILE MENU ========== */
.menu-toggle {
    display: none;
}

/* Für sehr kleine Geräte (< 480px) */
@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem;
    }
    
    .nav-user {
        justify-content: center;
    }
    
    .main-content h1 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.3rem;
    }
    
    .info-row {
        flex-wrap: wrap;
    }
    
    .info-row strong {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
}