/**
 * DIRS21 Booking Widget CSS
 * Styling für das fixierte Buchungswidget am Bildschirmrand
 */

/* CSS-Variablen für dynamische Anpassung */
:root {
    --dirs21-button-color: #C59E5B;
    --dirs21-button-size: 48px;
    --dirs21-button-hover-color: #B8935A;
    --dirs21-button-text-color: #ffffff;
    --dirs21-z-index: 1000;
}

/* Haupt-Widget-Container */
#dirs21-booking-widget {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: var(--dirs21-button-size);
    height: var(--dirs21-button-size);
    line-height: var(--dirs21-button-size);
    text-align: center;
    background-color: var(--dirs21-button-color);
    color: var(--dirs21-button-text-color);
    text-decoration: none;
    border: none;
    border-radius: 4px 0 0 4px;
    z-index: var(--dirs21-z-index);
    transition: all 0.3s ease;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* Hide any text content */
}

/* Hover-Effekte */
#dirs21-booking-widget:hover {
    background-color: var(--dirs21-button-hover-color);
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);
}

#dirs21-booking-widget:focus {
    outline: 2px solid var(--dirs21-button-text-color);
    outline-offset: 2px;
}

/* Kalender-Icon */
.dirs21-calendar-icon {
    display: inline-block;
    font-family: 'icons', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', Arial, sans-serif;
    font-size: 20px;
    line-height: 1;
    color: var(--dirs21-button-text-color);
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    speak: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Icon-Content - Theme-kompatible Icons */
.dirs21-calendar-icon::before {
    content: '\1f4c5'; /* Unicode Calendar Emoji - funktioniert mit Theme-Icons */
    margin: 0;
    color: inherit;
}

/* Theme-Icon-Fallbacks für bessere Kompatibilität */
.dirs21-calendar-icon::before {
    /* Verwende das Theme's 'icons' Font-Family als Hauptoption */
    font-family: 'icons', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', system-ui, sans-serif;
}

/* FontAwesome Fallback wenn verfügbar */
.fa .dirs21-calendar-icon::before,
body.fa .dirs21-calendar-icon::before {
    content: '\f073';
    font-family: 'Font Awesome 5 Free', 'FontAwesome', sans-serif;
    font-weight: 900;
}

/* Dashicons Fallback (WordPress Admin) */
.wp-admin .dirs21-calendar-icon::before,
body.wp-admin .dirs21-calendar-icon::before {
    content: '\f145';
    font-family: 'Dashicons', sans-serif;
    font-weight: normal;
}

/* Material Icons Fallback */
.material-icons .dirs21-calendar-icon::before,
body.material-icons .dirs21-calendar-icon::before {
    content: 'calendar_today';
    font-family: 'Material Icons', sans-serif;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
}

/* Emoji Fallback für alle anderen Fälle */
@supports not (font-family: 'icons') {
    .dirs21-calendar-icon::before {
        content: '📅';
        font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', system-ui, sans-serif;
    }
}

/* Position Links (Alternative) */
.dirs21-position-left #dirs21-booking-widget {
    left: 0;
    right: auto;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.dirs21-position-left #dirs21-booking-widget:hover {
    transform: translateY(-50%) translateX(5px);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
    #dirs21-booking-widget {
        width: 44px;
        height: 44px;
        line-height: 44px;
        font-size: 18px;
    }
    
    .dirs21-calendar-icon {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    #dirs21-booking-widget {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 16px;
        right: 5px;
    }
    
    .dirs21-position-left #dirs21-booking-widget {
        left: 5px;
        right: auto;
    }
    
    .dirs21-calendar-icon {
        font-size: 16px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #dirs21-booking-widget {
        border: 2px solid var(--dirs21-button-text-color);
        background-color: var(--dirs21-button-color);
    }
    
    #dirs21-booking-widget:hover,
    #dirs21-booking-widget:focus {
        background-color: var(--dirs21-button-text-color);
        color: var(--dirs21-button-color);
        border-color: var(--dirs21-button-color);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #dirs21-booking-widget {
        transition: none;
    }
    
    #dirs21-booking-widget:hover {
        transform: translateY(-50%);
    }
    
    .dirs21-position-left #dirs21-booking-widget:hover {
        transform: translateY(-50%);
    }
}

/* Print Styles - Hide Widget */
@media print {
    #dirs21-booking-widget {
        display: none !important;
    }
}

/* Accessibility: Screen Reader Only Text */
.dirs21-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation für sanftes Erscheinen */
@keyframes dirs21FadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.dirs21-position-left #dirs21-booking-widget {
    animation: dirs21FadeIn 0.5s ease-out;
}

@keyframes dirs21FadeInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

#dirs21-booking-widget {
    animation: dirs21FadeIn 0.5s ease-out;
}

/* RTL Support */
[dir="rtl"] #dirs21-booking-widget {
    left: 0;
    right: auto;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

[dir="rtl"] #dirs21-booking-widget:hover {
    transform: translateY(-50%) translateX(5px);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
}

[dir="rtl"] .dirs21-position-left #dirs21-booking-widget {
    right: 0;
    left: auto;
    border-radius: 4px 0 0 4px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
}

[dir="rtl"] .dirs21-position-left #dirs21-booking-widget:hover {
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);
}