body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 10px;
    padding-top: 90px; /* Add space for the heading */
    background-color: #fafaf8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 20px 10px 20px 200px; /* Top Right Bottom Left */
}

h1 {
    position: absolute;
    top: 20px; /* Adjust this value as needed */
    left: 0;
    right: 0;
    text-align: center;
    color: #1d1d1f;
    margin: 0;
    font-size: 32px;
    z-index: 1; /* Ensures the title appears above other elements */
    font-family: "Noto Serif Display", serif;
    font-weight: 300;
    letter-spacing: 0.05em;
}

@media (max-width: 1450px) {
    .container {
        width: 95%; /* Use percentage when screen is smaller than container */
        padding: 20px 10px 20px 10px; /* Top Right Bottom Left */
        margin-left: auto;
        margin-right: auto;
    }
    h1 {
        text-align: left;
        left: 30px;
    }
}

.text-container {
    display: flex;
    gap: 20px;
}

.text-column {
    padding: 20px;
}

.greek-column {
    flex: 1;
    border-right: 1px solid #e5e5e5;
}

/* this used to be 1.55 but ch 5 didnt work */
.english-column {
    flex: 1.75;
}

.word {
    display: inline-block;
    margin-right: 7px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.3s ease, color 0.3s ease;
}

.word.highlighted {
    background-color: rgba(252, 55, 16, 0.475);
    border-radius: 2px;
    transition: background-color 0.2s ease, opacity 0.3s ease, color 0.3s ease;
}

/* Modified to ensure exact same line height */
.greek-text {
    color: #333;
    font-size: 20px;
    font-family: "SBL Greek", Gentium, serif;
    line-height: 40px; /* Fixed pixel value instead of multiplier */
    text-align: justify;
}

.english-text {
    color: #667;
    font-size: 18px; /* Same as Greek text */
    line-height: 40px; /* Same fixed pixel value */
    text-align: justify;
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
}

.paragraph {
    margin-bottom: 20px;
}

.narrow-screen-message {
    display: none;
}

.hide-narrow-screen-message .narrow-screen-message {
    display: none;
}

/* View Switcher */
.view-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.view-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(245, 245, 247, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #667;
    transition: all 0.2s ease;
}

.view-button:hover {
    background-color: rgba(230, 230, 235, 0.9);
    transform: scale(1.05);
}

.view-button.active {
    background-color: #1d1d1f;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Add these classes for showing/hiding columns */
.hide-greek .greek-column {
    display: none;
}

.hide-english .english-column {
    display: none;
}

/* When one column is hidden, expand the other */
.hide-greek .english-column,
.hide-english .greek-column {
    flex: 1;
    max-width: 100%;
    border-right: none;
}

.single-column-container {
    max-width: 800px;
    padding: 20px 10px 20px 1%; /* Top Right Bottom Left */
}

/* Highlighting Toggle Button */
.highlight-toggle {
    position: absolute;
    top: 20px;
    right: 150px; /* Position it to the right of the view switcher with some spacing */
    z-index: 2;
    display: flex;
    gap: 8px;
}

.highlight-button {
    width: 30px;
    height: 30px;
    border-radius: 4px; /* Square with slightly rounded corners */
    background-color: rgba(252, 55, 16, 0.475); /* Same as the highlight color */
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.highlight-button:hover {
    transform: scale(1.05);
}

.highlight-button.disabled {
    background-color: rgba(252, 55, 16, 0.1); /* Faded version when disabled */
}

/* Class for when highlighting is disabled */
.disable-highlighting .word.highlighted {
    background-color: transparent !important; /* Override the highlighting */
}

/* Fading Toggle Button */
.fade-button {
    width: 30px;
    height: 30px;
    border-radius: 4px; /* Square with slightly rounded corners */
    background-color: rgba(16, 120, 252, 0.475); /* Blue counterpart of the highlight color */
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.fade-button:hover {
    transform: scale(1.05);
}

.fade-button.disabled {
    background-color: rgba(16, 120, 252, 0.1); /* Faded version when disabled */
}

/* Class for when fading is disabled; hearing counts still accrue, and the
   inline opacities keep updating underneath, so re-enabling shows them */
.disable-fading .word {
    opacity: 1 !important;
}

/* English words the reader had to shift-click un-hide; they keep fading
   like any other word, just in dark blue */
.word.unhidden {
    color: #0a4a9e;
}

/* With fading disabled the blue marking is hidden too; words show in
   their original gray until fading is re-enabled */
.disable-fading .word.unhidden {
    color: inherit;
}

/* While Shift is held, words are never selectable, and pairs that can be
   restored show a counter-clockwise restore cursor (dark blue to match
   .unhidden, white halo so it reads on the red highlight too). Safari
   ignores SVG cursors and falls back to the alias keyword. */
.shift-held .word {
    -webkit-user-select: none;
    user-select: none;
}

.shift-held .word.restorable {
    cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cg%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cg%20stroke%3D%22white%22%20stroke-width%3D%224.5%22%3E%3Cpath%20d%3D%22M4.26592%2016.0598C5.11918%2017.778%206.49133%2019.1725%208.18081%2020.0384C9.87029%2020.9043%2011.788%2021.1959%2013.6524%2020.8705%2015.5168%2020.545%2017.2294%2019.6196%2018.5389%2018.2302%2019.8483%2016.8407%2020.6854%2015.0606%2020.9274%2013.1511%2021.1693%2011.2416%2020.8032%209.30348%2019.883%207.6214%2018.9627%205.93933%2017.5367%204.60195%2015.8145%203.80573%2014.0922%203.0095%2012.1645%202.79638%2010.3145%203.19769%208.46448%203.59899%206.9483%204.51138%205.69467%205.95312%205.54287%206.11323%204.95934%206.75937%204.47424%207.73437%22/%3E%3Cpath%20d%3D%22M8.93127%207.81298L3.89101%208.71974L3.00004%203.58952%22/%3E%3C/g%3E%3Cg%20stroke%3D%22%230a4a9e%22%20stroke-width%3D%222.75%22%3E%3Cpath%20d%3D%22M4.26592%2016.0598C5.11918%2017.778%206.49133%2019.1725%208.18081%2020.0384C9.87029%2020.9043%2011.788%2021.1959%2013.6524%2020.8705%2015.5168%2020.545%2017.2294%2019.6196%2018.5389%2018.2302%2019.8483%2016.8407%2020.6854%2015.0606%2020.9274%2013.1511%2021.1693%2011.2416%2020.8032%209.30348%2019.883%207.6214%2018.9627%205.93933%2017.5367%204.60195%2015.8145%203.80573%2014.0922%203.0095%2012.1645%202.79638%2010.3145%203.19769%208.46448%203.59899%206.9483%204.51138%205.69467%205.95312%205.54287%206.11323%204.95934%206.75937%204.47424%207.73437%22/%3E%3Cpath%20d%3D%22M8.93127%207.81298L3.89101%208.71974L3.00004%203.58952%22/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 5 6, alias;

}

/* Fade display off -> the restore affordance would point at visually
   normal words; keep the plain pointer (restore still works) */
.shift-held .disable-fading .word.restorable {
    cursor: pointer;
}

/* One-shot pale blue flash confirming a restore landed */
@keyframes restore-pulse {
    from { background-color: rgba(16, 120, 252, 0.3); }
    to   { background-color: transparent; }
}

.word.restore-pulse {
    animation: restore-pulse 0.6s ease-out;
}

/* Audio player styles */
.audio-player-container {
    background-color: rgba(245, 245, 247, 0.5);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 20px;
    margin: 0;
    max-width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
    min-width: 80px;
}

.audio-button {
    background-color: transparent;
    color: #667;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: color 0.2s;
    width: 30px;
    height: 30px;
}

.audio-button:hover {
    color: #1d1d1f;
}

.audio-button.speed-active {
    color: #1d1d1f;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.audio-button:focus {
    outline: none;
}

.audio-progress-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-progress {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(160, 160, 160, 0.3);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-progress-bar {
    height: 100%;
    background-color: rgba(60, 60, 60, 0.9);
    width: 0;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.05s linear;
    will-change: width;
}

.audio-time {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #667;
    font-weight: 500;
    width: 110px;
    min-width: 110px;
    justify-content: flex-end;
    margin-left: 15px;
}

#current-time, #duration {
    display: inline-block;
    width: 45px; /* Fixed width for time displays */
    text-align: center; /* Center the text within the fixed width */
    font-variant-numeric: tabular-nums; /* Use monospace numbers */
}

/* speed controler */
.speed-control {
    position: relative;
    display: flex;
    align-items: center;
}

#speed-button {
    width: 38px;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
}

.speed-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: rgba(245, 245, 247, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.speed-menu.hidden {
    display: none;
}

#speed-slider {
    width: 140px;
    accent-color: #1d1d1f;
    cursor: pointer;
}

.speed-value {
    width: 42px;
    font-size: 12px;
    font-weight: 500;
    color: #667;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Account button + login panel (top-right cluster, left of the
   highlight/fade toggles; top-left would collide with the h1 at <=1450px) */
.auth-controls {
    position: absolute;
    top: 20px;
    right: 240px;
    z-index: 2;
}

.auth-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(245, 245, 247, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #667;
    transition: all 0.2s ease;
}

.auth-button:hover {
    background-color: rgba(230, 230, 235, 0.9);
    transform: scale(1.05);
}

.auth-button.logged-in {
    background-color: #1d1d1f;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Drops down, right-aligned so it never overflows the viewport */
.auth-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background-color: rgba(245, 245, 247, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.auth-panel.hidden {
    display: none;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

#auth-form.hidden {
    display: none;
}

.auth-panel-title {
    font-size: 12px;
    font-weight: 500;
    color: #667;
}

.auth-panel input {
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    outline: none;
}

.auth-panel input:focus {
    border-color: #1d1d1f;
}

.auth-actions {
    display: flex;
    gap: 8px;
}

.auth-actions button,
#auth-logout {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #333;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#auth-login {
    background-color: #1d1d1f;
    border-color: #1d1d1f;
    color: white;
}

.auth-actions button:hover,
#auth-logout:hover {
    transform: scale(1.03);
}

.auth-signed-in {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-signed-in.hidden {
    display: none;
}

.auth-email-label {
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-error {
    font-size: 12px;
    color: #c0392b;
}

.auth-notice {
    font-size: 12px;
    color: #667;
}

.auth-error.hidden,
.auth-notice.hidden {
    display: none;
}

@media (max-width: 768px) {
    /* Only hide text container in the default view */
    .container:not(.hide-greek):not(.hide-english) .text-container {
        display: none;
    }
    
    /* Show narrow screen message only in default view */
    .container:not(.hide-greek):not(.hide-english) .narrow-screen-message {
        display: block;
        text-align: center;
        padding: 20px;
        color: #667;
        font-style: italic;
        margin-top: 20px;
        background-color: #f8f8f8;
        border-radius: 8px;
    }
    
    /* For single column views, adjust column width */
    .hide-greek .english-column,
    .hide-english .greek-column {
        width: 100%;
        padding: 10px;
    }
}