/* WannZeit - Globale Styles */

:root {
    --color-bg-primary: #3C4044;
    --color-bg-secondary: #DDDCDB;
    --color-accent-primary: #FD7B41;
    --color-accent-secondary: #EDBF9B;

    /* Angepasste Farben für den dunklen Modus */
    --color-bg-dark: #1a1a2e;
    --color-bg-card: #2a2d3a;
    --color-bg-input: #1f2128;
    --color-border: #3a3d4a;

    /* Text Farben */
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #b0b0b0;
    --color-text-muted: #888888;

    /* Status Farben */
    --color-success: #2ed573;
    --color-error: #ff6b6b;
    --color-warning: #ffb142;

    /* Transparenzen */
    --accent-alpha-10: rgba(253, 123, 65, 0.1);
    --accent-alpha-20: rgba(253, 123, 65, 0.2);
    --accent-alpha-30: rgba(253, 123, 65, 0.3);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-primary) 100%);
    min-height: 100vh;
    color: var(--color-text-primary);
}

/* Navbar */
.navbar {
    background: var(--color-bg-card);
    padding: 20px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    color: var(--color-accent-primary);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.user-name {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color-accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #e66d31;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 123, 65, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-accent-primary);
    color: var(--color-accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-alpha-10);
}

.btn-profile {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--color-accent-primary);
    border-radius: 6px;
    color: var(--color-accent-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-profile:hover {
    background: var(--accent-alpha-10);
    transform: translateY(-1px);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--color-accent-primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #e66d31;
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    border: 2px solid var(--color-error);
    color: var(--color-error);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.1);
}

.btn-edit {
    background: var(--color-warning);
    color: white;
}

.btn-edit:hover {
    background: #ffa726;
    transform: translateY(-2px);
}

.btn-delete {
    background: var(--color-error);
    color: white;
}

.btn-delete:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card h3 {
    font-size: 18px;
    color: var(--color-accent-primary);
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    background: var(--color-bg-primary);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
}

select option {
    background: var(--color-bg-input);
    color: var(--color-text-primary);
}

input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Messages */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid var(--color-error);
    color: #ff6b81;
}

.success-message {
    background: rgba(46, 213, 115, 0.2);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

/* Links */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--color-accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.link-text {
    text-align: center;
    margin-top: 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.link-text a,
.auth-links a {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.link-text a:hover,
.auth-links a:hover {
    text-decoration: underline;
}

.auth-links {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal h3 {
    font-size: 24px;
    color: var(--color-accent-primary);
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Badges */
.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-owner {
    background: var(--accent-alpha-20);
    color: var(--color-accent-primary);
}

.role-moderator {
    background: rgba(255, 177, 66, 0.2);
    color: var(--color-warning);
}

.role-member {
    background: rgba(46, 213, 115, 0.2);
    color: var(--color-success);
}

/* Kalender */
.calendar-day {
    aspect-ratio: 1;
    padding: 8px;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 80px;
}

.calendar-day:hover {
    border-color: var(--color-accent-primary);
    transform: scale(1.05);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: var(--color-success);
    background: rgba(46, 213, 115, 0.1);
}

.day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.day-blocked-count {
    font-size: 11px;
    color: var(--color-text-muted);
}

.heatmap-indicator {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.heatmap-0 {
    background: transparent;
}

.heatmap-1 {
    background: rgba(253, 123, 65, 0.3);
}

.heatmap-2 {
    background: rgba(253, 123, 65, 0.5);
}

.heatmap-3 {
    background: rgba(253, 123, 65, 0.7);
}

.heatmap-4 {
    background: rgba(253, 123, 65, 0.9);
}

.heatmap-5 {
    background: var(--color-accent-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

/* Navbar Buttons */
.show-mobile {
    display: none;
}

.btn-admin {
    padding: 10px 20px;
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-admin:hover {
    background: rgba(52, 199, 89, 0.2);
}

.btn-profile,
.btn-logout {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 380px;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-text {
    line-height: 1.4;
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-success .toast-icon {
    color: var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-error);
}

.toast-error .toast-icon {
    color: var(--color-error);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-warning .toast-icon {
    color: var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-accent-primary);
}

.toast-info .toast-icon {
    color: var(--color-accent-primary);
}

/* Confirm Modal */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-overlay.confirm-visible {
    opacity: 1;
}

.confirm-dialog {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-visible .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-primary);
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        max-width: 100%;
    }

    .navbar {
        padding: 16px 20px;
    }

    .container {
        padding: 0 16px;
    }

    .modal-content {
        padding: 24px;
    }

    .navbar .user-info {
        display: none;
    }

    .navbar h1 {
        font-size: 18px;
    }

    .navbar-right {
        gap: 8px;
    }

    .btn-profile,
    .btn-logout {
        padding: 6px 10px;
        font-size: 13px;
    }

    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: inline;
    }

    .btn-admin,
    .btn-profile,
    .btn-logout {
        padding: 8px 12px;
        font-size: 18px;
        height: 40px;
    }
}

/* Flatpickr Custom Styling */
.flatpickr-input {
    cursor: pointer;
}

.flatpickr-calendar {
    background: var(--color-bg-card) !important;
    border: 2px solid var(--color-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    border-radius: 12px !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--color-accent-primary) !important;
    border-color: var(--color-accent-primary) !important;
}

.flatpickr-day.inRange {
    background: var(--accent-alpha-20) !important;
    border-color: transparent !important;
    box-shadow: -5px 0 0 var(--accent-alpha-20), 5px 0 0 var(--accent-alpha-20) !important;
}

.flatpickr-day:hover {
    background: var(--accent-alpha-10) !important;
    border-color: var(--color-accent-primary) !important;
}

.flatpickr-day.today {
    border-color: var(--color-success) !important;
}

.flatpickr-day.today:hover,
.flatpickr-day.today.selected {
    border-color: var(--color-accent-primary) !important;
}

.flatpickr-months {
    background: var(--color-bg-primary) !important;
    border-radius: 12px 12px 0 0 !important;
}

.flatpickr-current-month {
    color: var(--color-text-primary) !important;
}

.flatpickr-weekday {
    color: var(--color-text-secondary) !important;
}

.flatpickr-day {
    color: var(--color-text-primary) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--color-text-muted) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--color-accent-primary) !important;
}

span.flatpickr-weekday {
    background: var(--color-bg-primary) !important;
}

/* --- Tabs (shared component) --- */
.tabs,
.tab-header {
    margin-bottom: 24px;
    border-bottom: 2px solid var(--accent-alpha-20);
}

.tabs {
    display: flex;
    gap: 0;
}

.tab-buttons {
    display: flex;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--color-text-primary);
    background: var(--accent-alpha-10);
}

.tab-btn.active {
    color: var(--color-accent-primary);
    border-bottom-color: var(--color-accent-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}