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

:root {
    --primary-red: #e30613;
    --primary-red-dark: #b80510;
    --primary-red-light: #f43f3f;
    --primary-red-lighter: #fee2e2;
    --primary-yellow: #ffc107;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, var(--primary-red) 0%, #c40a14 60%, var(--primary-yellow, #ffc107) 160%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--gray-200);
}

/* Header wird auch auf Startseite angezeigt */
#authSection ~ header,
header:has(~ #authSection) {
    /* Header ist immer sichtbar */
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    max-height: 90px;
    max-width: 220px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    display: block;
}

h1 {
    color: var(--gray-900);
    font-size: 2.5em;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.user-info span {
    font-weight: 600;
    color: var(--primary-red);
    font-size: 1.1em;
}

.section {
    margin-bottom: 30px;
}

.auth-container {
    max-width: 450px;
    margin: 0 auto;
    background: var(--gray-50);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}


.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--white);
    padding: 4px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--gray-600);
}

.tab-btn.active {
    background: var(--primary-red);
    color: var(--white);
    box-shadow: var(--shadow);
}

.tab-btn:hover:not(.active) {
    background: var(--gray-100);
    color: var(--gray-900);
}

.tab-content {
    display: none;
}

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

.tab-content h2 {
    color: var(--gray-900);
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
}

.form-group {
    margin-bottom: 24px;
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--gray-900);
}

/* E-Mail-Feld größer machen */
#loginEmail {
    font-size: 18px !important;
    padding: 16px 20px !important;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-red);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.6;
    margin-bottom: 0;
}

.checkbox-label span {
    flex: 1;
    color: var(--gray-700);
    font-size: 14px;
}

.privacy-link {
    color: var(--primary-red);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.privacy-link:hover {
    color: var(--primary-red-dark);
    text-decoration: none;
}

.required {
    color: var(--primary-red);
    font-weight: 700;
}

input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--primary-red-lighter);
}

input:hover {
    border-color: var(--gray-300);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

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

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    background: var(--gray-300);
    color: var(--gray-600);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-controls {
    background: var(--gray-50);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.admin-controls h3 {
    color: var(--gray-900);
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 700;
}

.admin-controls.admin-danger {
    background: #fef3c7;
    border: 2px solid var(--warning);
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-action-item {
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.admin-action-item p {
    margin-bottom: 15px;
    color: var(--gray-900);
}

.admin-action-item small {
    color: var(--gray-600);
    font-size: 0.9em;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.appointments-preview {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

.appointments-preview h4 {
    margin-bottom: 15px;
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 600;
}

.appointments-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    font-size: 13px;
}

.appointments-preview-item {
    padding: 8px;
    background: var(--primary-red-lighter);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    color: var(--primary-red-dark);
}

.appointments-preview p {
    margin: 0;
    padding: 10px;
    font-size: 14px;
    color: var(--gray-700);
}

.appointments-section {
    margin-top: 30px;
}

.appointments-section h2 {
    color: var(--gray-900);
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 25px;
}

.appointments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.appointment-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.appointment-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--gray-300);
}

.appointment-card.booked {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.appointment-card.own {
    border-color: var(--primary-red);
    background: var(--primary-red-lighter);
    box-shadow: 0 0 0 3px var(--primary-red-lighter);
}

.appointment-info {
    margin-bottom: 20px;
}

.appointment-info h3 {
    color: var(--gray-900);
    margin-bottom: 12px;
    font-size: 1.3em;
    font-weight: 700;
}

.appointment-info p {
    color: var(--gray-600);
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.6;
}

.appointment-status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-booked {
    background: var(--gray-600);
    color: var(--white);
}

.status-own {
    background: var(--primary-red);
    color: var(--white);
}

.appointment-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.appointment-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 8% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.modal-close {
    color: var(--gray-400);
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--gray-900);
}

.modal-content h2 {
    color: var(--gray-900);
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
}

.booking-info {
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 10px;
    margin: 8px 0;
    font-weight: 500;
    color: var(--gray-900);
    border-left: 4px solid var(--primary-red);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

.privacy-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.privacy-content h3 {
    color: var(--gray-900);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 700;
}

.privacy-content h3:first-child {
    margin-top: 0;
}

.privacy-content h4 {
    color: var(--gray-800);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.privacy-content p {
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 15px;
}

.privacy-content ul {
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 15px;
    padding-left: 25px;
}

.privacy-content ul li {
    margin-bottom: 8px;
}

.privacy-content ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Scrollbar für Privacy-Content */
.privacy-content::-webkit-scrollbar {
    width: 8px;
}

.privacy-content::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Benutzerverwaltung Styles */
.users-list {
    margin-top: 20px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.user-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.user-card.admin-user {
    border-color: var(--primary-red);
    background: var(--primary-red-lighter);
}

.user-info h4 {
    color: var(--gray-900);
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 700;
}

.user-meta {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.user-meta strong {
    color: var(--gray-900);
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
}

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

.admin-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: var(--white);
    font-weight: 600;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

.message.success {
    background: var(--success);
}

.message.error {
    background: var(--danger);
}

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 24px;
        border-radius: 16px;
    }
    
    .appointments-list {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        max-height: 70px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .auth-container {
        padding: 30px 20px;
    }
    
    .admin-controls {
        padding: 20px;
    }
    
    .admin-actions {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 30px 20px;
    }
    
    .message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red-dark);
}
