/* =========================================
   STYLE.CSS - FINAL PRODUCTION VERSION
   ========================================= */

/* --- 1. GLOBAL RESET & BASE --- */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #000000; /* Tiefschwarz für OLED/Dark Mode */
    color: #ffffff;
    overflow: hidden; /* Verhindert "Bounce"-Effekt */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    touch-action: manipulation; 
}

#root {
    height: 100%;
    width: 100%;
    background-color: #000000;
}

/* Verhindert Scrollen, wenn Modal offen ist */
body.modal-open {
    overflow: hidden !important;
}

/* --- 2. VIEW MANAGEMENT (SPA LOGIK) --- */
.view-container {
    display: none;
    height: 100%;
    width: 100%;
    background-color: #000000;
}

.view-container.active {
    display: flex;
}

.customer-page, .admin-page {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease-out forwards;
}

.customer-page.active, .admin-page.active {
    display: block;
}

/* Spezialfall: Chat Container muss die volle Höhe füllen */
#page-customer-chat.customer-page.active,
#page-admin-chat-convo.admin-page.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- 3. MODALS --- */
.modal-container {
    display: none;
    transform: translateZ(0); 
}

.modal-container.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

/* --- 4. UTILITIES & ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Scrollbar Verstecken (UI Cleanliness) */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Custom Dark Scrollbar (wo nötig) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: #000000; 
}
::-webkit-scrollbar-thumb {
    background: #333333; 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555555; 
}

/* --- 5. BROWSER FIXES --- */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #000000 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: white;
}

* {
    -webkit-tap-highlight-color: transparent;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

#qr-reader video {
    object-fit: cover;
    border-radius: 1rem;
}

/* --- 6. CALENDAR & BOOKING STYLES --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: #a1a1aa;
    background-color: #18181b;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #27272a;
}

.calendar-day:hover:not(.blocked):not(.past):not(.invisible) {
    background-color: #27272a;
    color: white;
    transform: scale(1.05);
    border-color: #52525b;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #f97316, #db2777);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.calendar-day.today {
    border: 2px solid #f97316;
    color: white;
}

/* Blockierte Tage (Admin oder belegt) */
.calendar-day.blocked {
    background-color: #2a0a0a; /* Sehr dunkles Rot */
    color: #7f1d1d; 
    cursor: not-allowed;
    border-color: #450a0a;
}

/* Vergangene Tage */
.calendar-day.past {
    opacity: 0.3;
    cursor: default;
    background: transparent;
    border: 1px solid #27272a;
    color: #52525b;
}

.calendar-day.invisible {
    visibility: hidden;
    pointer-events: none;
}

/* Time Slots */
.time-slot {
    padding: 1rem;
    background-color: #18181b;
    border: 1px solid #27272a;
    border-radius: 1rem;
    text-align: center;
    font-weight: bold;
    color: #d4d4d8;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover {
    border-color: #f97316;
    color: white;
    background-color: #27272a;
}

.time-slot.selected {
    background: linear-gradient(135deg, #f97316, #db2777);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* --- 7. SCHNEE EFFEKT --- */
.snowflake {
    position: absolute;
    top: -10px;
    background-color: white;
    border-radius: 50%;
    pointer-events: none; /* WICHTIG: Klickbar bleiben */
    z-index: 1; 
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: snowfall linear forwards;
}

@keyframes snowfall {
    0% {
        transform: translateY(-10vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(20px); /* Drift nach rechts */
        opacity: 0.2;
    }
}

/* --- 8. ADMIN TERMIN TABELLE --- */
#admin-appointments-table-body tr:last-child td {
    border-bottom: none;
}

#admin-appointments-table-body tr td {
    vertical-align: middle;
}

/* Responsive Table Container */
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar für die Tabelle */
.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
}
.overflow-x-auto::-webkit-scrollbar-track {
    background: #000;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}