/* Base styles */
body {
    font-family: "IBM Plex Mono", monospace;
    margin: 20px;
    height: 100%;
    position: fixed;
    width: 100%;
    overflow: hidden;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

h1, h2 {
    font-family: sans-serif;
}

/* Input and button styles */
input {
    padding: 10px;
    font-size: 1.5em;
    margin-right: 10px;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
}

input::placeholder {
    opacity: 0.1;
    text-transform: lowercase;
    font-style: italic;
    font-size: 1em;
    padding: 0.2em;
}

#inputString {
    width: 338px;
}

/* Base button styles */
button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    font-size: 14px;
}

/* Hover state */
button:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

/* Active (pressed) state */
button:active {
    transform: translateY(1px);
    background-color: #e0e0e0;
}

/* Focus state */
button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.4);
}

/* Primary buttons (like generate puzzle buttons) */
button.primary {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

button.primary:hover {
    background-color: #2980b9;
    border-color: #2472a4;
}

button.primary:active {
    background-color: #2472a4;
}

/* Danger buttons (like delete and clear) */
button.danger {
    color: #d63031;
    border-color: #d63031;
    background-color: transparent;
}

button.danger:hover {
    background-color: #d63031;
    color: white;
}

button.danger:active {
    background-color: #c0392b;
}

/* Icon buttons (like in saved pages) */
button.icon {
    padding: 4px 8px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: #666;
}

button.icon:hover {
    color: #d63031;
    background: none;
}

button.icon:active {
    transform: translateY(1px);
}

/* Disabled state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:disabled:hover {
    background-color: inherit;
    border-color: inherit;
}

/* Column and layout styles */
.controls {
    margin-top: 20px;
}

.columns {
    display: flex;
    margin-top: 20px;
    width: 720px;
    border: 1px solid #ccc;
    height: calc(100vh - 350px);
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

.column {
    width: 120px;
    padding-left: 8px;
    flex-grow: 1;
    font-size: 1.2em;
    position: relative;
    z-index: 2;
    height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    position: sticky;
    top: 0;
    background-color: inherit;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.header-highlighted {
    background-color: rgba(130, 255, 167, 0.63) !important;  /* Light mode highlight */
}

body.dark-mode .column {
    background-color: #2a2a2a;
}

body.dark-mode .header-container {
    background-color: #2a2a2a;
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .header-highlighted {
    background-color: rgba(147, 197, 253, 0.35) !important;  /* Dark mode highlight with increased opacity */
}

.column h3 {
    text-align: center;
    font-style: italic;
    margin: 0;
    transition: background-color 0.2s ease;
    flex: 1;
    padding: 0 5px;
}

.column-remove-btn {
    font-size: 1.2em;
    padding: 0 6px;
    margin-left: 4px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.column-remove-btn:hover {
    opacity: 1;
    color: #ff4444;
}

body.dark-mode .column-remove-btn {
    color: #999;
}

body.dark-mode .column-remove-btn:hover {
    color: #ff6666;
}

.column h3.highlighted {
    background-color: rgba(237, 255, 155, 0.14);  /* Light mode color */
}

body.dark-mode .column h3.highlighted {
    background-color: rgba(147, 197, 253, 0.1);  /* Dark mode color */
}

.column ul {
    list-style-type: none;
    padding: 0;
    position: relative;
    z-index: 1;
    flex: 1;
    margin: 0;
    width: 100%;
}

.column li {
    margin: 6px 2px;
    padding: 2px 4px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    border-radius: 2px;
}

.column li:focus {
    outline: 2px solid #3498db;
    background-color: #fcff5d23;
    outline-offset: -1px;
}

.highlighted-column {
    position: relative;
}

/* Navigation styles */
.navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

/* Add these styles */
#navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;  /* Prevent line breaks */
  margin: 20px 0;
}

#pageInfo {
  min-width: 60px;  /* Ensure consistent width */
  text-align: center;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group:first-child {
    padding-right: 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: transparent;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-btn:active {
    transform: translateY(1px);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn.danger {
    color: #cd5555;
}

.nav-btn.danger:hover {
    background: rgba(214, 48, 49, 0.1);
    color: #d63031;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    background: transparent;
}

.page-info {
    padding: 0 12px;
    font-size: 14px;
    color: #666;
}

/* Dark mode support */
body.dark-mode .navigation {
    background: rgba(42, 42, 42, 0.9);
}

body.dark-mode .nav-group:first-child {
    border-right-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-btn.danger {
    color: #ff6b6b;
}

body.dark-mode .nav-btn.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

body.dark-mode .page-info {
    color: #999;
}

/* Combination styles */
.combination {
    display: none;
}

.combination.active {
    display: block;
}

/* Loading spinner */
.spinner {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
    position: relative;
}

.spinner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-family: monospace;
    color: #666;
}

body.dark-mode .spinner-text {
    color: #999;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Update loading container styles */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.loading-message {
    text-align: center;
    font-style: italic;
    color: #666;
    margin: 0;
}

.cancel-spinner-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-square {
    width: 20px;
    height: 20px;
    background-color: #000000;
    animation: spinSquare 1s cubic-bezier(.35,.82,.29,.19) infinite;
}

@keyframes spinSquare {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

/* Dark mode support */
body.dark-mode .cancel-square {
    background-color: #ffffff;
}

/* Hover effects */
.cancel-spinner-button:hover .cancel-square {
    background-color: #ff4444;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px); /* Add this line */
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 10px;
}

.close-button:hover {
    color: #555;
}

.shortcuts-content {
    margin-top: 20px;
}

.shortcuts-content ul {
    margin-bottom: 20px;
}

.shortcuts-content li {
    margin: 8px 0;
    line-height: 1.4;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .columns {
    border-color: #444;
    background-color: #2a2a2a;
}

body.dark-mode input {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444;
}

body.dark-mode button {
    background-color: #2a2a2a;
    border-color: #444;
    color: #fff;
}

body.dark-mode button:hover {
    background-color: #404040;
    border-color: #555;
}

body.dark-mode button:active {
    background-color: #333;
}

body.dark-mode button.primary {
    background-color: #3498db;
    border-color: #2980b9;
}

body.dark-mode button.primary:hover {
    background-color: #2980b9;
    border-color: #2472a4;
}

body.dark-mode button.primary:active {
    background-color: #2472a4;
}

body.dark-mode button.danger {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background-color: transparent;
}

body.dark-mode button.danger:hover {
    background-color: #ff6b6b;
    color: #1a1a1a;
}

body.dark-mode button.danger:active {
    background-color: #e74c3c;
}

body.dark-mode button.icon {
    color: #999;
    background: none;
}

body.dark-mode button.icon:hover {
    color: #ff6b6b;
}

body.dark-mode .navigation {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #ffffff;
}

body.dark-mode .close-button:hover {
    color: #fff;
}

body.dark-mode .column li:focus {
    outline-color: #5dade2;
    background-color: #ffffff23;
}

/* Scrollbars */

.column::-webkit-scrollbar {
    width: 6px;
}

.column::-webkit-scrollbar-track {
    background: transparent;
}

.column::-webkit-scrollbar-thumb {
    background-color: rgba(155, 155, 155, 0.5);
    border-radius: 20px;
    border: transparent;
}

.column {
    scrollbar-width: thin;
    scrollbar-color: rgba(155, 155, 155, 0.5) transparent;
}

body.dark-mode .column::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .column {
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.delete-btn {
    margin-left: 10px;
    color: #d63031;
}

.delete-btn:hover {
    background-color: #ffebeb;
}

.undo-btn {
    margin-left: 10px;
}

.undo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Letter counter styles */
.letter-counter {
    margin-left: 10px;
    font-family: monospace;
    font-size: 1.2em;
    color: #66666670;
    white-space: nowrap;
}

.letter-counter.warning {
    color: #e74c3c;
}

body.dark-mode .letter-counter {
    color: #9999996f;
}

body.dark-mode .letter-counter.warning {
    color: #e74c3c;
}

/* Input and controls */
.input-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 338px; /* Match the original input width */
}

.input-container input {
    width: 100%;
    padding: 10px;
    padding-right: 30px; /* Space for the 'x' */
    font-size: 1.5em;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
}

.input-container input::placeholder {
    opacity: 0.1;
    text-transform: lowercase;
    font-style: italic;
    font-size: 1em;
    padding: 0.2em;
}

.clear-input-btn {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    margin: auto;
    height: 20px;
    line-height: 20px;
    background: none;
    border: none;
    padding: 0;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.clear-input-btn:hover {
    opacity: 1;
    color: #666;
    background: none;
}

.clear-input-btn:active {
    transform: none;
    background: none;
}

/* Dark mode input styles */
body.dark-mode .input-container input {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444;
}

body.dark-mode .clear-input-btn {
    color: #666;
}

body.dark-mode .clear-input-btn:hover {
    color: #999;
    background: none;
}

body.dark-mode .letter-counter {
    color: #9999996f;
}

body.dark-mode .letter-counter.warning {
    color: #e74c3c;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    html, body {
        position: relative;
        height: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
        margin: 0;
        padding: 0;
        padding-bottom: 100px;
    }

    .columns {
        flex: 1;
        width: 100%;
        height: calc(100vh - 280px);
        margin: 0;
        padding: 0;
        overflow-x: auto;
        border: 1px solid #ccc;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .column {
        min-width: 90px;
        font-size: 0.9em;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scroll-snap-type: y proximity;
        will-change: transform;
        padding: 0;
        margin-right: 8px;
    }

    .column ul {
        padding: 0;
        margin: 0;
        position: relative;
        contain: content;
    }

    .column li {
        padding: 8px 4px;
        margin: 8px 2px;
        min-height: 24px;
        touch-action: pan-y;
    }

    body {
        margin: 0;
    }

    h1 {
        display: none;
    }

    /* Main content container */
    .content-wrapper {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 4px;
        box-sizing: border-box;
        gap: 0;
    }

    /* Input container - override the desktop width constraint */
    .input-container {
        width: 100%;
        display: flex;
        margin: 0 0 4px 0;
    }

    .input-container input {
        width: 100%;
        font-size: 1.2em;
        box-sizing: border-box;
        margin: 0;
        border-radius: 0;
    }

    #inputString {
        width: 100%;
    }

    /* Controls */
    .controls {
        display: flex;
        flex-direction: row;
        width: 100%;
        margin: 0 0 4px 0;
        padding: 0;
        gap: 4px;
    }

    .controls button {
        flex: 1;
        padding: 12px 8px;
        font-size: 0.9em;
        white-space: nowrap;
        min-height: 44px;
        margin: 0;
        border-radius: 4px;
    }

    /* Theme display */
    .theme-display {
        display: none;
    }

    /* Navigation */
    .navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 8px;
        margin: 0;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
        display: flex;
        flex-direction: column;
        gap: 8px;
        box-sizing: border-box;
        transform: none;
        z-index: 100; /* Ensure it's above other content */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Add shadow for better visibility */
    }

    #navigation {
        margin: 5px;
    }

    .nav-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-group:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding-right: 0px;
        padding-bottom: 8px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .nav-btn {
        flex: 0 1 auto;
        min-height: 44px; /* Larger touch target */
        min-width: 44px; /* Larger touch target */
        padding: 8px;
        font-size: 0.9em;
        justify-content: center;
        max-width: calc(33.33% - 8px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        touch-action: manipulation; /* Prevent double-tap zoom */
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .page-info {
        flex: 0 0 80px;
        text-align: center;
        font-size: 1em;
        padding: 0 12px;
    }

    /* Reduce animations for better performance */
    .nav-btn:active,
    button:active {
        transform: none;
    }

    /* Simplify transitions */
    .nav-btn,
    button,
    .column li,
    .spotlight-item {
        transition: none;
    }

    /* Hide elements */
    .options-panel,
    .letter-counter,
    .nav-btn[onclick="saveCurrentPage()"] {
        display: none;
    }
}

/* Touch improvements */
@media (hover: none) {
    .nav-btn:active,
    .controls button:active {
        transform: scale(0.98);
        opacity: 0.8;
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    /* Increase touch targets */
    .column li {
        padding: 8px 4px;
        margin: 8px 2px;
        min-height: 24px;
    }
    
    /* Improve scrolling */
    .columns,
    .column {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Spotlight panel */
.spotlight-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.spotlight-header {
    margin-bottom: 10px;
}

.spotlight-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.spotlight-header-content h3 {
    margin: 0;
    font-size: 1.2em;
    flex-grow: 1;
    text-align: center;
}

.spotlight-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.clear-spotlight-btn {
    padding: 4px 8px;
    font-size: 0.8em;
    color: #d63031;
    background: none;
    border: 1px solid #d63031;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-spotlight-btn:hover {
    background: #d63031;
    color: white;
}

/* Dark mode support */
body.dark-mode .clear-spotlight-btn {
    color: #ff7675;
    border-color: #ff7675;
}

body.dark-mode .clear-spotlight-btn:hover {
    background: #ff7675;
    color: #262626;
}

.spotlight-list {
    max-height: 400px;
    overflow-y: auto;
}

.spotlight-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 4px 0;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.spotlight-item:hover {
    background-color: #f8f8f8;
}

.spotlight-item label {
    flex-grow: 1;
    margin-left: 8px;
    cursor: pointer;
}

.spotlight-item input[type="checkbox"] {
    cursor: pointer;
    pointer-events: none;
}

.spotlight-item button {
    padding: 2px 6px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2em;
    transition: color 0.2s ease;
    z-index: 1;
}

.spotlight-item button:hover {
    color: #d63031;
}

/* Dark mode styles */
body.dark-mode .spotlight-panel {
    background: #262626;
    border-color: #898989;
}

body.dark-mode .spotlight-item {
    border-color: #898989;
    color: #ecf0f1;
}

body.dark-mode .spotlight-item:hover {
    background-color: #34495e;
}

body.dark-mode .spotlight-item button {
    color: #95a5a6;
}

body.dark-mode .spotlight-item button:hover {
    color: #e74c3c;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .spotlight-panel {
        display: none !important;
    }
}

.saved-pages-header {
    text-align: center;
    margin-bottom: 10px;
}

.saved-pages-header h3 {
    margin: 0;
    font-size: 1em;
}

.saved-pages-list {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 10px;
}

.saved-page-item {
    padding: 8px;
    margin: 4px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-page-item:hover {
    background: #f0f0f0;
}

.saved-page-item span {
    font-style: italic;
}

.saved-page-item button {
    padding: 2px 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
}

.saved-page-item button:hover {
    color: #d63031;
}

.clear-saved-btn {
    padding: 4px 8px;
    font-size: 0.8em;
    color: #d63031;
    background: none;
    border: 1px solid #d63031;
    border-radius: 3px;
    cursor: pointer;
}

.clear-saved-btn:hover {
    background: #d63031;
    color: white;
}

/* Dark mode support */
body.dark-mode .saved-pages-panel {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .saved-page-item {
    background: #333;
    border-color: #444;
    color: #fff;
}

body.dark-mode .saved-page-item:hover {
    background: #404040;
}

body.dark-mode .saved-page-item button {
    color: #999;
}

body.dark-mode .saved-page-item button:hover {
    color: #d63031;
}

.error-message {
    text-align: center;
    padding: 20px;
    background: #fff3f3;
    border: 1px solid #ffd7d7;
    border-radius: 5px;
    margin: 20px 0;
}

.error-message p {
    color: #d63031;
    margin-bottom: 15px;
}

.return-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.return-btn:hover {
    background: #2980b9;
}

/* Dark mode support */
body.dark-mode .error-message {
    background: #402020;
    border-color: #603030;
}

.columns {
    position: relative;  /* Ensure this is set */
}

.highlight-overlay {
    position: absolute;
    pointer-events: none;
}

.copy-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Success notification styling */
.copy-notification.success {
    background-color: #333;
    color: white;
}

/* Error notification styling */
.copy-notification.error {
    background-color: #dc2626;  /* Red background */
    color: white;
}

.copy-notification.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Dark mode support */
body.dark-mode .copy-notification.success {
    background-color: #666;
    color: white;
}

body.dark-mode .copy-notification.error {
    background-color: #ef4444;  /* Slightly brighter red for dark mode */
    color: white;
}

.options-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.option-btn {
    padding: 8px 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.option-btn svg {
    width: 20px;
    height: 20px;
}

/* Dark mode support */
body.dark-mode .option-btn {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .option-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

kbd {
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.2),
      0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
    color: #333;
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
  }
  
.shortcuts-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.shortcuts-content th {
    text-align: center;
    font-style: italic;
    text-transform: uppercase;
    padding: 0.8em;
    background-color: rgba(128, 128, 128, 0.163);
    color: rgba(128, 128, 128, 0.254);
    font-weight: bold;
    font-size: 0.8em;
}

.shortcuts-content td {
    padding: 0.5em;
    border-top: 1px solid rgba(128, 128, 128, 0.137);
}

.shortcuts-content td:first-child {
    white-space: nowrap;
    padding-right: 1em;
}

.instructions-content {
    font-family: sans-serif;
    line-height: 2em;
}

/* Add viewport meta tag styles */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    padding-bottom: 120px;
  }

  h1 {
    display: none;
  }

  /* Hide options panel and letter count on mobile */
  .options-panel,
  .letter-counter {
    display: none;
  }

  /* Controls adjustments - horizontal layout */
  .controls {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin: 10px 0;
    max-width: 100%;
    padding: 0;
  }

  .controls button {
    flex: 1;
    padding: 12px 8px;
    font-size: 0.9em;
    white-space: nowrap;
    min-height: 50px; /* Larger touch target */
  }

  /* Results container adjustments */
  .columns {
    width: 100%;
    height: calc(100vh - 300px);
    padding: 0;
    margin: 10px 0;
    overflow-x: auto;
  }

  .column {
    min-width: 90px;
    margin-right: 8px;
    font-size: 0.9em;
    height: 100%;
    overflow-y: auto;
  }

  /* Enhanced Navigation Bar */
  .navigation {
    width: calc(100% - 20px);
    left: 5px;
    bottom: 10px;
    padding: 12px 8px;
    flex-direction: column;
    gap: 8px;
    border-radius: 12px;
    transform: none;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
  }

    /* Hide save page button on mobile */
    .nav-btn[onclick="saveCurrentPage()"] {
        display: none;
      }

  .nav-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-group:first-child {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 8px;
  }

  .nav-btn {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 8px;
    font-size: 0.9em;
    justify-content: center;
    min-width: 44px;
    max-width: calc(33.33% - 8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .page-info {
    font-size: 1em;
    padding: 0 12px;
    flex: 0 0 auto;
    text-align: center;
    min-width: 80px;
  }

  /* Ensure content doesn't get hidden behind nav */
  body {
    padding-bottom: 0px;
  }

  .column h3 {
    padding: 8px 0;
    font-size: 0.95em;
  }
}

/* Additional touch improvements */
@media (hover: none) {
  .nav-btn:active {
    transform: scale(0.98);
    opacity: 0.8;
  }

  .controls button:active {
    transform: scale(0.98);
    opacity: 0.8;
  }
}

/* Spotlight input container */
.spotlight-input-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.spotlight-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.spotlight-input:focus {
    border-color: #3498db;
}

.spotlight-add-btn {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.spotlight-add-btn:hover {
    background: #2980b9;
}

/* Dark mode support */
body.dark-mode .spotlight-input-container {
    border-top-color: #34495e;
}

body.dark-mode .spotlight-input {
    background: #2a2a2a;
    border-color: #444;
    color: #ecf0f1;
}

body.dark-mode .spotlight-input:focus {
    border-color: #3498db;
}

body.dark-mode .spotlight-input::placeholder {
    color: #95a5a6;
}

/* Theme display styles */
.theme-display {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
    color: #a0a0a0;
    padding: 20px 15px 10px 15px;
    z-index: 100;
    white-space: nowrap;
    background-color: rgb(255, 255, 255);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
}

.theme-display:hover {
    box-shadow: 0 3px 3px rgba(4, 67, 77, 0.2);
    color: #333;
}

body.dark-mode .theme-display {
    color: #aaa;
    background-color: rgba(40, 40, 40, 0.8);
}

body.dark-mode .theme-display:hover {
    background-color: rgba(50, 50, 50, 0.95);
    color: #ddd;
}

/* Version display styling */
.version-display {
    position: fixed;
    bottom: 8px;
    left: 8px;
    font-size: 0.7em;
    color: #aaa;
    opacity: 0.6;
    font-family: monospace;
    pointer-events: none;
    user-select: none;
    z-index: 100;
}

body.dark-mode .version-display {
    color: #666;
}

@media (max-width: 768px) {
    .version-display {
        bottom: 4px;
        left: 4px;
        font-size: 0.6em;
    }
}

/* Add styles for the mode toggle button */
.mobile-only {
    display: none !important;
    visibility: hidden;
}

/* Base styles for the mode toggle button */
#modeToggleBtn {
    border-width: 2px;
    z-index: 1000;
}

/* Spotlight mode */
.spotlight-mode {
    color: rgb(46, 204, 113);
    border-color: rgb(46, 204, 113);
    background-color: rgba(46, 204, 113, 0.23);
}

/* Dark mode spotlight */
body.dark-mode .spotlight-mode {
    color: rgb(46, 204, 113);
    border-color: rgb(46, 204, 113);
    background-color: rgba(46, 204, 113, 0.23);
}

/* Delete mode */
.delete-mode {
    color: rgb(255, 183, 0);
    border-color: rgb(255, 183, 0);
    background-color: rgba(255, 183, 0, 0.23);
}

/* Dark mode delete */
body.dark-mode .delete-mode {
    color: rgb(255, 183, 0);
    border-color: rgb(255, 183, 0);
    background-color: rgba(255, 183, 0, 0.23);
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
        visibility: visible !important;
    }
    .theme-display {
        top: 75%;
        display: block !important;
        z-index: 100;
    }
}