:root {
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --border: #e5e7eb;
    --border-focus: #2563eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --header-bg: #ffffff;
    --header-border: #e5e7eb;
    --zimmer-frei: #16a34a;
    --zimmer-belegt: #dc2626;
    --zimmer-neu: #2563eb;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --font-size-base: 16px;
    --line-height-base: 1.7;
}

[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --text-primary: #f0f2f5;
    --text-secondary: #b8c1ce;
    --text-muted: #6b7a90;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: #1e3a5f;
    --danger: #ef4444;
    --danger-light: #450a0a;
    --success: #22c55e;
    --success-light: #052e16;
    --warning: #f59e0b;
    --warning-light: #451a03;
    --border: #374151;
    --border-focus: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --header-bg: #1a1f2e;
    --header-border: #374151;
    --zimmer-frei: #22c55e;
    --zimmer-belegt: #ef4444;
    --zimmer-neu: #3b82f6;
    --modal-overlay: rgba(0, 0, 0, 0.75);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s ease, border-color 0.3s ease;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

header .nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header a:not(.theme-toggle):not(.btn) {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-weight: 500;
}

header a:not(.theme-toggle):not(.btn):hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

header a.btn-primary {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all 0.2s;
}

header a.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Landingpage Styles - see end of file */

.house-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.haus-karte a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all 0.2s;
}

.haus-karte a:hover {
    background: var(--accent-hover);
    color: white;
    transform: scale(1.02);
}

.plan-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.plan-container svg {
    width: 100%;
    height: auto;
    max-height: 70vh;
    min-width: 1200px;
}

#interaktiv-ansicht {
    overflow-x: auto;
    padding-bottom: 1rem;
}

#interaktiv-ansicht svg {
    max-height: 50vh;
}

.zimmer {
    fill: var(--zimmer-frei);
    cursor: pointer;
    transition: fill 0.2s;
}

.zimmer:hover {
    filter: brightness(1.1);
}

.zimmer.belegt {
    fill: var(--zimmer-belegt);
}

.zimmer.neu {
    fill: var(--zimmer-neu);
}

.zimmer-aussen {
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.zimmer-label {
    font-size: 14px;
    fill: white;
    pointer-events: none;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-content {
    background: var(--bg-secondary);
    margin: 2% auto;
    padding: 2.25rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border);
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0.25rem;
}

.close:hover {
    color: var(--text-primary);
}

.formular h3, .historie h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.formular h3::after, .historie h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.formular, .historie {
    margin-top: 1.5rem;
}

.formular form {
    display: grid;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
    line-height: 1.5;
}

.form-group input {
    min-height: 48px;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.historie-eintrag {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--accent);
    transition: transform 0.2s, box-shadow 0.2s;
}

.historie-eintrag:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.historie-eintrag .datum {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.historie-eintrag .kategorie {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.historie-eintrag .beschreibung {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
}

.historie-eintrag .fotos {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.historie-eintrag .fotos img {
    max-width: 120px;
    max-height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border);
    transition: transform 0.2s;
}

.historie-eintrag .fotos img:hover {
    transform: scale(1.05);
}

.legende {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.legende-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legende-farbe {
    width: 24px;
    height: 16px;
    border-radius: 4px;
}

.legende-farbe.frei { background: var(--zimmer-frei); }
.legende-farbe.belegt { background: var(--zimmer-belegt); }
.legende-farbe.neu { background: var(--zimmer-neu); }

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.bild-upload-vorschau {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.bild-upload-vorschau img {
    max-width: 80px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-input-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.file-input-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.page-header .actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.125rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
}

tr:hover td {
    background: var(--bg-tertiary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-user {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .startseite h2 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

[data-theme="dark"] .zimmer-label {
    fill: white;
}

[data-theme="dark"] .zimmer-aussen {
    stroke: var(--text-secondary);
}

/* Landingpage Styles */
.landing-page {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.hero-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.hero-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.6s ease-out;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.haus-auswahl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.haus-karte {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out both;
}

.haus-karte::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.haus-karte:nth-child(1) {
    animation-delay: 0.2s;
}

.haus-karte:nth-child(2) {
    animation-delay: 0.35s;
}

.haus-karte:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
    border-color: var(--accent);
}

.haus-karte:hover::before {
    transform: scaleX(1);
}

.haus-karte h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.haus-karte h3 svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.haus-karte .haus-info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.haus-karte .zimmer-anzahl {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.haus-karte a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.haus-karte a:hover {
    background: var(--accent-hover);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    color: white;
}

.haus-karte a svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.haus-karte a:hover svg {
    transform: translateX(4px);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    padding: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.landing-footer {
    text-align: center;
    margin-top: auto;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

/* Background pattern */
.landing-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.landing-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, -2%); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .haus-auswahl {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1.5rem;
    }
}
