body {
    background-color: #0F172A;
    overflow-x: hidden;
}

/* Login modal styles moved to public/css/login-modal.css for reuse across pages. */

.info-tut {
    height: 12vh;
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    gap: 65%;
}

.info-tut p {
    color: #FFFFFF;
}

#tutorial-button {
    background-color: #06B6D4;
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 10px;
    font-family: sans-serif;
    text-decoration: none;
}

.container {
    height: 90vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

/* list-words is hidden until a list is selected via lists.js */
.list-words {
    display: none;
}

.list-words.is-visible {
    display: flex;
}

.lists-container {
    height: 100%;
    width: 35%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3%;
}

.public-lists,
.private-lists {
    background-color: #1E293B;
    border-style: solid;
    border-color: #334155;
    height: 85%;
    width: 95%;
    border-radius: 25px;
}

.private-lists {
    display: flex;
    flex-direction: column;
}

.list-words.is-visible {
    background-color: #1E293B;
    border-style: solid;
    border-color: #334155;
    height: 95%;
    width: 65%;
    min-width: 0;
    border-radius: 25px;
    flex-direction: column;
    padding: 1rem 2rem;
    box-sizing: border-box;
    overflow: hidden;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.public-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.private-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.private-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.public-lists > p {
    margin: 0;
    padding-left: 2rem;
    color: #94A3B8;
}

.community-list-placeholders {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem 2rem 0;
}

.community-list-item,
.private-list-item {
    width: 100%;
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.community-list-item:hover,
.private-list-item:hover {
    background-color: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366F1;
}

.community-list-item h2,
.private-list-item h2 {
    margin: 0;
    color: #F8FAFC;
    font-size: 1.1rem;
}

.community-list-item p,
.private-list-item p {
    margin: 0.35rem 0 0;
    color: #94A3B8;
    font-size: 0.95rem;
}

.logged-out-placeholder {
    flex: 1;
    margin: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

.logged-out-placeholder p {
    margin: 0;
    color: #94A3B8;
}

.logged-out-placeholder button {
    background-color: #6366F1;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.logged-out-placeholder button:hover {
    background-color: #4F46E5;
}

.private-list-placeholders {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem 2rem 0;
}

.no-lists-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem;
}

.no-lists-placeholder p {
    margin: 0;
    color: #94A3B8;
    font-size: 0.95rem;
}

.create-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #F97316;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'inter', sans-serif;
    cursor: pointer;
}

.create-list-btn:hover {
    background-color: #ea6c0a;
}


.view-all-button {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: none;
    color: #F1F5F9;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    font-family: sans-serif;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 15px;
    border: solid #334155 2px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    background-color: #0F172A;
}

.view-all-button:hover {
    background-color: rgba(51, 65, 85, 0.6);
}

.view-all-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.45);
}

.view-all-button svg {
    flex-shrink: 0;
}

.view-all-button.is-hidden {
    display: none;
}

.list-words-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.list-words-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.list-words-title-group h1 {
    margin: 0;
    color: #F8FAFC;
}

.edit-list-button {
    border: none;
    border-radius: 10px;
    background-color: #F97316;
    color: #FFFFFF;
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.edit-list-button:hover {
    background-color: #ea6c0a;
}

.list-words-label {
    margin: 1.1rem 0 0;
    color: #F8FAFC;
}

.list-words-scroll {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 0.5rem;
}

.word-pair-item {
    width: 100%;
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 11rem 14px minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
    padding: 0.7rem 1rem;
    box-sizing: border-box;
    min-width: 0;
}

.word-nl {
    color: #FFFFFF;
    min-width: 0;
}

.word-arrow {
    justify-self: center;
    transform: translateX(2px);
}

.word-en {
    color: #06B6D4;
    min-width: 0;
}

.start-practice-btn {
    margin-top: 0.75rem;
    width: calc(100% - 0.5rem);
    background-color: #6366F1;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'inter', sans-serif;
    cursor: pointer;
    flex-shrink: 0;
}

.start-practice-btn svg {
    flex-shrink: 0;
}

.start-practice-btn:hover {
    background-color: #4F46E5;
}

#practice-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    z-index: 900;
}

#practice-backdrop.is-open {
    display: block;
}

#practice-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(34rem, 90vw);
    height: 60vh;
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 1rem 0 1.1rem;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    z-index: 901;
}

#practice-modal.is-open {
    display: flex;
}

.practice-modal-header {
    width: 80%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.practice-modal-header h1 {
    color: #FFFFFF;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}

.practice-close-btn {
    border: none;
    background: none;
    color: #94A3B8;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.practice-summary-box {
    width: 80%;
    min-height: 5.3rem;
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: rgba(51, 65, 85, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.6rem 0.75rem;
}

.practice-summary-box p {
    margin: 0;
    color: #94A3B8;
    font-size: 0.9rem;
}

.practice-summary-box h2 {
    margin: 0.25rem 0 0;
    color: #FFFFFF;
    font-size: 1.15rem;
    font-weight: 600;
}

.practice-direction-label {
    width: 80%;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    color: #94A3B8;
    font-size: 0.9rem;
    text-align: center;
}

.practice-direction-btn {
    width: 80%;
    border: 1px solid #334155;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.practice-direction-title {
    margin: 0;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
}

.practice-direction-subtitle {
    margin: 0.28rem 0 0;
    color: #94A3B8;
    font-size: 0.85rem;
}

.practice-direction-btn:hover {
    background-color: rgba(51, 65, 85, 0.36);
}

.practice-direction-btn.is-selected {
    border-color: #6366F1;
    background-color: rgba(99, 102, 241, 0.14);
}

.practice-start-btn {
    width: 80%;
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: #1E293B;
    color: #94A3B8;
    padding: 0.7rem 0.85rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    cursor: not-allowed;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.practice-start-btn:enabled {
    background-color: #6366F1;
    color: #FFFFFF;
    cursor: pointer;
}

.practice-start-btn:enabled:hover {
    background-color: #4F46E5;
}

.practice-cancel-btn {
    width: 80%;
    margin-top: 0.25rem;
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: #0F172A;
    color: #94A3B8;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.viewall-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    z-index: 910;
}

.viewall-backdrop.is-open {
    display: block;
}

.viewall-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(44rem, 94vw);
    max-height: 78vh;
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 1rem;
    display: none;
    flex-direction: column;
    z-index: 911;
}

.viewall-modal.is-open {
    display: flex;
}

.viewall-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.viewall-modal-header h1 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.2rem;
}

.viewall-close-btn {
    border: none;
    background: none;
    color: #94A3B8;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.viewall-list-scroll {
    overflow-y: auto;
    min-height: 12rem;
    max-height: calc(78vh - 4.8rem);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
    padding-right: 0.35rem;
}

.viewall-list-item {
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: #0F172A;
    padding: 0.8rem 0.9rem;
    text-align: left;
    cursor: pointer;
}

.viewall-list-item h2 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1rem;
}

.viewall-list-item p {
    margin: 0.3rem 0 0;
    color: #94A3B8;
    font-size: 0.86rem;
}

.viewall-list-item:hover {
    border-color: #6366F1;
    background-color: rgba(99, 102, 241, 0.14);
}

.viewall-empty {
    color: #94A3B8;
    font-size: 0.95rem;
    padding: 0.6rem;
}

#create-list-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    z-index: 920;
}

#create-list-backdrop.is-open {
    display: block;
}

#create-list-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(38rem, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 1rem 1.2rem 1.25rem;
    display: none;
    flex-direction: column;
    gap: 0.85rem;
    z-index: 921;
}

#create-list-modal.is-open {
    display: flex;
}

.create-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.create-list-header h1 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.2rem;
}

.create-list-close-btn {
    border: none;
    background: none;
    color: #94A3B8;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.create-list-subtext {
    margin: 0;
    color: #94A3B8;
    font-size: 0.92rem;
}

.create-list-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.create-list-field-label {
    margin: 0;
    color: #94A3B8;
    font-size: 0.9rem;
}

#create-list-name {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #334155;
    background-color: #0F172A;
    color: #F8FAFC;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    font-family: 'inter', sans-serif;
}

#create-list-name::placeholder {
    color: #64748B;
}

#create-list-name:focus {
    outline: none;
    border-color: #6366F1;
}


.create-list-visibility-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.create-list-visibility-btn {
    border: 1px solid #334155;
    background-color: #0F172A;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    cursor: pointer;
}

.create-list-visibility-btn:hover {
    background-color: rgba(51, 65, 85, 0.45);
}

.create-list-visibility-btn.is-selected {
    border-color: #6366F1;
    background-color: rgba(99, 102, 241, 0.14);
}

.create-list-visibility-title {
    color: #FFFFFF;
    font-size: 0.98rem;
    font-weight: 600;
}

.create-list-visibility-subtitle {
    color: #94A3B8;
    font-size: 0.82rem;
}

.create-list-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.2rem;
}

.create-list-submit-btn,
.create-list-cancel-btn {
    border-radius: 12px;
    border: 1px solid #334155;
    padding: 0.72rem 0.9rem;
    font-size: 0.94rem;
    cursor: pointer;
}

.create-list-submit-btn {
    background-color: #6366F1;
    color: #FFFFFF;
}

.create-list-submit-btn:hover {
    background-color: #4F46E5;
}

.create-list-cancel-btn {
    background-color: #0F172A;
    color: #94A3B8;
}

@media (max-width: 760px) {

    .info-tut {
        width: 100%;
        height: auto;
        margin: 0 auto 0.75rem;
        padding: 0 1rem;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 0.8rem;
        font-size: 1rem;
    }

    .info-tut p {
        text-align: center;
        font-size: 1rem;
    }

    #tutorial-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .container {
        height: auto;
        min-height: 0;
        padding: 0 1rem 1.25rem;
        flex-direction: column;
        gap: 1rem;
    }

    .lists-container {
        width: 100%;
        height: auto;
        gap: 1rem;
    }

    .public-lists,
    .private-lists {
        width: 100%;
        height: auto;
        min-height: 13rem;
        border-radius: 20px;
    }

    .public-header,
    .private-header,
    .list-words-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .public-header h1,
    .private-header h1,
    .list-words-title-group h1 {
        font-size: 1.1rem;
        line-height: 1.25;
    }

    .public-lists > p {
        padding: 0 1rem;
        margin-top: -0.25rem;
    }

    .community-list-placeholders,
    .private-list-placeholders {
        margin: 1rem;
    }

    .community-list-item,
    .private-list-item {
        padding: 0.8rem 0.9rem;
    }

    .logged-out-placeholder,
    .no-lists-placeholder {
        margin: 1rem;
        padding: 2rem 1rem;
    }

    .logged-out-placeholder button,
    .create-list-btn {
        width: 100%;
        justify-content: center;
    }

    .view-all-button,
    .edit-list-button,
    .start-practice-btn {
        width: 100%;
        justify-content: center;
    }

    .list-words.is-visible {
        width: 100%;
        height: auto;
        min-height: 0;
        border-radius: 20px;
        padding: 1rem;
        max-height: calc(100vh - 10rem);
    }

    .list-words-label {
        margin-top: 0.5rem;
    }

    .list-words-scroll {
        max-height: none;
        padding-right: 0;
    }

    .word-pair-item {
        grid-template-columns: 1fr;
        row-gap: 0.35rem;
        justify-items: start;
        padding: 0.85rem 0.9rem;
    }

    .word-arrow {
        display: none;
    }

    .word-en {
        color: #94A3B8;
    }

    .start-practice-btn {
        margin-top: 0.5rem;
        padding: 0.85rem 1rem;
    }

    #practice-modal,
    .viewall-modal,
    #create-list-modal,
    #login {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        height: auto;
    }

    #practice-modal,
    .viewall-modal,
    #create-list-modal {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .practice-modal-header,
    .viewall-modal-header,
    .create-list-header {
        width: 100%;
    }

    .practice-summary-box,
    .practice-direction-btn,
    .practice-start-btn,
    .practice-cancel-btn {
        width: 100%;
    }

    .practice-direction-btn {
        padding: 1.1rem;
    }

    .practice-summary-box {
        min-height: 4.75rem;
    }

    .viewall-list-scroll {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 7rem);
    }

    .viewall-list-item {
        width: 100%;
    }

    .create-list-visibility-options,
    .create-list-actions {
        grid-template-columns: 1fr;
    }

    .create-list-visibility-btn {
        align-items: flex-start;
        text-align: left;
    }

    .create-list-submit-btn,
    .create-list-cancel-btn {
        width: 100%;
    }

    #login {
        padding: 1.25rem;
    }

    .public-header h1,
    .private-header h1,
    .list-words-title-group h1,
    .practice-modal-header h1,
    .viewall-modal-header h1,
    .create-list-header h1,
    #login .login-title {
        font-size: 1.05rem;
    }

}

@media (min-width: 761px) and (max-width: 1024px) {

    .info-tut {
        width: 100%;
        height: auto;
        margin: 0 auto 0.9rem;
        padding: 0 1.5rem;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 0.8rem;
        font-size: 1.2rem;
    }

    .info-tut p {
        text-align: center;
        font-size: 1.1rem;
    }

    #tutorial-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .container {
        height: auto;
        min-height: 0;
        padding: 0 1.5rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .lists-container {
        width: 100%;
        height: auto;
        gap: 1rem;
    }

    .public-lists,
    .private-lists {
        width: 100%;
        height: auto;
        min-height: 12rem;
        border-radius: 22px;
    }

    .public-header,
    .private-header,
    .list-words-topbar {
        padding: 1rem 1.25rem;
        gap: 0.85rem;
    }

    .public-lists > p {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .community-list-placeholders,
    .private-list-placeholders {
        margin: 1rem 1.25rem 0;
    }

    .logged-out-placeholder,
    .no-lists-placeholder {
        margin: 1rem 1.25rem;
        padding: 2rem 1.25rem;
    }

    .logged-out-placeholder button,
    .create-list-btn,
    .view-all-button,
    .edit-list-button,
    .start-practice-btn {
        width: 100%;
        justify-content: center;
    }

    .list-words.is-visible {
        width: 100%;
        height: auto;
        min-height: 0;
        border-radius: 22px;
        padding: 1rem 1.25rem;
        max-height: none;
    }

    .list-words-scroll {
        padding-right: 0.25rem;
    }

    .word-pair-item {
        grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
    }

    .word-nl,
    .word-en {
        word-break: break-word;
    }

    #practice-modal,
    .viewall-modal,
    #create-list-modal {
        width: min(42rem, 94vw);
        max-width: 94vw;
        max-height: calc(100vh - 2rem);
        height: auto;
    }

    #login {
        width: min(34rem, 94vw);
        max-width: 94vw;
        height: auto;
        max-height: calc(100vh - 2rem);
    }

    .create-list-visibility-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .create-list-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .viewall-list-scroll {
        grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
        max-height: calc(100vh - 7rem);
    }

}
