/* Reset and Base Styles */
:root {
    --image-base-height-vh: 40vh; /* Increased base height */
    --image-min-height-vh: 10vh;  /* Increased min height */
    --image-max-height-vh: 80vh;  /* Increased max height */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* RTL Support for Hebrew */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    text-align: right;
}

/* Disable transitions during initial theme loading */
html.theme-loading,
html.theme-loading * {
    transition: none !important;
}

/* Hide content during initial theme loading */
html.theme-loading body {
    opacity: 0;
}

#logoUrl {
    direction: ltr;
    text-align: left;
}

/* Theme Definitions */
/* Classic Theme */
body.theme-classic {
    --bg-color: #ececec; /* Pure White */
    --text-color: #2d2626; /* Pure Black */
    --container-bg: #f8f8f8; /* Very light gray for container background */
    --input-bg: #ffffff; /* White input background */
    --input-border: #cccccc; /* Medium Gray input border */
    --input-focus-border: #6d6d6d; /* Black input focus border */
    --primary-btn-bg: #484848; /* Black primary button */
    --primary-btn-hover: #181818; /* Dark Gray primary button hover */
    --primary-btn-text: #ffffff; /* White text on primary button */
    --secondary-btn-bg: #e0e0e0; /* Light Gray secondary button */
    --secondary-btn-hover: #cccccc; /* Slightly Darker Gray secondary button hover */
    --secondary-btn-text: #191616; /* Black text on secondary button */
    --modal-bg: rgba(0, 0, 0, 0.5); /* Darker semi-transparent modal backdrop */
    --modal-content-bg: rgba(255, 255, 255, 0.74); /* White modal content background */
    --settings-icon-bg: rgba(0, 0, 0, 0.08); /* Light transparent black for settings icon bg */
    --settings-icon-hover: rgba(44, 44, 44, 0.15); /* Darker transparent black for settings icon bg hover */
    --settings-icon-color: #191616; /* Black settings icon color */
    --settings-icon-hover-color: #333333; /* Dark gray settings icon color hover */
    --fullscreen-bg: #ffffff; /* White fullscreen background */
    --fullscreen-text: #000000; /* Black fullscreen text */
    --fullscreen-controls-bg: rgba(0, 0, 0, 0.08); /* Dark transparent controls on white fullscreen bg */
    --fullscreen-controls-hover: rgba(0, 0, 0, 0.15); /* Darker transparent controls hover */
    --fullscreen-controls-color: #000000; /* Black fullscreen controls color */
    --range-thumb: #404348; /* Black range slider thumb */
    --range-track: #dddddd; /* Light gray range slider track */
    --select-bg: #ffffff; /* White select background */
    --select-text-color: #2d2626; /* Black select text color */
}

/* Navy Theme */
body.theme-navy {
    --bg-color: #0d1b2a;
    --text-color: #e0e0e0;
    --container-bg: rgba(30, 41, 59, 0.9);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.3);
    --input-focus-border: #4fc3f7;
    --primary-btn-bg: #4fc3f7;
    --primary-btn-hover: #29b6f6;
    --primary-btn-text: #0d1b2a;
    --secondary-btn-bg: rgba(255, 255, 255, 0.2);
    --secondary-btn-hover: rgba(255, 255, 255, 0.3);
    --secondary-btn-text: #e0e0e0;
    --modal-bg: rgba(0, 0, 0, 0.16);
    --modal-content-bg: rgba(255, 255, 255, 0.09);
    --settings-icon-bg: rgba(255, 255, 255, 0.1);
    --settings-icon-hover: rgba(255, 255, 255, 0.2);
    --settings-icon-color: rgba(255, 255, 255, 0.6);
    --settings-icon-hover-color: rgba(255, 255, 255, 0.8);
    --fullscreen-bg: #0d1b2a;
    --fullscreen-text: #e0e0e0;
    --fullscreen-controls-bg: rgba(255, 255, 255, 0.1);
    --fullscreen-controls-hover: rgba(255, 255, 255, 0.2);
    --fullscreen-controls-color: rgba(255, 255, 255, 0.7);
    --range-thumb: #4fc3f7;
    --range-track: rgba(255, 255, 255, 0.2);
    --select-bg: rgba(30, 41, 59, 0.95); /* Darker select background */
    --select-text-color: #e0e0e0; /* Light select text color */
}

/* Forest Theme */
body.theme-forest {
    --bg-color: #1b4332;
    --text-color: #d8f3dc;
    --container-bg: rgba(52, 83, 67, 0.9);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.3);
    --input-focus-border: #52b788;
    --primary-btn-bg: #52b788;
    --primary-btn-hover: #74c69d;
    --primary-btn-text: #081c15;
    --secondary-btn-bg: rgba(255, 255, 255, 0.2);
    --secondary-btn-hover: rgba(255, 255, 255, 0.3);
    --secondary-btn-text: #d8f3dc;
    --modal-bg: rgba(0, 0, 0, 0.16);
    --modal-content-bg: rgba(255, 255, 255, 0.09);
    --settings-icon-bg: rgba(255, 255, 255, 0.1);
    --settings-icon-hover: rgba(255, 255, 255, 0.2);
    --settings-icon-color: rgba(255, 255, 255, 0.6);
    --settings-icon-hover-color: rgba(255, 255, 255, 0.8);
    --fullscreen-bg: #1b4332;
    --fullscreen-text: #d8f3dc;
    --fullscreen-controls-bg: rgba(255, 255, 255, 0.1);
    --fullscreen-controls-hover: rgba(255, 255, 255, 0.2);
    --fullscreen-controls-color: rgba(255, 255, 255, 0.7);
    --range-thumb: #52b788;
    --range-track: rgba(255, 255, 255, 0.2);
    --select-bg: rgba(52, 83, 67, 0.95); /* Darker select background */
    --select-text-color: #d8f3dc; /* Light select text color */
}

/* Red Theme */
body.theme-red {
    --bg-color: #590d22;
    --text-color: #ffb3c1;
    --container-bg: rgba(128, 17, 41, 0.9);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.3);
    --input-focus-border: #ff758f;
    --primary-btn-bg: #ff758f;
    --primary-btn-hover: #ff4d6d;
    --primary-btn-text: #3a0511;
    --secondary-btn-bg: rgba(255, 255, 255, 0.2);
    --secondary-btn-hover: rgba(255, 255, 255, 0.3);
    --secondary-btn-text: #ffb3c1;
    --modal-bg: rgba(0, 0, 0, 0.16);
    --modal-content-bg: rgba(255, 255, 255, 0.09);
    --settings-icon-bg: rgba(255, 255, 255, 0.1);
    --settings-icon-hover: rgba(255, 255, 255, 0.2);
    --settings-icon-color: rgba(255, 255, 255, 0.6);
    --settings-icon-hover-color: rgba(255, 255, 255, 0.8);
    --fullscreen-bg: #590d22;
    --fullscreen-text: #ffb3c1;
    --fullscreen-controls-bg: rgba(255, 255, 255, 0.1);
    --fullscreen-controls-hover: rgba(255, 255, 255, 0.2);
    --fullscreen-controls-color: rgba(255, 255, 255, 0.7);
    --range-thumb: #ff758f;
    --range-track: rgba(255, 255, 255, 0.2);
    --select-bg: rgba(128, 17, 41, 0.95); /* Darker select background */
    --select-text-color: #ffb3c1; /* Light select text color */
}

/* Orange Theme */
body.theme-orange {
    --bg-color: #fff3e0;
    --text-color: #5d4037;
    --container-bg: rgba(255, 248, 235, 0.95);
    --input-bg: white;
    --input-border: #ffcc80;
    --input-focus-border: #ff9800;
    --primary-btn-bg: #ff9800;
    --primary-btn-hover: #f57c00;
    --primary-btn-text: white;
    --secondary-btn-bg: #ffe0b2;
    --secondary-btn-hover: #ffcc80;
    --secondary-btn-text: #5d4037;
    --modal-bg: rgba(0, 0, 0, 0.16);
    --modal-content-bg: rgba(255, 255, 255, 0.09);
    --settings-icon-bg: rgba(0, 0, 0, 0.05);
    --settings-icon-hover: rgba(0, 0, 0, 0.1);
    --settings-icon-color: rgba(0, 0, 0, 0.5);
    --settings-icon-hover-color: rgba(0, 0, 0, 0.7);
    --fullscreen-bg: #5d4037;
    --fullscreen-text: #fff3e0;
    --fullscreen-controls-bg: rgba(255, 255, 255, 0.15);
    --fullscreen-controls-hover: rgba(255, 255, 255, 0.25);
    --fullscreen-controls-color: rgba(255, 255, 255, 0.8);
    --range-thumb: #ff9800;
    --range-track: #ffcc80;
    --select-bg: #ffffff; /* White select background */
    --select-text-color: #5d4037; /* Dark brown select text color */
}

/* Apply theme colors throughout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--bg-color); /* Will be set by theme-specific class */
    color: var(--text-color); /* Will be set by theme-specific class */
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s, opacity 0.3s;
}

/* Input Screen */
.screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25em;
    position: relative;
}

/* Settings Icon Button */
.settings-icon {
    position: absolute;
    top: 1.25em;
    right: 1.25em;
    width: 2.8em;
    height: 2.8em;
    border-radius: 50%;
    background-color: var(--settings-icon-bg);
    border: none;
    color: var(--settings-icon-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RTL adjustments for settings icon */
html[dir="rtl"] .settings-icon {
    right: auto;
    left: 1.25em;
}

.settings-icon:hover {
    background-color: var(--settings-icon-hover);
    color: var(--settings-icon-hover-color);
}

.logo {
    padding: 2em;

}

.container {
    background: var(--container-bg);
    padding: 2.5em;
    border-radius: 0.75em;
    box-shadow: 0 0.25em 1.25em rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 32em;
    width: 100%;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
    margin-top: -10vh;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.0625em solid rgba(255, 255, 255, 0.2);
}

.container h1 {
    color: var(--text-color);
    margin-bottom: 1em;
    font-size: 2rem;
    transition: color 0.3s;
}

#passengerName {
    width: 100%;
    padding: 1.25em 1em;
    font-size: 1.4rem;
    border: 0.125em solid var(--input-border);
    border-radius: 0.5em;
    margin-bottom: 1.5em;
    transition: all 0.3s;
    background: var(--input-bg);
    min-height: 3.5em;
    color: var(--text-color);
}

#passengerName:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 0.2em rgba(33, 150, 243, 0.1);
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: 0.875em 2em;
    font-size: 1.1rem;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0.3em;
    min-width: 7.5em;
}

.primary-btn {
    background-color: var(--primary-btn-bg);
    color: var(--primary-btn-text);
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    background-color: var(--primary-btn-hover);
    transform: translateY(-0.0625em);
    box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.2);
}

.secondary-btn {
    background-color: var(--secondary-btn-bg);
    color: var(--secondary-btn-text);
}

.secondary-btn:hover {
    background-color: var(--secondary-btn-hover);
}

/* Fullscreen Display */
.fullscreen-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--fullscreen-bg);
    color: var(--fullscreen-text);
    display: none;
    overflow: hidden;
}

.fullscreen-display.active {
    display: block;
}

/* Exit button and Text Size Controls */
.exit-btn {
    position: absolute;
    top: 1.25em;
    right: 1.25em;
    width: 2.8em;
    height: 2.8em;
    background-color: var(--fullscreen-controls-bg);
    border: none;
    border-radius: 50%;
    color: var(--fullscreen-controls-color);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.exit-btn:hover {
    background-color: var(--fullscreen-controls-hover);
    color: var(--fullscreen-text);
}

/* Text Size Controls */
.text-size-controls {
    position: absolute;
    top: 1.25em;
    left: 1.25em;
    z-index: 1000;
    display: flex;
    gap: 0.5em;
}

.text-size-btn {
    width: 2.8em;
    height: 2.8em;
    background-color: var(--fullscreen-controls-bg);
    border: none;
    border-radius: 50%;
    color: var(--fullscreen-controls-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-size-btn:hover {
    background-color: var(--fullscreen-controls-hover);
    color: var(--fullscreen-text);
}

.text-size-btn:disabled {
    background-color: #cccccc; /* Gray background */
    color: #666666; /* Darker gray text */
    cursor: not-allowed; /* Not-allowed cursor */
    opacity: 0.6; /* Slightly transparent */
}

/* Display Content */
.display-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5em;
    opacity: 0;
}

.display-content.active {
    opacity: 1;
}

/* Fade Transition */
.fullscreen-display.fade .display-content {
    transition: opacity var(--transition-duration, 0.5s) ease-in-out;
}

/* Improved Slide Transition */
.fullscreen-display.slide .display-content {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: none; /* Remove transition by default */
}

/* Initial state - both hidden below */
.fullscreen-display.slide .display-content:not(.active) {
    transform: translateY(100%);
}

/* Active state - visible in center */
.fullscreen-display.slide .display-content.active {
    transform: translateY(0);
}

/* Sliding states - Vertical (default) */
.fullscreen-display.slide .display-content.slide-in-vertical {
    animation: slideInVertical var(--transition-duration, 0.5s) ease-in-out forwards;
}

.fullscreen-display.slide .display-content.slide-out-vertical {
    animation: slideOutVertical var(--transition-duration, 0.5s) ease-in-out forwards;
}

@keyframes slideInVertical {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutVertical {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

/* Sliding states - Horizontal (Left to Right) */
.fullscreen-display.slide .display-content.slide-in-horizontal-lr {
    animation: slideInHorizontalLR var(--transition-duration, 0.5s) ease-in-out forwards;
}

.fullscreen-display.slide .display-content.slide-out-horizontal-lr {
    animation: slideOutHorizontalLR var(--transition-duration, 0.5s) ease-in-out forwards;
}

@keyframes slideInHorizontalLR {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutHorizontalLR {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Sliding states - Horizontal (Right to Left) */
.fullscreen-display.slide .display-content.slide-in-horizontal-rl {
    animation: slideInHorizontalRL var(--transition-duration, 0.5s) ease-in-out forwards;
}

.fullscreen-display.slide .display-content.slide-out-horizontal-rl {
    animation: slideOutHorizontalRL var(--transition-duration, 0.5s) ease-in-out forwards;
}

@keyframes slideInHorizontalRL {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutHorizontalRL {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Ensure proper layering during transition */
.fullscreen-display.slide .display-content.slide-out-vertical,
.fullscreen-display.slide .display-content.slide-out-horizontal-lr,
.fullscreen-display.slide .display-content.slide-out-horizontal-rl {
    z-index: 1;
}

.fullscreen-display.slide .display-content.slide-in-vertical,
.fullscreen-display.slide .display-content.slide-in-horizontal-lr,
.fullscreen-display.slide .display-content.slide-in-horizontal-rl {
    z-index: 2;
}

/* Text Styles */
.slide-text-primary {
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700; /* Bold by default for better visibility */
    line-height: 1em;
    text-align: center;
    text-shadow: 0 0.1em 0.3em rgba(67, 67, 67, 0);
    margin: 0;
    word-break: break-word;
    max-width: 100%;
    transition: font-size 0.3s ease;
    font-family: 'Rubik', sans-serif; /* Default font with Hebrew/English support */
}

.slide-text-secondary {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 700; /* Bold by default for better visibility */
    line-height: 1.1em;
    text-align: center;
    text-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.3);
    margin: 0.1em 0 0 0;
    transition: font-size 0.3s ease;
    font-family: 'Rubik', sans-serif; /* Default font with Hebrew/English support */
}

.slide-text-emoji {
    font-size: clamp(8rem, 20vw, 20rem);
    line-height: 1em;
    text-align: center;
    margin: 0;
    transition: font-size 0.3s ease;
    font-family: 'Rubik', sans-serif; /* Default font with Hebrew/English support */
}

/* Ensure slide text uses selected font family */
.slide-text {
    font-family: 'Rubik', sans-serif; /* Default fallback */
    font-weight: 700; /* Bold by default */
    color: var(--fullscreen-text);
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
    direction: inherit;
    unicode-bidi: embed;
    line-height: 0.85;
}

/* Hebrew font optimizations */
html[dir="rtl"] .slide-text {
    font-family: 'Rubik', 'Assistant', 'Heebo', sans-serif;
    font-weight: 600;
    /* letter-spacing: 0.5px; */

}

.slide-image {
    height: var(--image-base-height-vh); /* Use CSS custom property */
    width: auto;
    max-width: 90%;
    object-fit: contain;
    border-radius: 0.5em;
    box-shadow: 0 0.25em 1.25em rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.logo-background {
    display: inline-flex; /* Use inline-flex to allow content centering while being inline */
    justify-content: center; /* Center image horizontally */
    align-items: center;   /* Center image vertically */
    background-color: rgba(255, 255, 255, 0.95); /* Semi-transparent white */
    padding: 0.5em; /* Space between image and background edge */
    border-radius: 0.5em; /* Match image's border radius */
    box-shadow: 0 0.25em 1.25em rgba(0, 0, 0, 0.3); /* Apply shadow to the background */
    /* text-align and line-height are no longer needed due to flex */
}

.logo-background .slide-image.logo {
    box-shadow: none; /* Remove shadow from image itself as it's on the background */
    display: block; /* Or inline-block; flex item behavior is similar */
    /* vertical-align is no longer needed */
    /* Inherits other .slide-image properties like height, width, object-fit, border-radius */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);

    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--modal-content-bg);
    padding: 1.875em;
    border-radius: 0.75em;
    max-width: 31.25em;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.2);
    border: 0.0625em solid rgba(255, 255, 255, 0.2);
}

/* Modal content RTL adjustments */
html[dir="rtl"] .modal-content {
    text-align: right;
}

.modal-content h2 {
    margin-bottom: 1.5em;
    color: var(--text-color);
    transition: color 0.3s;
}

.settings-group {
    margin-bottom: 1.25em;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5em;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 0.75em;
    border: 0.125em solid var(--input-border);
    border-radius: 0.375em;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s;
}

.settings-group select {
    background: var(--select-bg);
    color: var(--select-text-color);
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 0.2em rgba(33, 150, 243, 0.1);
}

/* Range Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 0.5em;
    background: var(--range-track);
    border-radius: 0.25em;
    outline: none;
    padding: 0;
    margin-top: 0.75em;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.5em;
    height: 1.5em;
    background: var(--range-thumb);
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s;
}

input[type="range"]::-moz-range-thumb {
    width: 1.5em;
    height: 1.5em;
    background: var(--range-thumb);
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--primary-btn-hover);
}

input[type="range"]:hover::-moz-range-thumb {
    background: var(--primary-btn-hover);
}

/* Color Presets */
.color-presets {
    display: flex;
    gap: 0.625em;
    flex-wrap: wrap;
}

.color-preset {
    padding: 0.75em 1.25em;
    border: 0.1875em solid transparent;
    border-radius: 0.375em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

/* Classic theme preset */
.color-preset[data-theme="classic"] {
    background-color: #f5f5f5;
    color: #333;
    border: 0.125em solid #ddd;
}

/* Navy theme preset */
.color-preset[data-theme="navy"] {
    background-color: #0d1b2a;
    color: #e0e0e0;
}

/* Forest theme preset */
.color-preset[data-theme="forest"] {
    background-color: #1b4332;
    color: #d8f3dc;
}

/* Red theme preset */
.color-preset[data-theme="red"] {
    background-color: #590d22;
    color: #ffb3c1;
}

/* Orange theme preset */
.color-preset[data-theme="orange"] {
    background-color: #fff3e0;
    color: #5d4037;
    border: 0.125em solid #ffcc80;
}

.color-preset:hover {
    transform: translateY(-0.125em);
    box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.3);
}

.color-preset.active {
    border-color: currentColor;
    box-shadow: 0 0 0 0.0625em currentColor inset, 0 0.25em 0.75em rgba(0, 0, 0, 0.3);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.625em;
    margin-top: 1.875em;
}

/* Modal buttons RTL adjustments */
html[dir="rtl"] .modal-buttons {
    direction: rtl;
}

html[dir="rtl"] .modal-buttons button {
    margin-left: 0.625em;
    margin-right: 0;
}

html[dir="rtl"] .modal-buttons button:first-child {
    margin-left: 0;
}

/* Settings group RTL adjustments */
html[dir="rtl"] .settings-group label {
    text-align: right;
}

html[dir="rtl"] .color-presets {
    direction: rtl;
}

/* Size controls dropdown RTL adjustments */
html[dir="rtl"] .size-controls-dropdown {
    left: 1.25em;
    right: auto;
}

html[dir="rtl"] .size-dropdown-panel {
    right: auto;
    left: 0;
}

/* Toggle container RTL adjustments */
html[dir="rtl"] .toggle-container {
  /*  flex-direction: row-reverse;*/
}


html[dir="rtl"] .toggle-slider {
    margin-left: 0;
    margin-right: 0.625em;
    transform: rotate(180deg);
}

/* Input field RTL adjustments */
html[dir="rtl"] input[type="text"], 
html[dir="rtl"] input[type="url"] {
    text-align: right;
    direction: rtl;
}

/* Collapsible panel RTL adjustments */
html[dir="rtl"] .collapsible-toggle {
    text-align: right;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 1.5em;
        margin-top: -20vh; /* Move higher on mobile */
    }
    
    .container h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75em;
    }
    
    #passengerName {
        font-size: 1.2rem;
        padding: 1em 0.75em;
        min-height: 3em;
        margin-bottom: 1.25em;
    }
    
    .primary-btn {
        font-size: 1.1rem;
        padding: 1em 2em;
        width: 100%;
        margin-top: 0.5em;
    }
    
    .modal-content {
        padding: 1.25em;
    }
    
    .exit-btn {
        width: 3em;
        height: 3em;
        font-size: 1.1rem;
    }
    
    .text-size-btn {
        width: 3em;
        height: 3em;
        font-size: 0.95rem;
    }
    
    .settings-icon {
        width: 3em;
        height: 3em;
        font-size: 1.2rem;
    }
}

/* --- Size Controls Dropdown --- */
.size-controls-dropdown {
    position: absolute;
    top: 1.25em;
    left: 1.25em;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#sizeDropdownToggle {
    width: 2.8em;
    height: 2.8em;
    background-color: var(--fullscreen-controls-bg);
    border: none;
    border-radius: 50%;
    color: var(--fullscreen-controls-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.2em;
    transition: background-color 0.3s, color 0.3s;
}
#sizeDropdownToggle:hover {
    background-color: var(--fullscreen-controls-hover);
    color: var(--fullscreen-text);
}

.size-dropdown-panel {
    display: none;
    flex-direction: column;
    gap: 0.3em;
    background: var(--fullscreen-controls-bg);
    border-radius: 1em;
    box-shadow: 0 0.25em 1em rgba(0,0,0,0.18);
    padding: 0.7em 0.5em;
    margin-top: 0.1em;
    min-width: 3.2em;
    align-items: stretch;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.size-controls-dropdown.active .size-dropdown-panel {
    display: flex;
}

.text-size-controls { display: none !important; }

/* Settings group headers */
.settings-group h3 {
    margin: 1.5em 0 0.5em 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--input-border);
    padding-bottom: 0.3em;
}

.settings-group h3:first-child {
    margin-top: 0;
}

/* Slide settings container */
#slideSettings {
    max-height: 60vh;
    overflow-y: auto;
    margin: 1em 0;
    padding-right: 0.5em;
}

#slideSettings::-webkit-scrollbar {
    width: 6px;
}

#slideSettings::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 3px;
}

#slideSettings::-webkit-scrollbar-thumb {
    background: var(--range-thumb);
    border-radius: 3px;
}

#slideSettings::-webkit-scrollbar-thumb:hover {
    background: var(--primary-btn-hover);
}

/* Collapsible More Settings Styles */
.collapsible-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 500;
    text-align: left;
    padding: 0.7em 0.5em;
    cursor: pointer;
    outline: none;
    transition: background 0.2s;
    border-radius: 6px;
    margin-bottom: 0.2em;
}
.collapsible-toggle:hover, .collapsible-toggle:focus {
    background: rgba(0,0,0,0.06);
}
.collapsible-toggle.open {
    color: var(--primary-btn-bg);
}
.collapsible-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
    background: none;
    padding: 0 0.2em;
}
.collapsible-panel.open {
    max-height: 1000px; /* Large enough for all content */
    transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1);
    margin-bottom: 0.5em;
}

/* Toggle Switch Styles */
.toggle-container {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 0.5em 0;
    font-weight: 500;
}

.toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
    background-color: var(--input-border);
    border-radius: 2em;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.6em;
    width: 1.6em;
    left: 0.2em;
    bottom: 0.2em;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.3);
}

.toggle-container input:checked + .toggle-slider {
    background-color: var(--primary-btn-bg);
}

.toggle-container input:checked + .toggle-slider:before {
    transform: translateX(1.5em);
    background-color: white;
}

/*
.toggle-container:hover .toggle-slider {
    background-color: var(--primary-btn-hover);
}
*/

.toggle-container input:checked:hover + .toggle-slider {
    background-color: var(--primary-btn-hover);
}

/* Override normal label styles for toggle */
.toggle-container {
    width: 100% !important;
    margin-bottom: 0 !important;
} 