.mm_menu li span i svg path {
    fill: #1c1b1b;
}

.is-grayscale-hoverable {
    filter: grayscale(1);
}

.is-grayscale-hoverable:hover {
    filter: grayscale(0);
}

.is-reverse-grayscale-hoverable:hover {
    filter: grayscale(1);
}

.top_bar .logo:hover {
    opacity: 0.6;
}

.top_bar .logo {
    margin-left: 0;
}

/* ---------------- Edit controls -------------------- */

.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3), .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control, .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select, .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.input-group>.form-control, .input-group>.form-floating, .input-group>.form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group .form-control, .input-group-addon, .input-group-btn {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
}

.input-group .form-control {
    position: relative;
    z-index: 2;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    width: 1%;
    margin-bottom: 0;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.input-group>.form-floating:not(:first-child)>.form-control, .input-group>.form-floating:not(:first-child)>.form-select, .input-group>:not(:first-child):not(.dropdown-menu):not(.form-floating):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.lyrics-line.modified, .translation-line.modified {
    background-color: #ffffa3;
}

/* -------- video player -------------------- */
section .vid-pr {
    height: auto;
}

.full_wdth_single_video #player {
    width: 100%;
    height: 144px;
    background-color: #efefef;
}

@media (min-width: 382px) {
    .full_wdth_single_video #player {
        height: 198px;
    }
}
@media (min-width: 478px) {
    .full_wdth_single_video #player {
        height: 252px;
    }
}

@media (min-width: 574px) {
    .full_wdth_single_video #player {
        height: 306px;
    }
}
@media (min-width: 670px) {
    .full_wdth_single_video #player {
        height: 360px;
    }
}

@media (min-width: 795px) {
    .full_wdth_single_video #player {
        height: 430.3125px;
    }
}

@media (min-width: 920px) {
    .full_wdth_single_video #player {
        height: 500.625px;
    }
}

@media (min-width: 1045px) {
    .full_wdth_single_video #player, .vid-pr .player-overlay {
        height: 570.9375px;
    }
}

@media (min-width: 1170px) {
    .full_wdth_single_video #player, .vid-pr .player-overlay {
        height: 641.25px;
    }
}

#player {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* -------- subtitles and controls ------------ */

.is-playing #translation-label, .is-playing .translation-options,
.is-playing .vid-info, .is-playing .recommended-videos {
    display: none;
}

/* Hide non-highlighted lines in playing mode */
.is-playing .line:not(.highlight), 
.is-playing .lang-line:not(.highlight) {
    display: none;
}

.translation-options h3 {
    margin-top: 1.5em;
}

/* Base lyrics styling */
.line, .lang-line {
    font-size: 1.6em;
    line-height: 1.8;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Current line highlight */
.line.highlight, .lang-line.highlight {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.08) 0%,
        transparent 85%
    );
}

/* Hover states */
.line-is-hover {
    background-color: rgba(134, 142, 150, 0.05);
}

.word-is-hover {
    background-color: rgba(134, 142, 150, 0.2);
    border-radius: 3px;
}

/* Playing mode */
.is-playing .line.highlight, .is-playing .lang-line.highlight {
    background: none;
    border-left: none;
}

.is-playing .lang-line.highlight {
    color: #666;
    margin-top: 0.8em;
}

.live-lyrics .line.show, .live-lyrics .lang-line.show {
    display: inline;
}

.live-lyrics {
    margin-top: 1em;
    display: flex;
    flex-wrap: wrap;
}

.live-lyrics .col-lg-6 {
  flex: 1 0 100%;
}

.line.highlight, .lang-line.highlight {
    font-weight: bold;
}

.is-playing .lang-line.highlight {
    font-weight: normal;
}

#translation-label {
    margin-top: 1em;
    margin-bottom: 1em;
    font-size: 2em;
}

@media (max-width: 991px) {
    .song_page .live-lyrics .col-lg-6:first-child {
        order: 2;
    }

    .live-lyrics .translation-options {
        margin-bottom: 1em;
    }

    .live-lyrics .translation-options .lang-option {
        line-height: 1.7em;
    }

    .live-lyrics .translation-options h3 {
        margin-bottom: .5em;
    }

    .live-lyrics .translation-options p.text-muted {
        margin-top: .5em;
    }
}

@media (min-width: 992px) {
    .live-lyrics .col-lg-6 {
        flex: 1;
        max-width: 50%;
    }

    #translation-label {
        display: none;
    }

    .translation-options h3 {
        margin-top: 0;
        font-size: 1.3em;
        margin-bottom: .5em;
    }

    .translation-options a.lang-option {
        line-height: 2em;
    }
}

.is-playing .live-lyrics.row > div {
    width: 100%;
    max-width: none;
    flex: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .line, .lang-line {
        font-size: 1.4em;
        line-height: 1.6;
    }
}

.vid-actions {
    margin-top: 1em;
}

.vid-actions .btn {
    vertical-align: baseline;
    margin-right: .3em;
    margin-bottom: .3em;
}


.captions-toggle {
    cursor: pointer;
    margin-top: 1em;
}

.toggle-header svg {
    vertical-align: middle;
}

.captions-toggle .toggle textarea {
    width: 100%;
    padding: .5em;
}

.toggle-header {
    border: 1px solid #8c8c8c;
    padding: .3em;
    margin-bottom: .3em;
}

.toggle.hide {
    display: none;
}

.edit-translation-lines .translation-title {
    margin-bottom: .8em;
    font-size: 1.6em;
}

.jconfirm a, .lyrics-source-div a {
    color: blue;
}

.jconfirm p {
    margin-bottom: 1em;
}

.song_page_translated_edit .translation-credits {
    color: grey;
    margin-bottom: 1em;
    margin-top: -1.3em;
}

/* --------------- banner -------------------------- */
.banner-word {
    display: inline-block;
    padding-left: .2em;
    padding-right: .2em;
    margin: .1em;
}

.blue-words .banner-word{
    background-color: rgba(0,0,255,.4);
}

.yellow-words .banner-word{
    background-color: rgba(255,255,0,.4);
}

.black-words .banner-word{
    background-color: rgba(0,0,0,.4);
}

.banner-section {
    max-height: 30em;
}

.banner-section .featured-songs {
    display: none;
}


@media (min-width: 992px) {
    .banner-section .featured-songs {
        display: block;
        position: absolute;
        left: 1em;
        bottom: 1em;
    }

    .banner-section {
        max-height: 40em;
    }

    .banner-section .featured-songs > div {
        display: inline-block;
        padding: .4em;
        padding-right: .7em;
        border-radius: 5px;
    }

    .banner-section .featured-songs > div:hover {
        color: white;
    }

    .banner-section .featured-songs .singer-title {
        background: rgba(0, 0, 0, .5);
        color: white;
    }

    .banner-section .featured-songs .featured-song {
        background: rgba(255, 255, 255, .3);
    }

    .banner-section .featured-song svg {
        vertical-align: middle;
    }
}

/* ---------------- about ----------------------------- */
.about-section .about p {
    margin-top: 1em;
    font-size: 1.3em;
}

body.about {
    background: #f7f7f7;
}

.about header {
    background: white;
}

/* ---------------- Contact Us           ----------------------------- */
.contact h1 {
    max-width: 580px;
    margin: 0 auto;
    font-size: 2em;
    margin-top: 1em;
    margin-bottom: .5em;
}

/* ---------------- video title elements ----------------------------- */

.is-published .publish, .is-not-published .unpublish {
    display: none;
}

.single_video .vid-info h1 {
    margin-top: 17px;
    font-size: 22px;
    color: #1c1b1b;
    line-height: 26px;
    font-weight: 400;
}

/* ---------------- download options   ----------------------------- */
.download-options .row {
    font-size: 1.3em;
    margin-bottom: 2em;
}

.download-options .stream-filename {
    font-size: .8em;
}

.download-options .download-stream-btn {
    float: right;
}

.download-options  svg {
    vertical-align: middle;
}

/* ---------------------- generate clip ----------------------------- */

.generate_clip h2 {
    font-size: 1.4em;
    margin-bottom: 0.4em;
    margin-top: 1em;
}

.clip-images .clip-image {
    padding: .2em;
}

.clip-images .clip-image img {
    max-width: 100%;
    height: 15em;
    margin-top: .4em;
}

.clip-images .clip-image img:hover {
    background-image: repeating-linear-gradient(#eee 0 8px, transparent 0 16px), repeating-linear-gradient(90deg, #eee 0 8px, transparent 0 16px);
    background-blend-mode: screen;
}

.generate_clip select {
    max-width: 100%;
    width: 20em;
}

.clip-images.row {
    margin-top: 2em;
    margin-bottom: 2em;
}

.download-options .other-streams {
    margin-top: 2em;
}

.generate_clip .preview-clip, .generate_clip .record-clip {
    margin-left: .8em;
}

.generate_clip .progress {
    max-width: 100%;
}

.generate_clip .h2-stream {
    margin-top: 1em;
}

#canvas-block {
  padding: 1em;
}

#canvas-block canvas {
    margin-top: 1em;
}

#canvas-block h2 {
  margin-bottom: 1em;
}

.generate_clip #audio-block {
    padding: 1em;
}

.generate_clip #audio-block audio {
    max-width: 100%;
}

.generate_clip .clip-image-name {
    margin-bottom: .8em;
}

.generate_clip .upload-image-form {
    margin-top: 5em;
}

.blink {
    animation: blinker 1s infinite;
}

@keyframes blinker {
    from { opacity: 1.0; }
    50% { opacity: 0; }
    to { opacity: 1.0; }
}

/* --------------------- Add song ------------ */
.add_song .youtube-dwn {
    padding: 0 0 210px;
}

.add_song .player-holder {
    margin-top: 2em;
}

.player-holder * {
  display: none;
}

.player-holder.has-embed * {
  display: initial;
}

.add_song .upload-videooz {
    margin: 30px 0 64px;
}

.add_song .youtube-dwn form input[type="text"] {
    color: #858595;
}

.add_song #player {
    margin-top: 1em;
}

.add_song .video-suggestions {
    margin-top: 1em;
}

.add_song .video-suggestions .video-container {
    display: inline-block;
    margin-right: 0.5em;
    cursor: pointer;
}

.add_song .video-suggestions .video-container img {
    width: 9em;
}

.add_song .video-suggestions .video-container p {
    text-align: left;
    max-width: 9em;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: block;
}

.add_song .video-suggestions .video-container p:before {
  content:'';
  width:100%;
  height:100%;
  position:absolute;
  left:0;
  top:0;
  background: linear-gradient(to right, transparent 6em , white)
}

.add_song .upload-videooz form {
    margin-top: 1em;
}

.add_song .upload-videooz button:disabled {
    background-color: #746e6e;
}

/* ------------------- song page ------------------ */
.contact-us, .contact-us:hover {
    text-decoration: underline;
    font-weight: bold;
}

/* ------------------- changes ------------------ */
.show-change {
    font-size: 1.5em;
    line-height: 1.7em;
}

.change-line {
    min-height: 1em;
}

.old_line .deleted {
    background-color: rgba(255, 0, 0, 0.2);
    min-width: 0.5em;
    display: inline-block;
}

.new_line .added {
    background-color: rgba(0, 255, 0, 0.2);
    min-width: 0.5em;
}

div.change-line {
    counter-increment: line-counter;
}

div.change-line::before {
    content: counter(line-counter) ". ";
    display: inline-block;
    width: 3em;
    margin-right: 0.5em;
    padding-right: 0.5em;
    text-align: right;
    color: #ffffff;
    background: #919191;
}

p.translation-preview-p {
    margin-bottom: 2em;
}


/* ------------------- vocabulary ------------------ */
.mode-switch {
    margin-left: auto;
}

.mode-btn {
    margin-right: 0.5em;
    margin-top: 0.5em;
    padding: 0.5em 1em;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.mode-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.vocabulary-popup .original-words,
.vocabulary-popup .translation-words {
    padding: 1em;
    margin: 0.5em 0;
    background: #f5f5f5;
    border-radius: 4px;
}

.vocabulary-popup .word {
    margin-right: 0.5em;
}

.vocabulary-popup .word-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7em;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 0.5em;
}

.vocabulary-popup .lyrics-word,
.vocabulary-popup .translation-word {
    font-size: 1.2em;
}

.vocabulary-popup .normalized {
    display: flex;
    justify-content: space-between;
    padding: 0.3em 0.7em;
    color: #666;
    font-style: italic;
    margin-bottom: 0.5em;
}

.vocabulary-popup .explanation,
.vocabulary-popup .synonyms,
.vocabulary-popup .examples {
    padding: 0.5em 0.7em;
    margin-bottom: 0.5em;
}

.vocabulary-popup h4 {
    margin-bottom: 0.3em;
    color: #333;
    font-size: 1.1em;
}

.vocabulary-popup .synonyms ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.vocabulary-popup .synonyms li {
    display: inline-block;
    background: #f5f5f5;
    padding: 0.2em 0.6em;
    margin: 0.1em;
    border-radius: 3px;
}

.vocabulary-popup .examples ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.vocabulary-popup .examples li {
    background: #f5f5f5;
    padding: 0.5em;
    margin-bottom: 0.3em;
    border-radius: 4px;
}

.vocabulary-popup .examples .sentence {
    margin-bottom: 0.2em;
    font-weight: 500;
}

.vocabulary-popup .examples .translation {
    color: #666;
}

.video-information {
    position: -webkit-sticky;  /* For Safari */
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}


#mappingStatus .alert-info {
    background-color: #f5fdff;
}

.edit-translation-lines textarea {
    padding: 1em;
}

.edit-translation-lines textarea::placeholder {
    color: #f3f3f3;
}

.edit-translation-lines textarea::-webkit-scrollbar {
    width: 8px;
}

.edit-translation-lines textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.edit-translation-lines textarea::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.edit-translation-lines textarea::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.vocabulary-popup .external-translations {
    padding: 0.5em 0.7em;
    margin-bottom: 0.5em;
}

.vocabulary-popup .translation-links {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.vocabulary-popup .translation-links a {
    background: #f5f5f5;
    padding: 0.4em 0.8em;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.vocabulary-popup .translation-links a:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

/* Add these styles for Select2 height matching */
.vid-info .select2-container--default .select2-selection--single {
    height: 38px !important;  /* Match button height */
    display: flex !important;
    align-items: center !important;
}

.vid-info .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
}

.vid-info .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;  /* Match container height minus borders */
}

/* Optional: Match width with other elements */
#modelSelect {
    min-width: 200px;
}

.vocabulary-popup .vocabulary-actions {
    text-align: center;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

.vocabulary-popup .btn {
    min-width: 200px;
}


/* ------------------- vocabulary section ------------------ */
.vocabulary-card {
    cursor: pointer;
    perspective: 1000px;
    height: 120px;
}

.vocabulary-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.3s;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
}

.vocabulary-card:hover .card-inner {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.vocabulary-card .word-pair {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 10px;
}

.vocabulary-card .source-section,
.vocabulary-card .target-section {
    text-align: center;
}

.vocabulary-card h4 {
    margin: 0;
    font-size: 1.2em;
    line-height: 1.3;
    font-weight: 500;
}

.vocabulary-card .normalized {
    font-size: 0.8em;
    opacity: 0.7;
}

.vocabulary-card .original {
    font-size: 0.8em;
    opacity: 0.7;
    font-style: italic;
}

/* Detailed card popup styles */
.vocabulary-card-detail {
    padding: 20px;
}

.vocabulary-card-detail .word-pair-detail {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.vocabulary-card-detail h3 {
    margin: 0;
    font-size: 1.6em;
    line-height: 1.3;
    font-weight: 500;
}

.vocabulary-card-detail h5 {
    color: #666;
    margin-top: 15px;
}

.vocabulary-card-detail .original {
    font-size: 0.9em;
    opacity: 0.7;
    font-style: italic;
    margin-top: 0.2em;
}

.vocabulary-card-detail .examples ul {
    list-style: none;
    padding: 0;
}

.vocabulary-card-detail .examples li {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.vocabulary-card-detail .example-source {
    color: #333;
    margin-bottom: 5px;
}

.vocabulary-card-detail .example-target {
    color: #666;
    margin: 0;
}

.vocabulary-card.deleted {
    opacity: 0.6;
    pointer-events: none;
}

.vocabulary-card .deleted-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-weight: 500;
    font-size: 1.1em;
    border-radius: 8px;
}

/* Style delete button in popup */
.jconfirm-buttons .btn-danger {
    margin-right: 8px;
}

.vocabulary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.vocabulary-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 4px;
}

.view-toggle button {
    padding: 6px 12px;
    border: none;
    background: none;
    color: #666;
    border-radius: 3px;
}

.view-toggle button.active {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.refresh-vocabulary {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: linear-gradient(90deg, 
        rgba(73, 80, 87, 0.08) 0%,
        rgba(73, 80, 87, 0.05) 100%
    );
    border: none;
    color: #495057;
    transition: all 0.2s ease;
    line-height: 1.5;
    height: 31px;
}

.refresh-vocabulary:hover {
    background: linear-gradient(90deg, 
        rgba(73, 80, 87, 0.12) 0%,
        rgba(73, 80, 87, 0.08) 100%
    );
    color: #212529;
    text-decoration: none;
}

.refresh-vocabulary.spinning i {
    animation: spin 1s linear infinite;
}

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

/* Grid view (default) */
.vocabulary-list.grid-view .row {
    display: flex;
    flex-wrap: wrap;
}

/* List view */
.vocabulary-list.list-view .row {
    display: block;
}

.vocabulary-list.list-view .col-lg-3 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

.vocabulary-list.list-view .vocabulary-card {
    height: auto;
    margin-bottom: 10px;
}

.vocabulary-list.list-view .word-pair {
    flex-direction: row;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px;
}

.vocabulary-list.list-view .source-section,
.vocabulary-list.list-view .target-section {
    text-align: left;
    flex: 1;
}

/* Practice page styles */
.practice-section {
    padding: 40px 0;
    min-height: calc(100vh - 100px); /* Adjust based on your header height */
}

/* Practice page header styling */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 15px;
}

/* When no song specified, center the stats and match card width */
.practice-header:not(:has(.back-link)) {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.practice-header .back-link {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
}

.practice-header .back-link:hover {
    color: #007bff;
}

.practice-header .back-link i {
    font-size: 0.9em;
}

.practice-stats {
    display: flex;
    gap: 25px;
}

.practice-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.95em;
}

.practice-stats .stat-item i {
    color: #6c757d;
}

.practice-stats .stat-value {
    font-weight: 500;
    color: #007bff;
}

.practice-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
    /* Calculate height to fit viewport while maintaining minimum height */
    height: calc(100vh - 300px); /* Adjust based on header + stats + buttons height */
    min-height: 400px; /* Minimum height to prevent excessive shrinking */
    display: flex;
    flex-direction: column;
}

.practice-card {
    perspective: 1000px;
    width: 100%;
    max-width: 500px;
    height: 100%; /* Fill available height */
    margin: 0 auto;
    cursor: pointer;
    position: relative;
}

.practice-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.practice-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.practice-card .card-front,
.practice-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 #f5f5f5;
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
.practice-card .card-front::-webkit-scrollbar,
.practice-card .card-back::-webkit-scrollbar {
    width: 8px;
}

.practice-card .card-front::-webkit-scrollbar-track,
.practice-card .card-back::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.practice-card .card-front::-webkit-scrollbar-thumb,
.practice-card .card-back::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 4px;
    border: 2px solid #f5f5f5;
}

.practice-card .card-front::-webkit-scrollbar-thumb:hover,
.practice-card .card-back::-webkit-scrollbar-thumb:hover {
    background: #c1c1c1;
}

.practice-card .card-back {
    transform: rotateY(180deg);
}

.practice-controls {
    margin-top: 30px;
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.flip-hint {
    color: #666;
    margin-bottom: 20px;
}

.no-cards-message {
    text-align: center;
    margin-top: 50px;
}

.practice-card .lang-indicator {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-bottom: 20px;
}

.practice-card .word-display {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    padding: 20px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.practice-card .flip-hint {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: auto;
    padding-top: 20px;
}

.practice-card .source-word {
    font-size: clamp(2.5em, 8vw, 4em);
    font-weight: 400;
    margin: 0;
    color: #333;
    line-height: 1.2;
}

.practice-card .original {
    font-size: clamp(1em, 3vw, 1.5em);
    margin-top: 10px;
}

.practice-card .target-word {
    font-size: clamp(2.5em, 8vw, 4em);
    font-weight: 400;
    margin: 0;
    color: #333;
    line-height: 1.2;
}

.practice-card .card-back .original {
    font-size: clamp(1em, 3vw, 1.5em);
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.practice-card .synonyms {
    margin-top: 1.5em;
}

.practice-card .synonyms h5 {
    color: #333;
    margin-bottom: 0.8em;
    font-size: 1.1em;
    text-align: center;
}

.practice-card .synonyms p {
    text-align: center;
    line-height: 1.8;
}

.practice-card .synonyms span {
    display: inline-block;
    background: #f0f7ff;
    padding: 0.3em 0.8em;
    margin: 0.2em;
    border-radius: 20px;
    color: #0066cc;
    font-size: 0.95em;
    border: 1px solid #cce0ff;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .practice-area {
        height: calc(100vh - 250px); /* Adjust for mobile */
    }
    
    .practice-card .word-display {
        padding-bottom: 50px; /* Smaller padding on mobile */
    }

    .practice-header {
        flex-direction: column;
        align-items: stretch;
    }

    .practice-header .back-link {
        text-align: center;
        align-self: center;
        justify-content: center;
    }

    .practice-stats {
        justify-content: center;
    }

    .controls-lv > li .signup-btn {
        display: none;
    }

    .controls-lv > li .support-btn {
        display: none;
    }
}

.practice-card .lang-indicator {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #666;
}

/* Card back section titles - consistent styling for all sections */
.practice-card .card-back .card-section {
    margin-top: 0.7em;  /* Reduced from 1em */
}

.practice-card .card-back h5 {
    color: #333;
    margin-bottom: 0.5em;  /* Reduced from 0.8em */
    font-size: 1.1em;
    text-align: center;
    font-weight: 500;
}

/* Examples styling */
.practice-card .examples .example {
    margin-bottom: 0.4em;  /* Reduced from 0.6em */
    padding: 0.2em 0;  /* Reduced from 0.3em */
}

.practice-card .examples .example-source {
    color: #333;
    margin-bottom: 0.2em;  /* Reduced from 0.3em */
    font-weight: 500;
}

/* Synonyms styling */
.practice-card .synonyms span {
    display: inline-block;
    background: #f8f9fa;
    padding: 0.3em 0.8em;
    margin: 0.2em;
    border-radius: 20px;
    color: #555;
    font-size: 0.95em;
    border: 1px solid #eee;
}

/* Consistent text alignment for all sections */
.practice-card .explanation p,
.practice-card .examples,
.practice-card .synonyms p {
    text-align: center;
}

.vid_thums {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

/* Bookmark button styling */
.bookmark-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    color: rgba(255, 255, 255, 0.9);
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.bookmark-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

.bookmark-btn.active {
    color: #fff;
}

.bookmark-btn i {
    font-size: 1.4em;
}

.load-more-link {
    display: inline-block;
    color: #666;
    font-size: 24px;
    transition: all 0.2s;
}

.load-more-link:hover {
    color: #333;
    transform: translateY(2px);
}

/* Song title bookmark button */
.vid-info .bookmark-btn {
    position: static;
    display: inline-block;
    vertical-align: middle;
    color: #868e96;
    text-shadow: none;
    font-size: 1.1em;
    padding: 0.25rem;
    transition: all 0.2s ease;
    margin-right: 0.3em;
}

.vid-info .bookmark-btn i {
    font-size: 1em;
}

.vid-info .bookmark-btn:hover {
    color: #868e96;
    transform: scale(1.1);
}

.vid-info .bookmark-btn.active {
    color: #868e96;
}

/* Mode switch styling */
.mode-switch .mode-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.08) 0%,
        transparent 85%
    );
    border: none;
    color: #868e96;
    transition: all 0.2s ease;
}

.mode-switch .mode-btn:hover {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.12) 0%,
        transparent 85%
    );
}

.mode-switch .mode-btn.active {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.18) 0%,
        rgba(134, 142, 150, 0.05) 85%,
        transparent 100%
    );
    color: black;
    font-weight: 500;
}

/* Remove button outline */
.mode-switch .mode-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* UPD: changed it from button-style to tabs style */

.mode-radio {
    display: flex;
    gap: 0.25rem;
    background: #f8f9fa;
    padding: 0.25rem;
    border-radius: 2rem;
}

.mode-radio input[type="radio"] {
    display: none;
}

.mode-radio label, .word-guidance-tooltip .mode-btn {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    border: none;
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-radio input[type="radio"]:checked + label, .word-guidance-tooltip .mode-btn.active {
    background: #8d8989;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mode-radio label i {
    margin-right: 0.25rem;
}

/* Responsive layout */
@media (max-width: 767px) {
    .info-pr .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .mode-switch {
        margin-left: 0 !important;
        width: 100%;  /* Full width on mobile */
    }
    
    .mode-switch .mode-btn {
        flex: 1;  /* Equal width buttons */
    }
}

/* Make list view default on small screens */
@media (max-width: 767px) {
    .vocabulary-list .row {
        display: block;
    }

    .vocabulary-list .col-lg-3 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .vocabulary-list .vocabulary-card {
        height: auto;
        margin-bottom: 10px;
    }

    .vocabulary-list .word-pair {
        flex-direction: row;
        justify-content: flex-start;
        gap: 20px;
        padding: 10px;
    }

    .vocabulary-list .source-section,
    .vocabulary-list .target-section {
        text-align: left;
        flex: 1;
    }

    /* Hide grid view button on mobile */
    .view-toggle {
        display: none;
    }
}

.vocabulary-section .load-more {
    margin-top: 20px;
}

/* Vocabulary load more button styling */
.vocabulary-section .load-more .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.08) 0%,
        transparent 85%
    );
    border: none;
    color: #868e96;
    transition: all 0.2s ease;
}

.vocabulary-section .load-more .btn:hover {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.12) 0%,
        transparent 85%
    );
    color: #495057;
}

.vocabulary-section .load-more .btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Practice button styling */
.vocabulary-controls .btn-primary {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: linear-gradient(90deg, 
        rgba(26, 115, 232, 0.12) 0%,
        rgba(26, 115, 232, 0.05) 85%,
        transparent 100%
    );
    border: none;
    color: #6aa2ff;
    transition: all 0.2s ease;
    font-weight: 500;
    line-height: 1.5;
    height: 31px;
}

.vocabulary-controls .btn-primary:hover {
    background: linear-gradient(90deg, 
        rgba(26, 115, 232, 0.15) 0%,
        rgba(26, 115, 232, 0.08) 85%,
        transparent 100%
    );
    color: #3367d6;
    transform: translateY(-1px);
}

.vocabulary-controls .btn-primary:focus {
    outline: none !important;
    box-shadow: none !important;
}

.vocabulary-controls .btn-primary i {
    margin-right: 0.3em;
}

/* Refresh button styling */


.vocabulary-controls .refresh-vocabulary:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Vocabulary collection styles */
.vid_thumbainl .watch_later .badge {
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    display: inline-block;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.vid_thumbainl .watch_later {
    right: 10px;
    top: 10px;
    background: transparent;
    border-radius: 30px;
    padding: 0;
    width: auto;
    z-index: 10;
    position: absolute;
    display: block;
    overflow: visible;
}

.vid_thumbainl:hover .watch_later .badge {
    background: rgba(255, 255, 255, 1) !important;
    color: #252d39;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
    transition: all 0.2s ease;
}

/* Hide song subtitle on mobile devices */
@media (max-width: 767px) {
    .vid-info h1 .text-muted {
        display: none;
    }
}

/* Allow lyrics text to wrap on mobile */
@media (max-width: 767px) {
    .input-group-text.play {
        white-space: normal;
        text-align: left;
        word-break: break-word;
        height: auto;
        max-width: 100%;
    }
}

/* Button styling for song edit page */
.vid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    justify-content: left;
}

.vid-actions button, .vid-actions a.btn, .vid-actions select {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.vid-actions button i, .vid-actions a.btn i {
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vid-actions {
        gap: 0.3rem;
    }
    
    .vid-actions button, .vid-actions a.btn, .vid-actions select {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .vid-actions button i, .vid-actions a.btn i {
        font-size: 1.1rem;  /* Slightly larger icons when text is hidden */
        margin: 0;
    }
}

/* Full width buttons on smallest screens */
@media (max-width: 480px) {
    .vid-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .vid-actions button, .vid-actions a.btn, .vid-actions select {
        width: 100%;
        justify-content: center;
    }
    
    /* Ensure Select2 container is also full width */
    .vid-actions .select2-container {
        width: 100% !important;
    }
}

/* Add styles for parsed captions */
.parsed-caption-line {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.parsed-caption-time {
    color: #666;
    font-family: monospace;
    font-size: 0.9em;
    min-width: 80px;
    padding-top: 3px;
}

.parsed-caption-text {
    flex: 1;
    line-height: 1.4;
}

/* Style the container for better readability */
.parsed-captions {
    max-height: 500px;
    overflow-y: auto;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100% !important;  /* Force full width */
}

.captions-view-toggle {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}

.captions-view-toggle .btn {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.captions-view-toggle .btn.active {
    background-color: #6c757d;
    color: white;
}

.captions-container {
    display: none;
    width: 100%;  /* Ensure container is full width */
}

.captions-container textarea {
    width: 100% !important;  /* Force full width */
    max-height: 500px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Admin link in captions popup */
.admin-link {
    color: #fff !important;
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    margin-left: 10px;
    font-weight: 500;
}

.admin-link:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
    box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}

/* Improve captions popup styling */
.captions-view-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
}

.captions-view-toggle button, 
.captions-view-toggle a {
    margin-right: 5px;
}

.captions-view-toggle .float-right {
    margin-left: auto;
    margin-right: 0;
}

.search-options-popup {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    min-width: 180px;
    max-width: 280px;
    z-index: 1000;
}

.search-option {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.search-option:hover {
    background-color: #f5f5f5;
}

.account-menu {
    z-index: 999;
}

/* Song language badge for Soloway site */
.song-language-badge {
    display: inline-block;
    margin-right: 5px;
    font-size: 16px;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .song-language-badge {
        font-size: 14px;
    }
}

/* Styling for about page lists */
.about-section ul {
    margin: 1em 0 1.5em 1.5em;
    padding: 0;
}

.about-section ul li {
    margin-bottom: 0.5em;
    position: relative;
    padding-left: 1.2em;
    list-style-type: none;
}

.about-section ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color, #b5b5b5);
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1;
}

/* Make about section text more readable */
.about-section p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.about-section strong {
    color: var(--primary-color, #b5b5b5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .about-section ul {
        margin-left: 0.5em;
    }
    
    .about-section ul li {
        padding-left: 1em;
    }
}

/* Error messages styling */
.errorlist {
    list-style-type: none;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    background-color: #fff8f8;
    border-left: 3px solid #e74c3c;
    color: #e74c3c;
    font-size: 0.875rem;
    border-radius: 0 3px 3px 0;
}

.errorlist li {
    padding: 0.25rem 0;
}

.form-group.has-error label {
    color: #e74c3c;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #e74c3c;
}

/* Add a subtle animation for error messages */
@keyframes errorFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.errorlist {
    animation: errorFadeIn 0.3s ease-out;
}

.controls-lv .user-log div.user-ac-img {
    width: 3em;
    height: 3em;
    background: #dfdede url(/static/soloway-bird.png);
    background-position: -0.6em 0.6em;
    background-size: 3em;
    background-repeat: no-repeat;
    border-radius: 50%;
    opacity: 0.7;
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state .alert {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-state .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.12) 0%,
        rgba(134, 142, 150, 0.08) 85%
    );
    border: none;
    color: #495057;
    transition: all 0.2s ease;
}

.empty-state .btn:hover {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.18) 0%,
        rgba(134, 142, 150, 0.12) 85%
    );
    transform: translateY(-1px);
}

.play.active svg {
    animation: pulse 1.5s infinite;
    color: #007bff;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Language dropdown styles */
.language-dropdown {
    position: relative;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    background-color: #fff;
    min-width: 180px;
    user-select: none;
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.language-dropdown-toggle .lang-label {
    margin-right: 8px;
    font-weight: 500;
    color: #495057;
}

.language-dropdown-toggle .emoji-and-name {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.language-dropdown-toggle .emoji-and-name .emoji {
    margin-right: 6px;
}

.dropdown-arrow {
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.language-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
    max-height: 300px;
    overflow-y: auto;
}

.language-dropdown-menu.show {
    display: block;
}

.language-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}

.language-dropdown-item .emoji {
    margin-right: 8px;
}

.language-dropdown-item:hover, 
.language-dropdown-item:focus {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
}

.language-dropdown-item.active {
    color: #fff;
    text-decoration: none;
    background-color: #a4a5aa;
}

.language-dropdown-item.is-unpublished {
    opacity: 0.6;
}

.language-dropdown-item.is-unpublished:hover {
    filter: grayscale(1);
}

.language-dropdown-check {
    margin-right: 8px;
    visibility: hidden;
}

.language-dropdown-item.active .language-dropdown-check {
    visibility: visible;
}

.language-muted {
    opacity: 0.3;
    filter: grayscale(1);
}

/* Player overlay (paranja) */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Load More Button */
.load-more-container {
    width: 100%;
    text-align: center;
    margin: 2rem 0;
    padding: 0 15px;
    box-sizing: border-box;
}

.next-page-link {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    
    background: linear-gradient(135deg, #afb4b9 0%, #686b6e 100%);
    
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
    min-width: 150px;
}

.next-page-link:hover:not(:disabled) {
    transform: translateY(-2px);
    color: #fff;
}

.next-page-link:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.1);
}

.next-page-link.loading {
    padding-right: 2.5rem;
    position: relative;
}

.next-page-link.loading:after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.next-page-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(108, 117, 125, 0.2);
}

/* Loading state */
.next-page-link.loading {
    padding-right: 3rem;
    pointer-events: none;
}

.next-page-link.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.word-guidance-tooltip {
    position: relative;
    z-index: 1000;
    background-color: transparent;
    box-shadow: none;
    max-width: 400px;
    text-align: center;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.word-guidance-tooltip .guidance-header h3 {
    margin: 4px 0;
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.word-guidance-tooltip .guidance-content {
    background-color: #ffffff;
    color: #333;
    padding: 16px 12px;
    border-radius: 8px;
    margin: 16px 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.word-guidance-tooltip .guidance-word {
    margin-bottom: 12px;
    font-size: 18px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.word-guidance-tooltip .highlight-word {
    font-size: 1.2em;
    font-weight: 500;
    background-color: rgba(134, 142, 150, 0.2);
    color: rgb(33, 37, 41);
    position: relative;
}

.word-guidance-tooltip .highlight-word i {
    font-size: 0.7em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -18px;
    text-align: center;
    animation: wiggle 1.5s ease infinite;
    color: #666;
}

@keyframes wiggle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.word-guidance-tooltip .transcription {
    font-size: 14px;
    color: #777;
    margin-left: 6px;
    font-style: italic;
}

.word-guidance-tooltip .guidance-translations {
    margin-top: 16px;
    text-align: left;
    padding-left: 42px;
}

.word-guidance-tooltip .translation-item {
    margin: 8px 0;
    color: #7f7f7f;
    font-size: 14px;
    font-weight: 500;
}

.word-guidance-tooltip .guidance-dismiss {
    display: block;
    width: 100%;
    margin: 15px auto 0;
    padding: 12px;
    background-color: #939393;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
    pointer-events: auto;
}

.word-guidance-tooltip .guidance-dismiss:hover {
    background-color: #696767;
}

.word-guidance-tooltip .mode-explanation {
    margin-top: 12px;
    font-size: 12px;
    font-style: italic;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1em;
}

.word-guidance-tooltip .vocab-button-example {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 4px;
    cursor: default;
    font-style: normal;
    text-transform: none;
    transition: all 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
}

.word-guidance-tooltip .vocab-button-example.active {
    background: linear-gradient(90deg, 
        rgba(134, 142, 150, 0.18) 0%,
        rgba(134, 142, 150, 0.05) 85%,
        transparent 100%
    );
    background-color: #f8f9fa;
    color: #212529;
    border: none;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.word-guidance-tooltip .vocab-button-example i {
    margin-right: 6px;
    font-size: 14px;
}

/* Hide guidance tooltip on smaller screens */
@media (max-width: 919px) {
    .player-overlay {
        display: none;
    }
}

/* Waveform styling */
.waveform-svg {
    height: 3em;
}

.waveform-svg svg {
    width: 100%;
    cursor: pointer;
    height: 3em;
}

.waveform-svg svg line.played, .waveform-svg svg line:hover {
    stroke: #7c7e7c;
}

@media (max-width: 991px) {
    .waveform-svg {
        display: none;
    }
}

@media (max-width: 515px) {
    body.index #languages-select2,
    body.index #cefr-level-select2,
    body.index .select2-container--default .select2-selection--single[aria-labelledby*="languages-select2"],
    body.index .select2-container--default .select2-selection--single[aria-labelledby*="cefr-level-select2"] {
        width: 100% !important;
    }

    /* Ensure proper spacing between stacked select2 containers */
    body.index .select2-container {
        margin-bottom: 0.4em;
    }

    body.index .select2-container:last-child {
        margin-bottom: 0;
    }
}

/* CEFR Level Badge */
.cefr-badge {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: text-top;
    position: relative;
    top: 0.1em;
    border-radius: 0.25rem;
    padding: 0.25em 0.4em;
    margin-right: 0.25rem;
}

.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    word-break: break-word;
}