/**
 * Kiosk Styles
 * Chrome 81 compatible - no CSS custom property fallbacks with var()
 */

/* CSS Variables */
:root {
    --bg-color: #1a1a2e;
    --text-color: #ffffff;
    --btn-bg-color: #16213e;
    --btn-text-color: #ffffff;
    --btn-radius: 0.8vmin;
    --btn-hover-opacity: 0.85;
    --transition-speed: 0.2s;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: transparent;
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Background layers - standard pattern (z-index 0, 0, 1) */
#bgimage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#bgvideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
    display: none;
}

#bgcolor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Main App Container - z-index 2 above background layers */
#kiosk-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 2vmin;
    position: relative;
    z-index: 2;
}

/* Header - clock/date in top-right corner */
#kiosk-header {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2vmin;
    z-index: 10;
}

#header-info {
    text-align: right;
}

/* Centered logo in main content */
#kiosk-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2vmin;
}

#kiosk-logo img,
#logo-img {
    max-height: 15vmin;  /* Default, overridden by JS */
    max-width: 80vw;
    object-fit: contain;
}

/* Message between logo and buttons */
#kiosk-message {
    font-size: 2.5vmin;
    text-align: center;
    padding: 1vmin 2vmin;
    color: inherit;
    white-space: pre-wrap;
    max-width: 80%;
    margin-bottom: 2vmin;
}

/* Legacy header clock/date (not used when footer is enabled) */
#clock {
    font-size: 3vmin;
    font-weight: 600;
    letter-spacing: 0.05em;
}

#date {
    font-size: 1.8vmin;
    opacity: 0.8;
    text-transform: capitalize;
}

/* Content Area */
#kiosk-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2vmin;
    overflow: hidden;
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading Screen */
#loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 6vmin;
    height: 6vmin;
    border: 0.4vmin solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Buttons Container */
/* Note: gap not supported in Chrome 81 flexbox - use margins on children */
#buttons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    padding: 2vmin;
    margin: -1vmin;  /* Offset for child margins */
}

/* Kiosk Button */
.kiosk-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 20vmin;
    min-height: 15vmin;
    padding: 3vmin 4vmin;
    margin: 1vmin;  /* Replaces gap */
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    border: none;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: transform var(--transition-speed), opacity var(--transition-speed);
    font-family: inherit;
}

/* Button color presets - match editor2 CSS variables */
.kiosk-btn.color-primary { background-color: #2563eb; color: #ffffff; }
.kiosk-btn.color-secondary { background-color: #64748b; color: #ffffff; }
.kiosk-btn.color-success { background-color: #16a34a; color: #ffffff; }
.kiosk-btn.color-warning { background-color: #f59e0b; color: #000000; }
.kiosk-btn.color-danger { background-color: #dc2626; color: #ffffff; }
.kiosk-btn.color-info { background-color: #0891b2; color: #ffffff; }

/* Button size variations */
.kiosk-btn.size-small {
    min-width: 15vmin;
    min-height: 12vmin;
    padding: 2vmin 3vmin;
}

.kiosk-btn.size-small .btn-icon svg {
    width: 4vmin;
    height: 4vmin;
}

.kiosk-btn.size-small .btn-label {
    font-size: 1.6vmin;
}

.kiosk-btn.size-medium {
    min-width: 22vmin;
    min-height: 16vmin;
    padding: 3vmin 4vmin;
}

.kiosk-btn.size-medium .btn-icon svg {
    width: 6vmin;
    height: 6vmin;
}

.kiosk-btn.size-medium .btn-label {
    font-size: 2vmin;
}

.kiosk-btn.size-large {
    min-width: 28vmin;
    min-height: 20vmin;
    padding: 4vmin 5vmin;
}

.kiosk-btn.size-large .btn-icon svg {
    width: 8vmin;
    height: 8vmin;
}

.kiosk-btn.size-large .btn-label {
    font-size: 2.4vmin;
}

.kiosk-btn:hover,
.kiosk-btn:focus {
    opacity: var(--btn-hover-opacity);
    transform: scale(1.02);
}

.kiosk-btn:active {
    transform: scale(0.98);
}

.kiosk-btn .btn-icon {
    font-size: 4vmin;
    margin-bottom: 1vmin;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-btn .btn-icon svg {
    width: 6vmin;
    height: 6vmin;
}

.kiosk-btn .btn-label {
    font-size: 2vmin;
    font-weight: 500;
    text-align: center;
}

/* Button outside schedule (editor preview only) */
.kiosk-btn.schedule-inactive {
    opacity: 0.4;
    position: relative;
}

.kiosk-btn.schedule-inactive::after {
    content: '';
    position: absolute;
    top: 0.5vmin;
    right: 0.5vmin;
    width: 2vmin;
    height: 2vmin;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.no-buttons {
    font-size: 2vmin;
    opacity: 0.6;
}

/* Page View - Full screen, no backdrop */
#view-page {
    padding: 3vmin;
    background-color: transparent;
}

/* Page Modal - Fills most of the screen for readability */
.page-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 2vmin;
    width: 94vw;
    max-width: 94vw;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 2vmin 8vmin rgba(0, 0, 0, 0.4);
}

.page-modal-close {
    position: absolute;
    top: 2vmin;
    right: 2vmin;
    width: 5vmin;
    height: 5vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #374151;
    transition: background-color 0.2s, transform 0.2s;
    z-index: 10;
}

.page-modal-close:hover {
    background-color: #e5e7eb;
    transform: scale(1.1);
}

.page-modal-close svg {
    width: 2.5vmin;
    height: 2.5vmin;
}

.page-modal-title {
    padding: 4vmin 5vmin 0 5vmin;
    margin: 0;
    font-size: 3vmin;
    font-weight: 600;
    color: #111827;
}

#page-content {
    flex: 1;
    overflow-y: auto;
    padding: 3vmin 5vmin 5vmin 5vmin;
    padding-right: 10vmin;
    color: #1f2937;
}

#page-content h1,
#page-content h2,
#page-content h3 {
    margin-bottom: 0.75em;
    color: #111827;
}

#page-content p {
    margin-bottom: 1em;
}

#page-content ul,
#page-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

/* Doorbell Status (sending, complete, cooldown) */
.doorbell-status {
    text-align: center;
    padding: 4vmin;
    max-width: 50vmin;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 1.2vmin;
}

.doorbell-status h2 {
    margin-bottom: 2vmin;
}

.doorbell-status p {
    font-size: 2.2vmin;
    opacity: 0.9;
    margin-bottom: 1vmin;
}

.cooldown-icon {
    width: 10vmin;
    height: 10vmin;
    line-height: 10vmin;
    font-size: 4vmin;
    background-color: #f39c12;
    color: white;
    border-radius: 50%;
    margin: 0 auto 3vmin;
}

.cooldown-time {
    font-size: 2.5vmin;
    font-weight: 600;
    color: #f39c12;
}

/* Generic Buttons */
.btn {
    flex: 1;
    padding: 1.5vmin 3vmin;
    font-size: 2vmin;
    font-weight: 500;
    border: none;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: opacity var(--transition-speed);
    font-family: inherit;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 0.1vmin solid var(--text-color);
}

/* Success Icon */
.success-icon {
    width: 10vmin;
    height: 10vmin;
    line-height: 10vmin;
    font-size: 4vmin;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    margin: 0 auto 3vmin;
}

/* Feedback View */
#view-feedback {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2vmin;
}

#view-feedback h2 {
    margin-bottom: 6vmin;
    font-size: 5vmin;
    text-align: center;
}

/* Note: gap not supported in Chrome 81 flexbox - use margins on children */
.feedback-buttons {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 90vw;
    padding: 0 2vmin;
}

.feedback-buttons > * {
    margin-left: 3vmin;
}

.feedback-buttons > *:first-child {
    margin-left: 0;
}

.feedback-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vmin;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 2vmin;
    cursor: pointer;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
    color: var(--text-color);
}

.feedback-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.feedback-btn .emoji {
    font-size: 12vmin;
    line-height: 1;
}

/* Feedback Thank You View */
.feedback-thanks-content {
    text-align: center;
    padding: 4vmin;
}

.feedback-thanks-content .emoji {
    font-size: 15vmin;
    display: block;
    margin-bottom: 3vmin;
}

.feedback-thanks-content h2 {
    font-size: 5vmin;
    margin: 0;
}

/* Error View */
.error-content {
    text-align: center;
    padding: 4vmin;
}

.error-content h2 {
    margin-bottom: 2vmin;
    color: #ff6b6b;
}

.error-content p {
    margin-bottom: 3vmin;
    opacity: 0.8;
}

/* Footer - part of flex layout, pushes content up */
/* Negative margin to counteract #kiosk-app padding and stretch to edges */
#kiosk-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2vmin 3vmin;
    margin: 0 -2vmin -2vmin -2vmin;
    background-color: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    z-index: 10;
    min-height: 8vmin;
}

.footer-left,
.footer-right {
    flex: 0 0 auto;
    min-width: 12vmin;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.footer-right > * {
    margin-left: 1vmin;
}

.footer-right > *:first-child {
    margin-left: 0;
}

.footer-center {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer datetime group (left side) - vertical layout with date below clock */
.footer-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

/* Footer clock - larger, bold */
#footer-clock {
    font-size: 2.5vmin;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Footer date - smaller, below clock */
#footer-date {
    font-size: 1.4vmin;
    opacity: 0.7;
}

/* RSS Ticker */
#rss-ticker {
    width: 100%;
    max-width: 60vmin;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 1.8vmin;
    opacity: 0.9;
    text-align: center;
}

#rss-ticker .rss-item {
    display: inline-block;
}

#rss-ticker .rss-item.fade-in {
    animation: rss-fade-in 0.5s ease-in-out;
}

@keyframes rss-fade-in {
    from { opacity: 0; transform: translateY(1vmin); }
    to { opacity: 1; transform: translateY(0); }
}

/* RSS ticker hover effect for clickable items */
#rss-ticker .rss-item:hover {
    text-decoration: underline;
    opacity: 1;
}

/* RSS article in page modal (white background) */
.rss-article {
    padding: 2vmin 0;
}

.rss-article .rss-image {
    max-width: 100%;
    max-height: 40vh;
    object-fit: contain;
    margin-bottom: 3vmin;
    border-radius: 1vmin;
}

.rss-article .rss-meta {
    font-size: 1.6vmin;
    opacity: 0.7;
    margin-bottom: 2vmin;
    color: #6b7280;
}

.rss-article .rss-description {
    font-size: 2.5vmin;
    line-height: 1.6;
    margin-bottom: 3vmin;
    color: #374151;
}

.rss-article .rss-source {
    margin-top: 3vmin;
    padding-top: 2vmin;
    border-top: 1px solid #e5e7eb;
}

.rss-article .rss-source a,
.rss-article .rss-read-more-btn {
    color: #2563eb;
    font-size: 2vmin;
    text-decoration: none;
    display: inline-block;
    padding: 1.5vmin 3vmin;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 0.5vmin;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.rss-article .rss-source a:hover,
.rss-article .rss-read-more-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    text-decoration: none;
}

/* URL iframe inside page modal - full size */
.url-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* When page modal contains iframe, remove padding to maximize space */
#page-content:has(.url-iframe) {
    padding: 0;
}

/* Fallback for Chrome 81 (no :has support) - add class via JS */
#page-content.iframe-content {
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Footer action buttons - unified style for accessibility and language */
/* Note: Using vmin for all sizes (no px min-width/height) for proper scaling on kiosk displays */
.footer-action-btn {
    width: 5vmin;
    height: 5vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: 0.2vmin solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform var(--transition-speed), border-color var(--transition-speed);
}

.footer-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.footer-action-btn.active {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: currentColor;
}

/* Footer icon button (wheelchair) */
.footer-icon-btn {
    width: 5vmin;
    height: 5vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: 0.2vmin solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform var(--transition-speed), border-color var(--transition-speed);
}

.footer-icon-btn svg {
    width: 3vmin;
    height: 3vmin;
}

.footer-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.footer-icon-btn.active {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: currentColor;
}

/* Language flags container */
/* Note: gap not supported in Chrome 81 flexbox - use margins on children */
#language-flags {
    display: flex;
    align-items: center;
}

#language-flags > * {
    margin-left: 1.5vmin;
}

#language-flags > *:first-child {
    margin-left: 0;
}

/* Spacing between wheelchair button and language flags */
.footer-right > #btn-wheelchair {
    margin-right: 2vmin;
}

/* Language flag button - round, same size as wheelchair button */
.flag-btn {
    width: 5vmin;
    height: 5vmin;
    padding: 0;
    border: 0.2vmin solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.15);
    transition: background-color var(--transition-speed), transform var(--transition-speed), border-color var(--transition-speed);
}

.flag-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flag-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.flag-btn.active {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: currentColor;
}

/* Wheelchair mode - move content down for accessibility on tall touch screens */
body.wheelchair-mode #kiosk-content {
    justify-content: flex-end;
    padding-top: 40vh;
    padding-bottom: 4vmin;
}

/* In wheelchair mode, shrink logo and reduce spacing */
body.wheelchair-mode #kiosk-logo {
    margin-bottom: 2vmin;
}

body.wheelchair-mode #kiosk-logo img {
    max-height: 10vmin;
}

body.wheelchair-mode #buttons-container {
    max-height: 50vh;
    overflow-y: auto;
}

body.wheelchair-mode #kiosk-footer {
    padding: 2vmin 3vmin;
}

/* Visual indicator that wheelchair mode is active */
body.wheelchair-mode #btn-wheelchair {
    background-color: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

/* Legacy language selector - kept for backwards compatibility */
#language-selector {
    display: none;
}

/*
 * Responsive layouts
 * Note: Size values use vmin so they scale automatically.
 * These media queries only handle layout changes (e.g., column vs row).
 */

/* Portrait mode - stack feedback buttons vertically with best rating on top */
@media (max-aspect-ratio: 3/4) {
    .feedback-buttons {
        flex-direction: column-reverse;
        align-items: center;
    }

    .feedback-buttons > * {
        margin-left: 0;
        margin-bottom: 3vmin;
        width: 80%;
        max-width: 40vmin;
    }

    .feedback-buttons > *:first-child {
        margin-bottom: 0;
    }

    .feedback-btn .emoji {
        font-size: 15vmin;
    }
}

/* Closed/outside schedule view */
#view-closed {
    background-color: rgba(0, 0, 0, 0.95);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.closed-content {
    text-align: center;
    padding: 4vmin;
    max-width: 60vmin;
}

.closed-content h2 {
    font-size: 4vmin;
    margin-bottom: 2vmin;
    color: #ffffff;
}

.closed-content p {
    font-size: 2.5vmin;
    opacity: 0.8;
    color: #ffffff;
    white-space: pre-wrap;
}

/* Schedule indicator (preview mode) - top right corner */
.schedule-indicator {
    position: fixed;
    top: 1.5vmin;
    right: 1.5vmin;
    display: flex;
    align-items: center;
    padding: 1vmin 2vmin;
    background-color: rgba(243, 156, 18, 0.9);
    color: #ffffff;
    border-radius: 0.8vmin;
    font-size: 1.5vmin;
    z-index: 1000;
    box-shadow: 0 0.3vmin 1vmin rgba(0, 0, 0, 0.3);
}

.schedule-indicator svg {
    width: 2.5vmin;
    height: 2.5vmin;
    margin-right: 1vmin;
}

.schedule-indicator span {
    font-weight: 500;
}

/* Edit mode indicator and button styling */
body.edit-mode .kiosk-btn {
    cursor: pointer;
    position: relative;
}

body.edit-mode .kiosk-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px dashed rgba(59, 130, 246, 0.6);
    border-radius: inherit;
    pointer-events: none;
}

body.edit-mode .kiosk-btn:hover::after {
    border-color: rgba(59, 130, 246, 1);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Idle countdown overlay */
#idle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.idle-content {
    text-align: center;
    color: #ffffff;
}

.idle-countdown-ring {
    position: relative;
    width: 30vmin;
    height: 30vmin;
    margin: 0 auto 4vmin;
}

.idle-countdown-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.idle-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 4;
}

.idle-ring-progress {
    fill: none;
    stroke: var(--kiosk-primary, #3b82f6);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.idle-seconds {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12vmin;
    font-weight: 700;
    color: #ffffff;
}

#idle-message {
    font-size: 3.5vmin;
    margin-bottom: 3vmin;
    opacity: 0.9;
}

.idle-cancel-btn {
    background-color: var(--kiosk-primary, #3b82f6);
    color: #ffffff;
    border: none;
    padding: 2vmin 5vmin;
    font-size: 2.5vmin;
    font-weight: 600;
    border-radius: 1.5vmin;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.idle-cancel-btn:hover,
.idle-cancel-btn:active {
    transform: scale(1.05);
    background-color: var(--kiosk-primary-dark, #2563eb);
}

/* Pulse animation for cancel button */
@keyframes idle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.idle-cancel-btn {
    animation: idle-pulse 2s ease-in-out infinite;
}

.idle-cancel-btn:hover,
.idle-cancel-btn:active {
    animation: none;
}

/* ============================================
   Sidebar - Optional CMS content panel
   ============================================ */

/* Standard view with sidebar uses horizontal flex layout */
#view-standard {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* Without sidebar, main content is centered */
#kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2vmin;
}

/* Sidebar panel */
#kiosk-sidebar {
    width: 40vmin;
    min-width: 25vmin;
    max-width: 50vmin;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 2vmin;
    margin: 2vmin;
    margin-right: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0.5vmin 2vmin rgba(0, 0, 0, 0.15);
}

/* Sidebar content area */
.sidebar-content {
    flex: 1;
    padding: 3vmin;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 2vmin;
    line-height: 1.5;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Touch-friendly minimal scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Webkit scrollbar for touch screens */
.sidebar-content::-webkit-scrollbar {
    width: 0.8vmin;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 1vmin;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.25);
}

/* Sidebar content styling (similar to page modal) */
.sidebar-content h1,
.sidebar-content h2,
.sidebar-content h3 {
    margin-top: 0;
    margin-bottom: 1.5vmin;
    color: #111827;
}

.sidebar-content h1 { font-size: 3vmin; }
.sidebar-content h2 { font-size: 2.5vmin; }
.sidebar-content h3 { font-size: 2.2vmin; }

.sidebar-content p {
    margin-bottom: 1.5vmin;
}

.sidebar-content ul,
.sidebar-content ol {
    margin-bottom: 1.5vmin;
    padding-left: 3vmin;
}

.sidebar-content li {
    margin-bottom: 0.5vmin;
}

/* Sidebar background color variations via CSS variable */
#kiosk-sidebar.sidebar-dark {
    background-color: rgba(31, 41, 55, 0.95);
}

#kiosk-sidebar.sidebar-dark .sidebar-content {
    color: #f3f4f6;
}

#kiosk-sidebar.sidebar-dark .sidebar-content h1,
#kiosk-sidebar.sidebar-dark .sidebar-content h2,
#kiosk-sidebar.sidebar-dark .sidebar-content h3 {
    color: #ffffff;
}

#kiosk-sidebar.sidebar-transparent {
    background-color: rgba(255, 255, 255, 0.7);
}

#kiosk-sidebar.sidebar-transparent-dark {
    background-color: rgba(31, 41, 55, 0.7);
}

#kiosk-sidebar.sidebar-transparent-dark .sidebar-content {
    color: #f3f4f6;
}

#kiosk-sidebar.sidebar-transparent-dark .sidebar-content h1,
#kiosk-sidebar.sidebar-transparent-dark .sidebar-content h2,
#kiosk-sidebar.sidebar-transparent-dark .sidebar-content h3 {
    color: #ffffff;
}

/* Custom sidebar background color via inline style */
#kiosk-sidebar[style*="--sidebar-bg"] {
    background-color: var(--sidebar-bg);
}

/* Adjust main content when sidebar is visible */
#view-standard.has-sidebar #kiosk-main {
    padding-left: 4vmin;
}

/* Wheelchair mode adjustments for sidebar layout */
body.wheelchair-mode #view-standard {
    align-items: flex-end;
}

body.wheelchair-mode #kiosk-sidebar {
    max-height: 55vh;
    margin-bottom: 4vmin;
}

body.wheelchair-mode #kiosk-main {
    justify-content: flex-end;
    padding-bottom: 4vmin;
}
