/**
 * ORIENTIERUNGS-MODAL CSS
 * =======================
 * Responsive Styling für das Orientierungs-Modal
 * Kompakt, 200x200px, etwa 20% des Bildschirms
 * Mit verständlichen Icons und sanften Animationen
 */

/* ===== ORIENTIERUNGS-MODAL STYLES ===== */

/* Backdrop/Overlay für Blur-Effekt */
.orientation-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001; /* Above navbar and overlays */
    
    /* Backdrop Blur */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    /* Semi-transparenter Overlay */
    background: rgba(0, 0, 0, 0.3);
    
    /* Anfangszustand */
    opacity: 0;
    visibility: hidden;
    
    /* Animationen */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    /* Touch-optimiert */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Sichtbarer Backdrop */
.orientation-modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Block interactions behind */
}

.orientation-modal {
    /* Positionierung */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002; /* Above navbar */
    
    /* Größe - 250x250px, ca. 35% des Bildschirms */
    width: 250px;
    height: 250px;
    max-width: 35vw;
    max-height: 35vh;
    min-width: 150px;
    min-height: 150px;
    
    /* Styling */
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border: 3px solid #fff;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    
    /* Backdrop Blur Effekt */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Flexbox für Inhalt */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Anfangszustand */
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.5);
    
    /* Animationen */
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Touch-optimiert */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* Sichtbarer Zustand */
.orientation-modal.visible {
    opacity: 1;
    visibility: visible;
}

.orientation-modal.show-animation {
    transform: translate(-50%, -50%) scale(1);
}

/* Versteckter Zustand */
.orientation-modal.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.5);
}

/* Modal Content Container */
.orientation-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 15px;
    box-sizing: border-box;
}

/* Orientierungs-Icon */
.orientation-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Orientierungs-Bild */
.orientation-image {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Macht das Bild weiß */
}

/* Portrait Handy (links) - Falls noch verwendet */
.phone-portrait {
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Pfeil zwischen den Handys */
.arrow {
    display: inline-block;
    font-size: 1.8rem;
    opacity: 0.8;
}

/* Landscape Handy (rechts) - um 90 Grad gedreht */
.phone-landscape {
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

/* Text-Bereiche */
.orientation-text {
    margin-bottom: 8px;
}

.orientation-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.orientation-subtitle {
    font-size: 11px;
    opacity: 0.9;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Pfeil-Icon */
.orientation-arrow {
    font-size: 1.8rem;
    opacity: 0.8;
    animation: pulse-arrow 1.5s ease-in-out infinite;
    line-height: 1;
}

/* Animationen */
@keyframes rotate-hint {
    0% { 
        transform: scale(1); 
    }
    25% { 
        transform: scale(1.05); 
    }
    50% { 
        transform: scale(1); 
    }
    75% { 
        transform: scale(1.05); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* Spezielle Animation für die Handys */
@keyframes phone-wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg) scale(1.05); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(5deg) scale(1.05); }
    100% { transform: rotate(0deg); }
}

@keyframes phone-landscape-wiggle {
    0% { transform: rotate(90deg); }
    25% { transform: rotate(85deg) scale(1.05); }
    50% { transform: rotate(90deg); }
    75% { transform: rotate(95deg) scale(1.05); }
    100% { transform: rotate(90deg); }
}

/* Animationen für die einzelnen Handy-Icons */
.phone-portrait {
    animation: phone-wiggle 2s ease-in-out infinite;
}

.phone-landscape {
    animation: phone-landscape-wiggle 2s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0% { 
        opacity: 0.8; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
    100% { 
        opacity: 0.8; 
        transform: scale(1); 
    }
}

/* ===== RESPONSIVE ANPASSUNGEN ===== */

/* Kleine Mobile Geräte (Portrait) */
@media (max-width: 480px) and (orientation: portrait) {
    .orientation-modal {
        width: 200px;
        height: 200px;
        max-width: 45vw;
        max-height: 35vh;
        border-radius: 15px;
    }
    
    .orientation-modal-content {
        padding: 12px;
    }
    
    .orientation-icon {
        font-size: 2rem;
    }
    
    .orientation-image {
        max-width: 60px;
        max-height: 60px;
    }
    
    .orientation-title {
        font-size: 12px;
    }
    
    .orientation-subtitle {
        font-size: 10px;
    }
    
    .orientation-arrow {
        font-size: 1.5rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 360px) {
    .orientation-modal {
        width: 180px;
        height: 180px;
        max-width: 50vw;
        max-height: 40vh;
    }
    
    .orientation-icon {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }
    
    .orientation-image {
        max-width: 50px;
        max-height: 50px;
    }
    
    .orientation-title {
        font-size: 11px;
    }
    
    .orientation-subtitle {
        font-size: 9px;
    }
    
    .orientation-arrow {
        font-size: 1.3rem;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .orientation-modal {
        width: 280px;
        height: 280px;
        max-width: 35vw;
        max-height: 40vh;
    }
    
    .orientation-icon {
        font-size: 3rem;
    }
    
    .orientation-image {
        max-width: 100px;
        max-height: 100px;
    }
    
    .orientation-title {
        font-size: 16px;
    }
    
    .orientation-subtitle {
        font-size: 12px;
    }
    
    .orientation-arrow {
        font-size: 2rem;
    }
}

/* Desktop - Modal wird ausgeblendet (nur für mobile Geräte gedacht) */
@media (min-width: 1025px) {
    .orientation-modal {
        display: none !important; /* Komplett ausblenden auf Desktop */
    }
}

/* ===== ACCESSIBILITY & PREFERENCES ===== */

/* Respektiere Benutzer-Präferenzen für reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
    .orientation-modal {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    .orientation-icon,
    .orientation-arrow {
        animation: none;
    }
    
    .orientation-modal.show-animation {
        transform: translate(-50%, -50%) scale(1);
        transition: opacity 0.2s ease;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .orientation-modal {
        background: #000;
        border: 3px solid #fff;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
    }
    
    .orientation-title,
    .orientation-subtitle {
        text-shadow: none;
    }
}

/* Dark Mode Anpassungen */
@media (prefers-color-scheme: dark) {
    .orientation-modal {
        background: linear-gradient(135deg, #1a1a1a, #333333);
        border-color: #555;
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    }
}

/* ===== BODY BLUR EFFEKT ===== */

/* Body Blur wenn Modal aktiv */
body.orientation-modal-active {
    overflow: hidden; /* Verhindert Scrolling */
}

/* Hauptinhalt Blur */
body.orientation-modal-active > *:not(.orientation-modal):not(.orientation-modal-backdrop) {
    filter: blur(4px);
    -webkit-filter: blur(4px);
    transition: filter 0.3s ease;
    pointer-events: none; /* Verhindert Interaktion mit verschwommenem Inhalt */
}

/* Extra safety: explicitly blur main containers even if not direct children */
body.orientation-modal-active .navbar,
body.orientation-modal-active .nav-container,
body.orientation-modal-active .main-content,
body.orientation-modal-active .status-bar,
body.orientation-modal-active .status-bar-container,
body.orientation-modal-active .container {
    filter: blur(4px) !important;
    -webkit-filter: blur(4px) !important;
    pointer-events: none !important;
}

/* Fallback für ältere Browser ohne backdrop-filter */
@supports not (backdrop-filter: blur(8px)) {
    .orientation-modal-backdrop {
        background: rgba(0, 0, 0, 0.6); /* Stärkerer Overlay */
    }
}

/* ===== SPEZIELLE ORIENTIERUNGS-ANZEIGEN ===== */

/* Portrait-spezifische Anpassungen */
@media (orientation: portrait) {
    .orientation-modal {
        /* Etwas größer in Portrait für bessere Sichtbarkeit */
        max-width: 25vw;
        max-height: 20vh;
    }
}

/* Landscape-spezifische Anpassungen (normalerweise versteckt) */
@media (orientation: landscape) {
    .orientation-modal {
        /* Smaller in landscape (normalerweise nicht sichtbar) */
        max-width: 15vw;
        max-height: 25vh;
    }
}

/* ===== ALTERNATIVE ICONS FÜR VERSCHIEDENE GERÄTE ===== */

/* iPhone/iOS spezifische Icons */
.orientation-modal.ios .orientation-icon {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Android spezifische Icons */
.orientation-modal.android .orientation-icon {
    font-family: 'Roboto', sans-serif;
}

/* ===== PRINT STYLES ===== */

@media print {
    .orientation-modal {
        display: none !important;
    }
}