/* IOS/Mobile Optimizations */

/* Disable double-tap zoom globally */
html, body {
  touch-action: manipulation;
}

/* Disable user selection for 'app-like' feel on mobile */
/* We apply this to body but allow it on inputs */
body {
    -webkit-touch-callout: none; /* Disable context menu */
    -webkit-user-select: none;   /* Disable selection/copy */
    user-select: none;
}

/* Re-enable selection for inputs and textareas */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* iOS Fake Fullscreen Fallback */
/* This class will be toggled on the body or a specific container to maximize it */
body.ios-fullscreen-active #android-bar,
body.ios-fullscreen-active .sticky-footer,
body.ios-fullscreen-active #nav-menu {
    display: none !important;
}

body.ios-fullscreen-active .container {
    margin-top: 0 !important;
    padding-top: 20px; /* Safe area padding if needed */
    height: 100vh;
    overflow-y: auto;
}

/* Optional: hide other elements if we want purely the camera grid */
/* body.ios-fullscreen-active .weather-status,
body.ios-fullscreen-active .settings-menu {
    display: none !important;
} */

/* Ensure the floating close/exit button is visible in ios-fullscreen mode */
#ios-exit-fullscreen-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 1px solid white;
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
}

body.ios-fullscreen-active #ios-exit-fullscreen-btn {
    display: flex;
}

/* iOS Add to Home Screen Prompt */
.ios-pwa-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(30,30,46, 0.95);
    color: white;
    padding: 15px;
    border-radius: 12px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: none; /* JS will toggle */
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideUp 0.5s ease;
}

.ios-pwa-prompt.show {
    display: flex;
}

.ios-pwa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.ios-pwa-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
}

.ios-pwa-instructions {
    font-size: 14px;
    color: #ddd;
    line-height: 1.4;
}

.ios-pwa-instructions i {
    color: #007aff; /* iOS Blue */
    font-size: 18px;
    margin: 0 5px;
}

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