/* Gemeinsame Styles für alle Seiten */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    padding-top: 70px;
}

/* Navigation - Kopfzeile */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-brand {
    padding: 0;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s;
    font-size: 0.9em;
    white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-user #user-name {
    font-weight: 500;
    font-size: 0.9em;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header h2 {
    color: #333;
    font-size: 1.5em;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

table tr:hover {
    background: #f8f9fa;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Error */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Admin-only elements - Sichtbarkeit wird über JavaScript gesteuert */
/* .admin-only { display: none; } - Entfernt, da JavaScript toggleAdminElements() verwendet */

/* Responsive */

.nav-toggle { display: none; }
.nav-overlay { display: none; }

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 15px;
    }
}

/* Custom Confirmation Dialog */
.confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: confirmSlideIn 0.3s ease-out;
}

@keyframes confirmSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-header {
    background: #e74c3c;
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-header-icon {
    font-size: 2em;
}

.confirm-header-title {
    font-size: 1.3em;
    font-weight: 600;
}

.confirm-body {
    padding: 25px;
    font-size: 1.05em;
    color: #333;
    line-height: 1.6;
}

.confirm-footer {
    padding: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
}

.confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.confirm-btn-cancel {
    background: #95a5a6;
    color: white;
}

.confirm-btn-cancel:hover {
    background: #7f8c8d;
}

.confirm-btn-delete {
    background: #e74c3c;
    color: white;
}

.confirm-btn-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Scroll-to-top Button */
#scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s, background 0.2s;
    z-index: 1000;
}

#scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-top-btn:hover {
    background: #5a6fd6;
    transform: translateY(-3px);
}

/* Scroll-to-top Button innerhalb von Modals */
.modal-scroll-top-wrap {
    position: sticky;
    bottom: 0;
    height: 0;
    text-align: right;
    z-index: 10;
    pointer-events: none;
}

.modal-scroll-top {
    position: relative;
    bottom: 55px;
    right: 5px;
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 1.3em;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s, background 0.2s;
    pointer-events: none;
}

.modal-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-scroll-top:hover {
    background: #5a6fd6;
    transform: translateY(-3px);
}

@media print {
    .modal-scroll-top-wrap { display: none !important; }
}
