
/* Settings Menu Overlay */
.settings-menu-overlay {
    position: fixed;
    top: 5%;
    left: 11%;
    width: 80%;
    max-height: 90vh; /* Allow overlay to grow up to 90vh */
    max-height: 90dvh; /* Use dynamic viewport height for iOS Safari */
    background-color: rgba(30, 30, 30, 0.98);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling on overlay for iOS fallback */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border-radius: 15px;
}

.settings-menu-overlay.active {
    display: flex;
}

/* App blur when settings menu is active */
.app-blurred {
    filter: blur(6px);
    pointer-events: none; /* Disable interactions with blurred content */
    transition: filter 0.3s ease;
    touch-action: none; /* Disable touch events */
    -webkit-filter: blur(6px); /* For older WebKit browsers */
    -moz-filter: blur(6px); /* For Firefox */
    -ms-filter: blur(6px); /* For IE */
    -o-filter: blur(6px); /* For Opera */
}

.settings-header {
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.4) !important; /* Slightly darker to indicate it's clickable */
}

/* Add subtle hover effect */
.settings-header:hover {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.settings-header h2 {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 24px;
    flex: 0 0 auto;
}

.settings-version-indicator {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    letter-spacing: 0.2px;
    text-transform: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.2;
    white-space: normal;
    text-align: left;
    max-width: 45%;
    box-sizing: border-box;
    flex: 0 0 auto;
    margin-left: 12px;
}

.settings-version-indicator.override-active {
    background: rgba(255, 196, 0, 0.85);
    color: #1b1b1b;
    border-color: rgba(0, 0, 0, 0.25);
}

/* Add indicator for expandable content */
/* .settings-header::after {
    content: '\f078'; /* FontAwesome chevron-down icon 
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 50px;
    opacity: 0.8 !important; 
    font-size: 16px !important; 
    color: #fff;
    transition: transform 0.3s ease;
} */

/* Rotate indicator when expanded */
.settings-header.expanded::after {
    transform: rotate(180deg);
    color: #00ffcc !important; /* Highlight color when expanded */
}

.close-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    margin-left: auto;
}

.settings-content {
    padding: 5px;
    flex: 1 1 auto; /* Allow flex grow and shrink */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    min-height: 0; /* Critical for iOS flexbox scrolling */
    /* Fallback for browsers that don't support dvh */
    max-height: 80vh;
    max-height: 80dvh; /* Dynamic viewport height for iOS Safari */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.settings-option {
    display: flex;
    align-items: center;
    padding: 15px;
    min-height: 50px;
    margin: 10px 10px !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.settings-option:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.settings-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 128, 255, 0.3);
    border-radius: 50%;
    margin-right: 15px;
    color: white;
    font-size: 20px;
}

.settings-label {
    flex: 1;
    color: #fff;
    font-size: 16px;
}

.settings-arrow {
    color: #aaa;
    font-size: 16px;
}

/* Settings option variants */
/* Action options (no arrow - for toggles, actions) */
.settings-option.settings-option-action {
    padding-right: 20px; /* Extra padding since no arrow */
}

/* Disabled options styling */
.settings-option.settings-option-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Sync Settings Option Styles - horizontal layout */
.settings-label.settings-label-with-bubble {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.sync-status-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: fit-content;
    white-space: nowrap;
}

.sync-bubble-icon {
    font-size: 12px;
}

.sync-status-bubble.synced {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.4);
    color: #4ecdc4;
}

.sync-status-bubble.syncing {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.sync-status-bubble.syncing .sync-bubble-icon {
    animation: sync-spin-bubble 1s linear infinite;
}

@keyframes sync-spin-bubble {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-status-bubble.error {
    background: rgba(248, 80, 50, 0.2);
    border-color: rgba(248, 80, 50, 0.4);
    color: #f85032;
}

.sync-icon i {
    transition: transform 0.3s ease;
}

.settings-option#sync-settings-option:active .sync-icon i {
    animation: sync-spin-bubble 0.5s linear;
}

.settings-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #222;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-content h2 {
    color: #fff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Voice Options */
.voice-options {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.voice-options label {
    display: flex;
    align-items: center;
    color: #fff;
    padding: 12px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
}

.voice-options label input {
    margin-right: 10px;
}

/* Logo Options */
.logo-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.logo-option {
    aspect-ratio: 16/9;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.logo-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.logo-option.selected {
    border-color: #0088ff;
    background-color: rgba(0, 136, 255, 0.2);
}

.logo-option img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.modal-actions button:first-child {
    background-color: #0088ff;
    color: white;
}

.modal-actions button:last-child {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Prevent body scrolling when modals are active */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Make sure the settings option hover effect is visible */
.settings-option:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hide logo, AI name, and reset logo settings options by default */
#logo-settings-option,
#ai-name-settings-option,
#reset-logo-option {
    display: none !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    pointer-events: all;
}

/* Show logo settings option when visible class is applied - INCREASED SPECIFICITY */
.settings-content #logo-settings-option.visible,
.settings-content #ai-name-settings-option.visible {
    display: flex !important;
    max-height: 60px !important;
    opacity: 1 !important;
    margin: 10px 10px !important;
    padding: 5px !important;
    pointer-events: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: 2px solid #00ffcc !important;
}

/* Suggestions Lightbulb Icon */
.suggestions-lightbulb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -55px; /* Place above fullscreen button, adjust as needed */
    z-index: 20;
    /* Dark halo for contrast over grid/backgrounds (mobile-only) */
    background: rgba(0, 0, 0, 0.40);
    border-radius: 50%;
    padding: 8px;
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: border-color 0.3s, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

/* Slight emphasis on hover/active without affecting layout */
.suggestions-lightbulb:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* Create invisible larger touch area for suggestions-lightbulb */
.suggestions-lightbulb::after {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    bottom: -10px;
    left: -10px;
    background-color: transparent;
    z-index: 1;
    pointer-events: auto;
}

.suggestions-lightbulb i {
    color: #cdcdcd; /* Start with gray/inactive color by default */
    font-size: 1.5em;
    position: relative;
    z-index: 2; /* Ensure icon stays above the touch area */
    transition: color 0.3s ease; /* Smooth color transition */
}

/* Active state - green color when suggestions are available */
.suggestions-lightbulb.active i {
    color: #00ffcc; /* Green/cyan when active */
}

/* Disabled state - keep gray color even if other styles try to override */
.suggestions-lightbulb.disabled i {
    color: #cdcdcd !important; /* Force gray when disabled */
}

/* Hide both chat toggles when there are no messages */
.chat-section.no-messages .chat-toggle,
.chat-section.no-messages .minimal-toggle {
    opacity: 0 !important; /* Force hide toggles regardless of state */
    pointer-events: none; /* Prevent interaction */
    transition: opacity 0.3s ease;
}

/* Hide chat-toggle (expand button) when messages fit in normal state.
   Expansion would show nothing extra, so the button is pointless.
   minimal-toggle (collapse/expand) is still shown. */
.chat-section.no-overflow:not(.minimal):not(.expanded) .chat-toggle {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@keyframes wiggle {
    0% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-12deg); }
    50% { transform: translateX(-50%) rotate(0deg); }
    75% { transform: translateX(-50%) rotate(12deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* Separate animation just for the icon that doesn't affect positioning */
@keyframes wiggle-icon {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-12deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(12deg); }
    100% { transform: rotate(0deg); }
}

.suggestions-lightbulb.animated {
    border-color: #00ff00;
    /* Only use one animation to avoid conflicts */
    animation: profile-updated 2s ease-out;
    /* Ensure translateX(-50%) stays applied during animation */
    transform: translateX(-50%);
}

/* Apply wiggle only to the icon inside, not the container */
.suggestions-lightbulb.animated i {
    animation: wiggle-icon 0.5s ease-in-out;
    animation-iteration-count: 2;
    display: inline-block; /* Needed for transform to work on inline elements */
}

/* Suggestions Modal Popup */
.suggestions-modal {
    display: flex !important; /* Always use flex layout */
    position: fixed;
    z-index: 2000;
    width: 100vw;
    height: 100vh;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    
    /* Animation properties */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;  
}

/* When modal is active, the lightbulb should be isolated from the blur */
.suggestions-modal.active ~ .suggestions-lightbulb {
    /* Create a "hole" in the backdrop filter */
    backdrop-filter: none;
    /* Add a higher z-index to ensure it's above the modal */
    z-index: 2001;
    /* Add a subtle glow to make it more visible */
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
    /* Scale the icon slightly for emphasis */
    transform: translateX(-50%) scale(1.1);
}

.suggestions-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.suggestions-modal-content {
    background: rgba(30, 30, 30, 0); 
    border-radius: 16px;
    padding: 20px;
    width: 90vw;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-right: 20px;
    
    /* Add transition properties */
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.suggestions-modal.active .suggestions-modal-content {
    transform: scale(1);
    opacity: 1;
}

.suggestions-modal-content h2 {
    display: none;
}
.suggestions-modal-header {
    display: none;
    justify-content: end;
    align-items: center;
    margin-bottom: 10px;
}
.suggestions-modal-header span {
    font-size: 1.2em;
    font-weight: bold;
    color: #222;
    display:none;
}
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.suggestions-list button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.6); /* Transparent white background */
    border: 1px solid rgba(255, 255, 255, 0.5); /* White border */
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white; /* White text */
    text-align: center;
}
.suggestions-list button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}
.suggestions-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 10;
    transition: background 0.2s ease;
}
.suggestions-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation controls for suggestions history */
.suggestions-nav-controls {
    display: none !important; /* HIDDEN: Navigation controls are no longer needed */
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    margin-top: 15px;
}

.suggestions-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestions-nav-btn:hover, .suggestions-nav-btn:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.suggestions-nav-btn.prev {
    margin-right: auto; /* Push to left */
}

.suggestions-nav-btn.next {
    margin-left: auto; /* Push to right */
}

.suggestions-nav-btn i {
    font-size: 16px;
}

/* Make buttons more visible on darker backgrounds */
.suggestions-nav-btn {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Add button click animation and disabled states */
@keyframes nav-btn-click {
    0% { transform: scale(0.92); background: rgba(255, 255, 255, 0.3); }
    50% { transform: scale(0.95); background: rgba(255, 255, 255, 0.2); }
    100% { transform: scale(1); background: rgba(255, 255, 255, 0.1); }
}

.suggestions-nav-btn:active {
    transform: scale(0.9);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

.suggestions-nav-btn.clicked {
    animation: nav-btn-click 0.3s ease forwards;
}

/* Disabled state styling */
.suggestions-nav-btn.disabled {
    opacity: 0.3;
    cursor: default;
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(150, 150, 150, 0.2);
    box-shadow: none;
    pointer-events: none;
}

/* Animation for suggestion buttons that change content */
@keyframes scale-in {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes flash-highlight {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); 
        border-color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.2);
    }
    40% { 
        box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.5);
        border-color: rgba(255, 255, 255, 1);
        background: rgba(255, 255, 255, 0.25); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); 
        border-color: rgba(255, 255, 255, 0.5);
        background: rgba(0, 0, 0, 0.6);
    }
}

.animate-scale-in {
    animation: 
        scale-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        flash-highlight 0.6s ease-out forwards;
}

/* Make sure the animation only plays once per navigation */
.suggestions-list button {
    will-change: transform, opacity, box-shadow, border-color, background;
    border-width: 1px;
}

/* Show lightbulb overlay when modal is active */
.suggestions-modal.active ~ .lightbulb-overlay {
    display: flex;
}

/* Lightbulb overlay for suggestions modal */
.lightbulb-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 187px;
    right: 8px;
    z-index: 2500; /* Higher than modal z-index */
    background: transparent;
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    /*box-shadow: 0 0 15px rgba(0, 255, 204, 0.7);  Glow effect */
    opacity: 0; /* Start with zero opacity */
    transform: scale(0.8); /* Start slightly scaled down */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Add smooth transition */
}

.lightbulb-overlay.visible {
    opacity: 1;
    transform: scale(1);
}

.lightbulb-overlay i {
    color: #00ffcc;
    font-size: 1.5em;
    filter: none; /* Ensure no blur is applied to the icon */
}

/* Mobile Lightbulb Navigation Icons for Gallery Items */
.lightbulb-nav-icon-mobile {
    position: absolute;
    top: 70px;
    right: 143px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.8); /* Dark background like desktop */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbulb-nav-icon-mobile:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 255, 204, 0.3);
    border-color: rgba(0, 255, 204, 0.5);
}

.lightbulb-nav-icon-mobile i {
    color: #00ffcc; /* Bright cyan like desktop */
    font-size: 14px;
    transition: all 0.3s ease;
}

.lightbulb-nav-icon-mobile:hover i {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
}

/* Touch feedback animation */
.lightbulb-nav-icon-mobile.touched {
    animation: touch-feedback 0.15s ease;
    background: rgba(0, 255, 204, 0.2);
}

/* Animation states for mobile lightbulb */
.lightbulb-nav-icon-mobile.navigating {
    animation: pulse-navigate 0.8s infinite;
    background: rgba(255, 193, 7, 0.9);
}

.lightbulb-nav-icon-mobile.navigating i {
    color: #000;
}

.lightbulb-nav-icon-mobile.success {
    background: rgba(40, 167, 69, 0.9);
    animation: success-flash 0.6s ease;
}

.lightbulb-nav-icon-mobile.success i {
    color: #fff;
}

@keyframes touch-feedback {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); background: rgba(0, 255, 204, 0.4); }
    100% { transform: scale(1); }
}

@keyframes pulse-navigate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes success-flash {
    0% { background: rgba(40, 167, 69, 0.9); }
    50% { background: rgba(40, 167, 69, 1); box-shadow: 0 0 15px rgba(40, 167, 69, 0.7); }
    100% { background: rgba(40, 167, 69, 0.9); }
}

/* Ensure gallery items are positioned relative to contain the absolute lightbulb */
.history-gallery-item {
    position: relative;
}

/* Responsive adjustments for the comparison container */
@media screen and (max-height: 700px) {
    .mobile-comparison-container {
        top: 80px; /* Smaller top margin on small screens */
    }
      .mobile-comparison-container.square {
        top: 80px; /* Adjusted top margin for square state on small screens */
        height: 45vh; /* Slightly smaller height for small screens */
    }
}

@media screen and (max-height: 600px) {
    .mobile-comparison-container {
        top: 70px; /* Even smaller top margin on very small screens */
    }
      .mobile-comparison-container.square {
        top: 30px; /* Adjusted top margin for square state on very small screens */
        height: 40vh; /* Even smaller height for very small screens */
    }
    
    .comparison-header h2 {
        font-size: 18px; /* Smaller title text */
    }
    
    .comparison-header h3 {
        font-size: 14px; /* Smaller subtitle text */
    }
}

/* Adjustment for taller devices */
@media screen and (min-height: 800px) {
    .mobile-comparison-container {
        top: 80px; /* More space on top for larger screens */
    }
      .mobile-comparison-container.square {
        top: 80px; /* Adjusted top margin for square state on larger screens */
        height: 51vh; /* Taller height for larger screens */
    }
}

/* Language selection styling for mobile */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.language-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-options label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Modal button styles are handled by modal-actions class */

/* Add a blue indicator for language settings option */
#language-settings-option .settings-icon {
    background-color: rgba(52, 152, 219, 0.3); /* Blue background for language */
    color: #fff; /* White icon */
}

/* Mobile placeholder settings styles */
#placeholder-settings-option {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile placeholder modal */
@media (max-width: 768px) {
    #placeholder-modal .modal-content {
        width: 90%;
        max-width: 350px;
    }
    
    #placeholder-modal input[type="text"] {
        font-size: 16px; /* Prevent zooming on iOS */
        padding: 12px;
    }
    
    #placeholder-modal .modal-buttons button {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Mobile placeholder modal specific styles */
#placeholder-modal .modal-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
}

#save-placeholder, #cancel-placeholder {
    flex: 1;
    margin: 0 10px;
    padding: 15px 20px;  /* Increased padding for bigger tap target */
    border-radius: 8px;
    font-size: 18px;     /* Increased font size */
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, transform 0.1s;
    border: none;        /* Ensure no border */
    outline: none;       /* Remove outline */
    position: relative;  /* For z-index to work */
    z-index: 10100;      /* Higher z-index than modal */
}

#save-placeholder {
    background-color: #0088ff;
    color: white;
}

#cancel-placeholder {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

#save-placeholder:active, #cancel-placeholder:active {
    transform: scale(0.95);
}

#placeholder-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 16px;
}

/* Make sure the modal has proper z-index and visibility */
#placeholder-modal.active {
    display: flex;
    z-index: 10000;
}

/* Linked Content Display for Mobile Suggestions (matches desktop style, mobile-optimized) */

.linked-content-container {
  width: 100%;
  margin: 16px 0 0 0; /* Changed: moved from above to below suggestions, so top margin instead of bottom */
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  box-shadow: none;
  transition: opacity 0.2s;
}
.linked-content-container.hidden {
  display: none !important;
}
.linked-content-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: rgba(0, 0, 0, 0.8); /* Changed: black background with transparency */
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  overflow: hidden;
  width: 96vw;
  max-width: 480px;
  min-height: 72px;
  cursor: pointer;
  margin: 0 auto;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2); /* Changed: light border for dark theme */
  transition: box-shadow 0.2s;
  touch-action: manipulation; /* SwipeGuard: prevent double-tap zoom delay */
}
.linked-content-item:active {
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.linked-content-thumbnail {
  width: 96px; /* Changed: increased from 80px */
  height: 68px; /* Changed: increased from 56px */
  object-fit: cover;
  border-radius: 8px; /* Changed: rounded corners on the right */
  background: #f0f0f0;
  flex-shrink: 0;
  margin-left: 0; /* Changed: moved to the left */
  order: 2; /* Changed: move thumbnail to the right */
  margin-right: 6px;
  margin-top: 3px;
  margin-bottom: 3px;
}
.linked-content-overlay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
  min-width: 0;
  flex: 1 1 0%;
  order: 1; /* Changed: move text content to the left */
}
.linked-content-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #fff; /* Changed: white text */
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.linked-content-subtitle {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.8); /* Changed: light white text */
  white-space: normal; /* Changed: allow text wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3; /* Added: better line spacing */
  display: -webkit-box; /* Added: for multi-line text control */
  -webkit-line-clamp: 2; /* Added: limit to 2 lines */
  line-clamp: 2; /* Added: standard property for compatibility */
  -webkit-box-orient: vertical; /* Added: vertical text layout */
}
@media (max-width: 400px) {
  .linked-content-item {
    width: 98vw;
    min-height: 56px;
  }
  .linked-content-thumbnail {
    width: 80px; /* Changed: increased from 60px proportionally */
    height: 70px; /* Changed: increased from 42px proportionally */
    margin-right: 6px;
    margin-top: 3px;
    margin-bottom: 3px;
  }
  .linked-content-overlay {
    padding: 8px 8px;
  }
}
/* Mobile History Tap-and-Hold Preview Overlay Styles */

.mobile-history-preview-overlay {
  position: fixed;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

.mobile-history-preview-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-history-preview-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  overflow: hidden;
  width: 280px;
  max-width: 80vw;
  min-height: 72px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
  transform: scale(0.9);
}

.mobile-history-preview-overlay.visible .mobile-history-preview-content {
  transform: scale(1);
}

.mobile-history-preview-thumbnail {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 0 8px 8px 0;
  background: #f0f0f0;
  flex-shrink: 0;
  order: 2;
  /* border-left: 1px solid rgba(255, 255, 255, 0.1); */
}

.mobile-history-preview-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
  min-width: 0;
  flex: 1 1 0%;
  order: 1;
}

.mobile-history-preview-title {
  font-size: 0.8em;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-history-preview-subtitle {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.8);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Responsive adjustments */
@media (max-width: 400px) {
  .mobile-history-preview-content {
    width: 260px;
    min-height: 60px;
  }
  
  .mobile-history-preview-thumbnail {
    width: 110px;
    height: 75px;
  }
  
  .mobile-history-preview-text {
    padding: 8px 12px;
  }
  
  .mobile-history-preview-title {
    font-size: 0.7em;
  }
  
  .mobile-history-preview-subtitle {
    font-size: 0.6em;
  }
}

/* Animation for touch feedback */
.history-item.tap-hold-active {
  background: rgba(0, 123, 255, 0.1);
  transform: scale(0.98);
  transition: all 0.1s ease;
}

/* Animation for touch feedback */
.history-item.tap-hold-active {
  background: rgba(0, 123, 255, 0.1);
  transform: scale(0.98);
  transition: all 0.1s ease;
}

/* Mobile suggestion button styling - force 2-line limit with proper ellipsis */
.mobile-suggestion-btn {
    /* Critical: Override all display properties */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    
    /* Force exact height to prevent overflow */
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    
    /* Essential overflow properties */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    
    /* Reset any conflicting properties */
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    
    /* Optimized line height for 2 lines in 50px */
    line-height: 1.1 !important;
    
    /* Minimal padding to maximize text space */
    padding: 6px 10px !important;
    
    /* Text styling */
    font-size: 1.05em !important;
    text-align: center !important;
    
    /* Remove any flex properties that might interfere */
    align-items: initial !important;
    justify-content: initial !important;
}

/* Ensure hover state works */
.mobile-suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: white !important;
}

/* Alternative approach for browsers where line-clamp fails */
.mobile-suggestion-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 15px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.6) 50%);
    pointer-events: none;
    display: none; /* Only show if text overflows */
}

/* Force webkit box properties with higher specificity */
.suggestions-list .mobile-suggestion-btn {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    position: relative !important;
}

/* Mobile scrollable suggestions - limit to 7 visible suggestions */
.suggestions-list.scrollable-mobile {
    max-height: 410px !important; /* Approximately 7 suggestions × 50px + gaps */
    overflow-y: auto !important;
    scroll-behavior: smooth !important;
    padding-right: 5px !important;
    width: 102%;
}

/* Custom scrollbar for mobile suggestions */
.suggestions-list.scrollable-mobile::-webkit-scrollbar {
    width: 4px;
    transition: opacity 0.3s ease;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Auto-hiding scrollbar states - using opacity for smooth transitions */
.suggestions-list.scrollable-mobile {
    scrollbar-width: thin; /* For Firefox */
}

/* Create a wrapper for smooth scrollbar transitions */
.suggestions-list.scrollable-mobile::-webkit-scrollbar {
    width: 4px;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.suggestions-list.scrollable-mobile::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Show scrollbar with smooth opacity transition when show-scrollbar class is present */
.suggestions-list.scrollable-mobile.show-scrollbar::-webkit-scrollbar-thumb {
    opacity: 1;
}

.suggestions-list.scrollable-mobile.show-scrollbar::-webkit-scrollbar-track {
    opacity: 1;
}

/* Firefox scrollbar with smooth transition */
.suggestions-list.scrollable-mobile {
    scrollbar-color: transparent transparent; /* Hidden by default */
    transition: scrollbar-color 0.3s ease;
}

.suggestions-list.scrollable-mobile.show-scrollbar {
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

/* Mobile scroll indicator - positioned on right side, smaller, no layout impact */
.mobile-scroll-indicator {
    position: absolute;
    top: 60%;
    right: -17px; /* Align with other right-side elements */
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: white;
    padding: 4px;
    border-radius: 50%; /* Make it circular */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 24px; /* Much smaller */
    height: 24px; /* Much smaller */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; /* Smaller icon */
    z-index: 10; /* Ensure it's above other elements */
    
    /* Scroll indicator specific styling */
    opacity: 0;
    transform: translateY(-50%) translateX(5px); /* Slide in from right */
    pointer-events: none;
}

.mobile-scroll-indicator.visible {
    opacity: 0.8;
    transform: translateY(-50%) translateX(0); /* Slide into position */
    animation: mobileScrollIndicatorPulse 2s ease-in-out infinite;
    pointer-events: auto;
    font-size: 13px;
}

.mobile-scroll-indicator.visible:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-50%) translateX(0) scale(1.1); /* Slight grow on hover */
}

.mobile-scroll-indicator.hidden {
    display: none;
}

/* Pulse animation for mobile scroll indicator */
@keyframes mobileScrollIndicatorPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.5;
    }
}

/* Orientation Lock Styles */
.orientation-portrait {
    /* Normal portrait mode - ensure proper layout */
    position: relative;
    overflow-x: hidden;
}

.orientation-forced-portrait {
    /* When device is in landscape but we force portrait */
    position: fixed;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.orientation-forced-portrait body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Mobile container in forced portrait mode */
.mobile-container.forced-portrait {
    /* Styles applied via JavaScript for precise rotation */
    overflow: hidden;
    background: #151515;
}

.mobile-container.natural-portrait {
    /* Normal portrait mode */
    transform: none;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Rotation Notice Overlay - Updated */
.rotation-notice {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.rotation-notice.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.rotation-notice-content {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.rotation-icon {
    font-size: 48px;
    color: #007AFF;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.rotation-icon .fa-mobile-alt {
    transform: rotate(90deg);
    display: inline-block;
}

.rotation-icon .rotation-arrow {
    position: absolute;
    top: -10px;
    right: -15px;
    font-size: 24px;
    color: #FF6B35;
    animation: rotateArrow 2s infinite ease-in-out;
}

@keyframes rotateArrow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotation-text h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.rotation-text p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.rotation-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rotation-dismiss:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Prevent any scrolling when orientation is locked and forced */
html.orientation-forced-portrait,
body.orientation-forced-portrait {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Media query to hide rotation notice when actually in portrait */
@media screen and (orientation: portrait) {
    .rotation-notice {
        display: none !important;
    }
}

/* Ensure the mobile container fills the entire viewport when forced */
.orientation-forced-portrait .mobile-container {
    background: #151515;
    position: fixed;
}

/* Settings button styling for orientation lock */
#orientation-lock-toggle-btn {
    transition: color 0.3s ease;
}

#orientation-lock-toggle-btn.active {
    font-weight: bold;
}

/* Orientation Lock Animations and Forced Portrait Styles */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Enhanced forced portrait styles - higher specificity */
html.force-portrait {
    width: 100vh !important;
    height: 100vw !important;
    transform: rotate(90deg) !important;
    transform-origin: center center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden !important;
    -webkit-transform: rotate(90deg) !important;
    -moz-transform: rotate(90deg) !important;
    -ms-transform: rotate(90deg) !important;
    -o-transform: rotate(90deg) !important;
}

html.force-portrait body {
    width: 100vh !important;
    height: 100vw !important;
    transform: rotate(90deg) !important;
    transform-origin: center center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-transform: rotate(90deg) !important;
    -moz-transform: rotate(90deg) !important;
    -ms-transform: rotate(90deg) !important;
    -o-transform: rotate(90deg) !important;
}

/* Reset any conflicting transforms on child elements */
html.force-portrait body > * {
    transform: none !important;
    -webkit-transform: none !important;
}

/* Landscape warning overlay styles */
#landscape-warning-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    color: white !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

#landscape-warning-overlay .landscape-warning-content {
    text-align: center !important;
    padding: 40px !important;
    max-width: 320px !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

#landscape-warning-overlay .landscape-warning-icon {
    font-size: 72px !important;
    margin-bottom: 24px !important;
    animation: pulse 2s infinite !important;
    display: block !important;
}

#landscape-warning-overlay .landscape-warning-text h3 {
    margin: 0 0 12px 0 !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

#landscape-warning-overlay .landscape-warning-text p {
    margin: 0 !important;
    font-size: 16px !important;
    opacity: 0.8 !important;
    line-height: 1.4 !important;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Inner span to allow precise clamp / fallback JS measurement */
.mobile-suggestion-btn .mobile-suggestion-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    width: 100%;
}

/* ============================================================================
   MOBILE THREADS MODAL
   Consistent with existing mobile modal patterns
   ============================================================================ */

/* Modal content container */
.mobile-threads-modal-content {
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background-color: #222;
    border-radius: 10px;
    overflow: hidden;
}

/* Header with new thread button and close button */
.mobile-threads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1a1a1a;
}

.mobile-threads-header h2 {
    margin: 0;
    font-size: 24px;
    flex: 1;
    text-align: center;
    color: #00cccc;
}

/* New thread button (+ icon) */
.mobile-threads-new-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00cccc, #0088ff);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.mobile-threads-new-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(0, 204, 204, 0.5);
}

/* Close button styling (matches existing modal close buttons) */
.mobile-threads-header .close-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-threads-header .close-button:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Body container */
.mobile-threads-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    min-height: 150px;
}

/* Loading state */
.mobile-threads-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.mobile-threads-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00cccc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty state */
.mobile-threads-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.mobile-threads-empty p {
    margin: 0 0 8px 0;
}

/* Threads list container */
.mobile-threads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual thread item */
.mobile-thread-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mobile-thread-item:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Active thread highlight */
.mobile-thread-item.active {
    background: rgba(0, 204, 204, 0.15);
    border-color: rgba(0, 204, 204, 0.4);
}

/* Thread icon — plain (legacy; kept for backward compat) */
.mobile-thread-icon {
    font-size: 16px;
    opacity: 0.8;
    color: #00cccc;
}

/* Thread icon — circular container (aligned with desktop .thread-item-icon) */
.mobile-thread-icon-circle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(0, 204, 204, 0.2) 0%, rgba(0, 163, 163, 0.2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-thread-icon-circle i {
    color: #00cccc;
    font-size: 14px;
}

/* Thread info container */
.mobile-thread-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

/* Thread name */
.mobile-thread-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Thread metadata row (aligned with desktop .thread-item-meta) */
.mobile-thread-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Current thread badge — ✓ checkmark (aligned with desktop .thread-item-current) */
.mobile-thread-current {
    background: rgba(0, 204, 204, 0.3);
    color: #00cccc;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Scrollbar styling for threads list */
.mobile-threads-body::-webkit-scrollbar {
    width: 4px;
}

.mobile-threads-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.mobile-threads-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.mobile-threads-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   THREAD LOADING OVERLAY
   Elegant loading animation for chat thread restoration/switching
   ============================================================================ */

/* Overlay that covers the chat messages area during thread loading.
   Attached to .chat-section but positioned to cover .chat-messages area only.
   Uses CSS to calculate position based on sibling elements. */
.thread-loading-overlay {
    position: absolute;
    /* Position to cover the chat-messages area within chat-section */
    top: 30px;  /* Below the toggle buttons */
    left: 5px;
    right: 5px;
    bottom: 70px; /* Above the chat form */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 50; /* Below form but above messages */
    opacity: 0;
    visibility: hidden;
    /* NO transition for showing - only for hiding */
    transition: none;
    pointer-events: none;
    border-radius: 15px;
}

/* Show state - appears INSTANTLY, will fade OUT when removed */
.thread-loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Apply transition only when active so fade-out works */
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

/* Spinner - HIGH VISIBILITY */
.thread-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-top-color: #00ffcc;
    border-radius: 50%;
    animation: threadSpinSmooth 0.7s linear infinite;
    box-shadow: 
        0 0 25px rgba(0, 255, 204, 0.6),
        inset 0 0 10px rgba(0, 255, 204, 0.1);
}

/* Animated dots loader - wave effect (mobile) */
.thread-loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.thread-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ffcc;
    animation: mobileDotPulseWave 1.4s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(0, 255, 204, 0.5);
}

.thread-loading-dots span:nth-child(1) { animation-delay: 0s; }
.thread-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.thread-loading-dots span:nth-child(3) { animation-delay: 0.3s; }
.thread-loading-dots span:nth-child(4) { animation-delay: 0.45s; }
.thread-loading-dots span:nth-child(5) { animation-delay: 0.6s; }

@keyframes mobileDotPulseWave {
    0%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
        background: #00ffcc;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        background: #00cccc;
        box-shadow: 0 0 12px rgba(0, 255, 204, 0.8);
    }
}

/* Smooth spin animation */
@keyframes threadSpinSmooth {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade-in animation for loaded messages */
.chat-messages.thread-messages-loading .message {
    opacity: 0 !important;
    transform: translateY(8px);
    /* CRITICAL: Disable the default messageAppear animation during thread loading */
    animation: none !important;
}

/* Disable transitions during thread loading to prevent flashing */
.chat-messages.thread-messages-loading {
    transition: none !important;
}

/* Also hide messages if BOTH classes are present (transition state) */
.chat-messages.thread-messages-loading.thread-messages-loaded .message {
    opacity: 0 !important;
    animation: none !important;
}

.chat-messages.thread-messages-loaded:not(.thread-messages-loading) .message {
    /* Override the default messageAppear animation with our controlled fade-in */
    animation: threadMessageFadeIn 0.3s ease-out both !important;
}

/* Staggered fade-in for messages */
.chat-messages.thread-messages-loaded .message:nth-child(1) { animation-delay: 0.05s; }
.chat-messages.thread-messages-loaded .message:nth-child(2) { animation-delay: 0.1s; }
.chat-messages.thread-messages-loaded .message:nth-child(3) { animation-delay: 0.15s; }
.chat-messages.thread-messages-loaded .message:nth-child(4) { animation-delay: 0.2s; }
.chat-messages.thread-messages-loaded .message:nth-child(5) { animation-delay: 0.25s; }
.chat-messages.thread-messages-loaded .message:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes threadMessageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Modal scroll: override body.modal-open touch-action:none === */
/* Without this, scrollable containers inside modals inherit touch-action:none
   from body.modal-open, preventing native finger-scroll even when overflow-y:auto. */
.settings-content,
.history-gallery-content,
.mobile-threads-body,
.language-options {
    touch-action: pan-y;
}

/* === SwipeGuard: touch-action hardening for settings & modals === */
.settings-content .settings-option,
#voice-settings-option,
#logo-settings-option,
#reset-logo-option,
#language-settings-option,
#threads-settings-option,
#admin-tools-settings-option,
#fullscreen-settings-option,
#orientation-lock-settings-option,
#sync-settings-option,
#session-transfer-option,
#placeholder-settings-option {
    touch-action: manipulation;
}
.suggestions-list { touch-action: pan-y; }
.logo-option { touch-action: manipulation; }
.suggestions-close-btn, .suggestions-nav-btn { touch-action: manipulation; }
.sync-conflict-close-btn { touch-action: manipulation; }
/* SwipeGuard Phase 2: additional touch-action hardening */
#close-settings,
#save-voice-selection, #cancel-voice-selection,
#save-logo-selection, #cancel-logo-selection,
#close-language-modal, #save-language-btn,
.language-options label,
#close-threads-modal, #mobile-new-thread-btn,
#close-admin-tools,
.profile-info, #close-profile,
#suggestions-lightbulb,
#mobile-session-transfer-button,
.clear-data-option, .clear-data-btn,
#close-clear-data-modal,
#session-takeover-reclaim-btn,
.mobile-visualizer-container,
#parent-grid-custom-toggle,
#parent-grid-send, #parent-grid-cancel,
#admin-send-grid-to-recents {
    touch-action: manipulation;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLET OVERRIDES
   Applied when body has class "is-tablet" (set by mindex.html via DeviceDetection).
   These rules scale specific mobile elements for larger tablet screens while
   keeping phone layout untouched.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. CLIENT LOGO — double the size ── */
body.is-tablet .client-logo img {
    width: 200px;  /* was 100px — ×2 */
}

/* ── 2. HISTORY CONTAINER & CHILDREN — 75 % larger ── */

/* History toggle / search buttons */
body.is-tablet .history-button {
    width: 38px;   /* was 25px — ×1.5 */
    height: 38px;
}

body.is-tablet .history-button i {
    font-size: 21px;  /* was 14px — ×1.5 */
}

/* History button gap */
body.is-tablet .history-buttons {
    gap: 38px;  /* was 25px — ×1.5 */
}

/* History list */
body.is-tablet .history-list {
    gap: 12px;          /* was 8px — ×1.5 */
    max-height: 353px;  /* was 235px — ×1.5 */
}

/* History list items (thumbnails) */
body.is-tablet .history-list li {
    width: 105px;  /* was 70px — ×1.5 */
    height: 78px;  /* was 52px — ×1.5 */
}

/* Grid items in history list - match the scaled size */
body.is-tablet .history-list li.history-grid-item {
    width: 105px;  /* was 70px — ×1.5 */
    height: 78px;  /* was 52px — ×1.5 */
}

/* Thumbnail title text */
body.is-tablet .history-list li .thumbnail-title {
    font-size: 11px;  /* was 7px — ×1.5 (rounded from 10.5) */
}

/* History gallery overlay items */
body.is-tablet .history-gallery-item {
    height: 158px;      /* was 105px — ×1.5 */
    min-height: 158px;  /* was 105px — ×1.5 */
}

body.is-tablet .history-gallery-item img {
    width: 203px;   /* was 135px — ×1.5 */
    height: 135px;  /* was 90px — ×1.5 */
}

body.is-tablet .history-gallery-item-title {
    font-size: 21px;  /* was 14px — ×1.5 */
}

body.is-tablet .history-gallery-item-subtitle {
    font-size: 18px;     /* was 12px — ×1.5 */
    max-height: 4.2em;   /* was 2.8em — ×1.5 (2 lines at larger font) */
}

/* History gallery close button */
body.is-tablet .history-gallery-close {
    font-size: 24px;  /* proportionally larger close button */
}

/* ── 3. CHAT SECTION FONT — 50 % larger ── */

/* Chat messages */
body.is-tablet .chat-messages .message {
    font-size: 18px;  /* was 12px — ×1.5 */
}

/* Chat input text */
body.is-tablet #mobile-user-query {
    font-size: 18px;  /* default was ~16px — ×1.5 of the 12px message size */
}

/* Chat input placeholder (match input font) */
body.is-tablet #mobile-user-query::placeholder {
    font-size: 18px;
}

/* ── 4. GRID HEADER — larger title and subtitle ── */

/* Grid title (desktop base is in grid.css) */
body.is-tablet .grid-title {
    font-size: 27px !important;  /* was 18px — ×1.5 */
}

/* Grid subtitle */
body.is-tablet .grid-subtitle {
    font-size: 21px !important;  /* was 14px — ×1.5 */
}

/* Grid header container — more padding for the larger text */
body.is-tablet .grid-header {
    padding: 12px 18px;  /* was 8px 12px — ×1.5 */
}

/* Grid header toggle button */
body.is-tablet .grid-header-toggle {
    width: 36px;       /* was 24px — ×1.5 */
    height: 36px;
    font-size: 21px;   /* was 14px — ×1.5 */
}

/* ── 5. VIDEO TITLE & SUBTITLE — 50 % larger ── */

body.is-tablet .video-title {
    font-size: 23px !important;  /* was 15px — ×1.5 (rounded from 22.5) */
}

body.is-tablet .video-subtitle {
    font-size: 18px !important;  /* was 12px — ×1.5 */
}

/* ── 6. SUGGESTIONS MODAL — scaled up for tablet screens ── */

/* Widen the modal content card to use more of the tablet screen */
body.is-tablet .suggestions-modal-content {
    max-width: 600px;   /* was 400px — ×1.5 */
    width: 80vw;        /* was 90vw — wider but proportional on tablet */
    padding: 28px;      /* was 20px — more breathing room */
}

/* Larger suggestion buttons */
body.is-tablet .mobile-suggestion-btn {
    height: 65px !important;       /* was 50px — ×1.3 */
    min-height: 65px !important;
    max-height: 65px !important;
    font-size: 1.4em !important;   /* was 1.05em — ~×1.33 */
    padding: 8px 14px !important;  /* was 6px 10px */
    line-height: 1.15 !important;  /* was 1.1 — slight increase for larger font */
}

/* Match the higher specificity variant */
body.is-tablet .suggestions-list .mobile-suggestion-btn {
    /* Inherit the scaled sizes above; keep clamp behavior */
}

/* Also scale generic suggestion buttons (fallback when mobile-suggestion-btn class absent) */
body.is-tablet .suggestions-list button {
    font-size: 1.4em;    /* was 1.1em */
    padding: 4px 8px;    /* was 2px 5px */
}

/* More gap between buttons */
body.is-tablet .suggestions-list {
    gap: 14px;  /* was 10px — ×1.4 */
}

/* Scrollable list max-height: allow more items visible */
body.is-tablet .suggestions-list.scrollable-mobile {
    max-height: 540px !important;  /* was 410px — ×1.3 */
}

/* Larger close button */
body.is-tablet .suggestions-close-btn {
    width: 42px;       /* was 32px — ×1.3 */
    height: 42px;
    font-size: 24px;   /* was 18px — ×1.33 */
}

/* Linked content card inside suggestions modal — scale up */
body.is-tablet .linked-content-item {
    max-width: 600px;    /* was 480px — match modal width */
    min-height: 96px;    /* was 72px — ×1.33 */
}

body.is-tablet .linked-content-thumbnail {
    width: 128px;  /* was 96px — ×1.33 */
    height: 90px;  /* was 68px — ×1.33 */
}

body.is-tablet .linked-content-title {
    font-size: 1.2em;  /* was 0.9em — ×1.33 */
}

body.is-tablet .linked-content-subtitle {
    font-size: 1.05em;  /* was 0.8em — ×1.31 */
}

/* Lightbulb icon — slightly larger on tablet for easier tap target */
body.is-tablet .suggestions-lightbulb {
    width: 50px;   /* was 38px — ×1.3 */
    height: 50px;
    padding: 10px; /* was 8px */
}

body.is-tablet .suggestions-lightbulb i {
    font-size: 1.9em;  /* was 1.5em — ×1.27 */
}

/* Scroll indicator — proportionally larger */
body.is-tablet .mobile-scroll-indicator {
    right: -22px;   /* was -17px — offset for wider modal */
}

/* ── 7. HISTORY GALLERY LIGHTBULB — reposition for larger tablet gallery items ── */
/* Phone: gallery item is 105px tall, img 135px wide → top:70px, right:143px
   Tablet: gallery item is 158px tall, img 203px wide → scale proportionally */
body.is-tablet .lightbulb-nav-icon-mobile {
    top: 106px;    /* was 70px — proportional to 158px height (67% down) */
    right: 211px;  /* was 143px — clears enlarged 203px thumbnail (203 + 8px offset) */
}

/* Also scale the lightbulb icon itself slightly for larger gallery items */
body.is-tablet .history-gallery-item .lightbulb-nav-icon-mobile {
    width: 34px;   /* was 28px — ×1.2 */
    height: 34px;
}

body.is-tablet .history-gallery-item .lightbulb-nav-icon-mobile i {
    font-size: 17px;  /* was 14px — ×1.2 */
}

/* ── 8. VIDEO PLAYER — non-zoomed state fills tablet width ── */
/* Phone: container height 235px works because 16:9 video at ~375px = ~211px tall.
   Tablet: 16:9 video at ~820px needs ~461px tall, but 235px container forces
   object-fit:contain to shrink the video into a tiny centered box.
   Fix: use 56.25vw (= 100vw × 9/16) so the container matches the video's
   natural aspect ratio at any tablet width. The zoomed state is unaffected
   because .video-container:has(#mobile-video-player.zoomed) has higher
   specificity (1-2-0 vs 0-1-1) and still sets height:45vh. */
body.is-tablet .video-container {
    height: 56.25vw;  /* was 235px — 16:9 aspect ratio relative to viewport width */
}

/* ── 9. VIDEO ZOOM TRANSITION FIX — eliminate flash on zoom toggle ── */
/* Root cause: When toggling .zoomed, the video height jumps INSTANTLY
   between 100% (of container) and 32vh while transform: scale() animates
   over 0.3s. On phones this jump is ~9% (barely visible), but on tablets
   it's ~33% — causing an eye-jarring flash of wrong dimensions.
   Fix: add height to the video's transition so all three properties
   (container height, video height, video transform) animate in sync. */
body.is-tablet #mobile-video-player {
    transition: transform 0.3s ease, height 0.3s ease;  /* was transform only */
}

/* ── 10. HISTORY PREVIEW OVERLAY — scaled up for tablet screens ── */
/* Phone: 280×72px overlay. Tablet: 420×108px (×1.5) to stay proportional
   with the 1.5×-scaled history thumbnails and match the visual weight of
   the linked-content cards. JS reads body.is-tablet and sets matching
   overlayWidth/overlayHeight for positioning calculations. */

body.is-tablet .mobile-history-preview-content {
    width: 420px;        /* was 280px — ×1.5 */
    min-height: 108px;   /* was 72px — ×1.5 */
}

body.is-tablet .mobile-history-preview-thumbnail {
    width: 180px;   /* was 120px — ×1.5 */
    height: 120px;  /* was 80px — ×1.5 */
}

body.is-tablet .mobile-history-preview-title {
    font-size: 1.2em;  /* was 0.8em — ×1.5 */
}

body.is-tablet .mobile-history-preview-subtitle {
    font-size: 1.05em;  /* was 0.7em — ×1.5 */
}

/* ── 11. PROFILE DETAILS OVERLAY — scaled up for tablet screens ── */
/* Phone: max-width 500px, 16-22px fonts. On large tablets (1024px+),
   the 500px card covers only ~49% of screen. Scale card and all text
   to fill the tablet display proportionally (~×1.4 fonts, ~×1.5 spacing).
   See docs/TABLET_PROFILE_OVERLAY_SCALING.md for full specification. */

body.is-tablet .profile-details-content {
    max-width: 750px;   /* was 500px — ×1.5 */
    width: 85%;         /* was 90% — slightly narrower % but larger max-width fills better on all tablet sizes */
}

body.is-tablet .profile-header-overlay {
    padding: 22px 30px;  /* was 15px 20px — ×1.5 */
}

body.is-tablet .profile-header-overlay h2 {
    font-size: 28px;  /* was 20px — ×1.4 */
}

body.is-tablet .profile-header-overlay .close-button {
    font-size: 28px;   /* was 20px — ×1.4 */
    width: 42px;        /* was 30px — ×1.4 */
    height: 42px;
}

body.is-tablet .profile-content {
    padding: 30px;       /* was 20px — ×1.5 */
    max-height: calc(80vh - 80px);  /* was calc(80vh - 60px) — account for larger header */
}

body.is-tablet .profile-name-email h3 {
    font-size: 30px;  /* was 22px — ×1.36 */
}

body.is-tablet .profile-name-email {
    margin-bottom: 28px;  /* was 20px — ×1.4 */
}

body.is-tablet #profile-email-overlay {
    font-size: 22px;  /* was 16px — ×1.375 */
}

body.is-tablet .profile-additional-details {
    padding-top: 22px;  /* was 15px — ×1.47 */
}

body.is-tablet .profile-additional-details p {
    font-size: 22px;     /* was 16px — ×1.375 */
    margin: 14px 0;      /* was 10px 0 — ×1.4 */
}

body.is-tablet .profile-content::-webkit-scrollbar {
    width: 8px;  /* was 6px — ×1.33, slightly wider for tablet touch targets */
}

/* ── 12. PROFILE-INFO CARD (on-screen pill) — 40% larger for tablet ── */
/* The .profile-info box sits at top-right (top:5px, right:40px) and grows
   leftward via text-align:right + absolute positioning. We scale contents
   ×1.4 but keep top/right unchanged so it doesn't shift. */

body.is-tablet .profile-info {
    padding: 11px;       /* was 8px — ×1.4 */
    border-radius: 14px; /* was 10px — ×1.4 */
    max-width: 280px;    /* was 200px — ×1.4 */
}

body.is-tablet .profile-info h3 {
    font-size: 22px;  /* was 16px — ×1.375 */
}

body.is-tablet .profile-info .profile-email {
    font-size: 17px;  /* was 12px — ×1.42 */
}

body.is-tablet .profile-info .profile-details {
    font-size: 17px;  /* was 12px — ×1.42 */
}

body.is-tablet #profile-icon-placeholder {
    font-size: 39px;    /* was 28px — ×1.4 */
    padding: 8px 11px;  /* was 6px 8px — ×1.4 */
}

/* ── 13. C-TAG / COMPARISON OVERLAY — scaled for tablet screens ── */
/* Phone: max-width 600px panel, 45-51vh square height, 15-20px fonts.
   On tablets the 600px panel covers only ~58% of the screen and the square
   state is too short. Scale the panel width, square height, fonts, and spacing.
   Start in square mode by default (JS Change A in mobile-cview.js).
   See docs/TABLET_CTAG_COMPARISON_SCALING.md for full specification. */

body.is-tablet .comparison-panel {
    max-width: 850px;       /* was 600px — ×1.42, fills ~83% on iPad Pro */
    margin: 16px auto 0;    /* pin to top of container — prevents vertical shift when toggling square/standard */
}

body.is-tablet .mobile-comparison-container.square {
    height: auto;                  /* remove fixed vh — let top+bottom compute height */
    bottom: calc(300px + 10px);    /* 300px = chat-section normal height + 10px gap */
}

body.is-tablet .mobile-comparison-container {
    bottom: calc(120px + 10px);    /* 120px = chat-section minimal height + 10px gap */
}

body.is-tablet .comparison-header h2 {
    font-size: 26px;  /* was 20px — ×1.3 */
}

body.is-tablet .comparison-header h3 {
    font-size: 20px;  /* was 16px — ×1.25 */
}

body.is-tablet .comparison-column h4 {
    font-size: 22px;  /* was 17px — ×1.29 */
}

body.is-tablet .comparison-content {
    font-size: 20px;  /* was 15px — ×1.33 */
}

body.is-tablet .comparison-panel-scroll {
    padding: 16px;  /* was 10px — ×1.6 */
}

body.is-tablet .comparison-columns {
    gap: 22px;  /* was 16px — ×1.375 */
}

body.is-tablet .comparison-column {
    padding: 22px;  /* was 16px — ×1.375 */
}

/* ═══════════════════════════════════════════════════════════════════
   Mobile User Info Modal
   Mirrors desktop .user-info-modal (style.css:5061-5250)
   ═══════════════════════════════════════════════════════════════════ */

/* Modal backdrop — uses .modal base (display:none; z-index:1100) */
#mobile-user-info-modal {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Card */
.mobile-user-info-card {
    position: relative;
    background: linear-gradient(145deg, rgba(40, 40, 45, 0.98), rgba(25, 25, 30, 0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 24px 18px;
    width: 100%;
    max-width: 300px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-10px);
    transition: transform 0.25s ease;
}

#mobile-user-info-modal.active .mobile-user-info-card {
    transform: translateY(0);
}

/* Close button positioning — must override .modal button (mobile_styles.css:2389)
   which adds background-color:#3498db, margin-top:15px, margin-right:10px,
   padding:10px 15px, border-radius:5px to all buttons inside .modal */
#mobile-user-info-modal .mobile-user-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    z-index: 1;
    margin: 0;
    padding: 5px;
    border-radius: 50%;
    border: none;
    width: 30px;
    height: 30px;
}

#mobile-user-info-modal .mobile-user-info-close:hover,
#mobile-user-info-modal .mobile-user-info-close:active {
    background: rgba(255, 255, 255, 0.15) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Content area */
.mobile-user-info-content {
    text-align: center;
    margin-bottom: 20px;
}

/* User type badge (Guest/User/Admin) */
.mobile-user-info-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.mobile-user-info-badge.guest {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.mobile-user-info-badge.consumer {
    background: rgba(78, 205, 196, 0.15);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.mobile-user-info-badge.admin {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Primary info — Name */
.mobile-user-info-name {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    word-break: break-word;
}

/* Secondary info — Email */
.mobile-user-info-email {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 12px 0;
    word-break: break-all;
}

/* Tertiary info — Public ID */
.mobile-user-info-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Guest message */
.mobile-user-info-guest-msg {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin: 8px 0 0 0;
}

/* DEMO mode label */
.mobile-user-info-demo-label {
    display: inline-block;
    background: #f59e0b;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-left: 10px;
}

/* Logout button */
#mobile-user-info-modal .mobile-user-info-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(220, 53, 69, 0.8);
    background-color: rgba(220, 53, 69, 0.8);
    border: 1px solid rgba(220, 53, 69, 0.9);
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-top: 0;
    margin-right: 0;
}

#mobile-user-info-modal .mobile-user-info-logout:hover,
#mobile-user-info-modal .mobile-user-info-logout:active {
    background: rgba(220, 53, 69, 1);
    background-color: rgba(220, 53, 69, 1);
    border-color: rgba(220, 53, 69, 1);
}

/* Hide logout button for guests */
#mobile-user-info-modal.guest-mode .mobile-user-info-logout {
    display: none;
}

/* Darken settings overlay when user modal is open */
.settings-menu-overlay.user-modal-open::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}