:root {
    /* Light theme variables */
    --color-bg: #fefcf3;
    --color-text: #222222;
    --color-link: #000000;
    --color-logo-width: 95px;
    --color-video-bg: #fffefb;
    --color-video-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    --color-captions-bg: #f2f0e8;
    --color-captions-text: #036796;
    --color-captions-border: #ffffff;
    --color-captions-border-side: #fff;
    --color-speed-display: #787460;
    --color-speed-label: #959595d4;
    --color-btn-bg: #ffffff;
    --color-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --color-btn-shadow-hover: 0 0.2px 0.5px rgba(0, 0, 0, 0.3) inset;
    --color-btn-hover: #f3f1e8;
    --color-btn-speed-hover: #ffd21433;
    --color-btn-active-border: #ffd214;
}

.dark-theme {
    /* Dark theme variables */
    --color-bg: #0F1C21;
    --color-text: #e0e0e0;
    --color-link: #e0e0e0;
    --color-video-bg: #0F1C21;
    --color-video-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    --color-captions-bg: #0b1717;
    --color-captions-text: #ffe77b;
    --color-captions-border: #083137;
    --color-captions-border-side: #04262b;
    --color-speed-display: #25ade4;
    --color-speed-label: #25ade495;
    --color-btn-bg: #1e3641;
    --color-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --color-btn-shadow-hover: 0 0.2px 0.5px rgba(0, 0, 0, 0.3) inset;
    --color-btn-hover: #ffd21433;
    --color-btn-speed-hover: #ffd21433;
    --color-btn-active-border: #ffd214;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: var(--color-bg);
    color: var(--color-text);
    padding: 0;
    /* Touch improvements */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.logo {
    width: var(--color-logo-width);
}

.logo-dark {
    display: none;
    width: var(--color-logo-width);
}

.dark-theme .logo {
    display: none;
}

.dark-theme .logo-dark {
    display: inline-block;
    width: var(--color-logo-width);
}

.drag {
    position: absolute;
    top: 0;
    left: 0;
    -webkit-app-region: drag;
    height: env(titlebar-area-height, 0);
    z-index: 999;
}

footer {
    margin-top: 55px;
    font-size: 13px;
}

footer a {
    text-decoration: none !important;
    color: var(--color-link);
}

.dark-theme footer a {
    text-decoration: none;
    color: var(--color-link);
}

footer .logo-footer, footer .logo-footer-dark {
    height: 20px;
    vertical-align: middle;
    margin-left: -5px;
}

footer .logo-footer-dark {
    display: none;
}
.dark-theme footer .logo-footer {
    display: none;
}
.dark-theme footer .logo-footer-dark {
    display: inline-block;
}

/* =====================
   Video Player Section
   ===================== */
.video-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 15px auto 0 auto;
}

video {
    width: 100%;
    /* Responsive width */
    position: relative;
    max-width: 1200px;
    /* Maximum width */
    margin: 0;
    /* border: 2px solid white; */
    /* Border around the video */
    border-radius: 8px;
    /* Rounded corners */
    box-shadow: var(--color-video-shadow);
    /* Shadow effect */
    /* display: block; */
    z-index: 10;
    /* Touch improvements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Built-in subtitle styling */
video::cue {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}



/* Dark theme subtitle styling */
.dark-theme video::cue {
    background-color: rgba(255, 255, 255, 0.9);
    color: black;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Video Controls Styling */
.video-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px !important;
    max-width: 1200px;
    margin: 10px auto;
    padding: 10px;
    /* background: var(--color-video-bg); */
    /* border-radius: 6px; */
    /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); */
    flex-wrap: wrap;
}
.subfolder-name {
    color: #b3adad;         /* Example: gray */
    font-size: 10px;     /* Example: smaller font */
    font-style: italic;  /* Example: italic */
    margin-left: 4px;    /* Example: a little space */
    /* Add any other styles you want */
  }
/* Slide animation for captions */
.captions {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, padding 0.4s;
    padding: 0 0;
    margin: 0 auto 0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -.01em;
    background: var(--color-captions-bg);
    color: var(--color-captions-text);
    /* min-height: 2em !important; */
    max-width: 1190px;
    text-align: center;
    line-height: 1.2em;
    border-bottom: 2.5px solid var(--color-captions-border);
    border-left: 1.5px solid var(--color-captions-border-side);
    border-right: 1.5px solid var(--color-captions-border-side);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3) inset, 0 0 4px rgba(0, 0, 0, 0.1) inset;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 0;
  }
.captions.captions--visible {
    min-height: 35px;
    max-height: 2em;
    opacity: 1;
    padding: 25px 0 10px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, padding 0.4s;
    margin-top: -12px;
}
  .prev-video-btn, .next-video-btn, .loop-btn{
    font-size:9px;
    line-height:9px;
    padding:3px 4px 2px;
    min-width:45px;
    min-height:unset;
    vertical-align:middle;
  }
 .prev-video-btn{
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
  } 
.next-video-btn{
    margin-left:-3px;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
  }  
  .prev-video-btn span.arrow, .loop-btn span.arrow {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: -0.2em;
    line-height: 20px;
    float: left;
    margin-right: 6px;
  }
  .prev-video-btn span.txt{
    float: right;
  } 
  .next-video-btn span.arrow {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: -0.2em;
    line-height: 20px;
    float: right;
    margin-left: 4px;
    margin-right: 2px;
  }
  .next-video-btn span.txt{
    float: left;
  } 
.speed-controls,
.cc-controls {
    display: flex;
    align-items: center;
    gap: 0.8px;
    min-height: 34px !important;
}

.cc-btn {
    background: var(--color-btn-bg);
    min-width: 35px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 10px;
    line-height: 14px;
    justify-self: center !important;
    border: none;
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    /* Touch improvements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

label#cc-size::before {
    content: 'Captions Size';
    display: block !important;
    opacity: .5;
    margin: 0 auto;
    font-size: 8px;
}

label#builtin-cc-size::before {
    content: 'Built-in CC Size';
    display: block !important;
    opacity: .5;
    margin: 0 auto;
    font-size: 8px;
}

.cc-size, .builtin-cc-size {
    width: 60px;
    height: 20px;
    margin: 0;
    vertical-align: middle;
}



.speed-display {
    display: flex;
    color: var(--color-speed-display) !important;
    flex-direction: column;
    justify-content: center;
    width: 44px;
    padding-top: 2px;
    margin-right: 5px;
    align-items: center;
    /* vertical center */
    height: 100%;
    letter-spacing: -0.06em;
    /* text-align: center; */
    font-size: 14px;
    font-weight: bold;
    line-height: .7;
    position: relative;
    font-style: italic;
}

.speed-display::after {
    content: 'Speed';
    /* No need for \A anymore since flex stacks */
    font-size: 10px;
    color: var(--color-speed-label);
    letter-spacing: normal;
    font-weight: normal;
    margin-top: 2px;
    /* fine-tune space between 1x and Speed */
}

.speed-btn {
    background: var(--color-btn-bg);
    width: 24px;
    font-family: monospace;
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    letter-spacing: -.1em;
    text-align: center;
    line-height: 14px;
    /**/
    font-style: italic;
    border: none;
    padding: 6px 0;
    cursor: pointer;
    font-size: 10px;
    /* Touch improvements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}


.cc-btn:first-of-type {
    width: 40px;
    padding-left: 8px !important;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.speed-btn:first-of-type {
    width: 30px;
    padding-left: 4px !important;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.cc-btn:last-of-type,
.speed-btn:last-of-type {
    width: 30px;
    padding-right: 6px !important;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
}

.speedbtn.x1 {
    border-radius: 3px;
    padding-top: 9px;
    padding-bottom: 9px;
}

/* 
.speed-btn:hover,
.speed-btn:active,
.speed-btn.active {
    background: #ffd21433;
    border-bottom: 4px solid #ffd214;
    margin-top: -4px;
} */

.speed-btn:hover {
    background: var(--color-btn-hover);
}

.speed-btn:active, .speed-btn.active {
    background: var(--color-btn-hover);
    border-bottom: 4px solid var(--color-btn-active-border);
    margin-top: -4px;

}

.folder-info {
    font-size: 12px;
    color: #a29f92;
    margin: auto 15px auto 5px;
    /* font-style: italic; */
}

/* Dark theme overrides for this section */
.dark-theme .speed-display {
    color: var(--color-speed-display) !important;
}

.dark-theme .speed-display::after {
    color: var(--color-speed-label);
}

.bookmark-controls {
    display: flex;
    align-items: center;
    gap: 1px;
}

.bookmark-btn {
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    border: none;
    padding: 6px 8px 7px 5px;
    border-radius: 0px;
    cursor: pointer;
    font-size: 10px;
    /* Touch improvements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.bookmark-btn:first-child {
    padding-left: 8px;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.bookmark-btn:last-child {
    padding-right: 10px;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
}

.bookmark-btn:hover {
    background: #FFD214;
    color: black;
    box-shadow: none;
}

.bookmark-btn.clear:hover {
    background: #ff6161;
}

.bookmark-btn.pip {
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
}

.bookmark-btn.pip:hover {
    background: #03cebd;
    box-shadow: none;
}

.bookmark-btn.pip:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.bookmarks-list {
    max-width: 1200px;
    margin: 10px auto;
    padding: 10px;
    background: #fffefb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.bookmarks-list h3 {
    margin: 6px 0 18px 6px;
    color: #333;
    font-size: 12px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 5px;
    margin: 7px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.5s;
}

.bookmark-item:hover {
    background: #f1f2f3;
}

.bookmark-item:hover .bookmark-info {
    border-bottom: 0.5px dotted transparent;
    transition: all 0.5s;
}

/* .bookmark-item:hover .bookmark-video {
    color: black;
} */

.bookmark-info {
    flex: 1;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 0.5px dotted #aaaaaa;
}

.bookmark-time {
    color: #2a95a8;
    min-width: 30px;
}

.bookmark-video {
    color: #333333;
    font-size: 13px;
    font-weight: 500;
}

.bookmark-delete {
    background: transparent;
    color: #ec4444;
    border: 1px solid #ec444466;
    padding: 3px 5.5px;
    border-radius: 33px;
    cursor: pointer;
    font-size: 11px;
}

.bookmark-delete:hover {
    background: #ec4444;
    color: white;
}

.keyboard-hint {
    display: none;
    font-size: 9px;
    color: #666;
    margin: 5px 0;
}

.offline-status {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
.playlist-header-container {
    border-top: 1px solid #e4e1d6;
    border-right: 1px solid #e4e1d6;
    border-left: 1px solid #e4e1d6;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    max-width: 1200px;
    margin: 0 auto;
}
.dark-theme .playlist-header-container {
    border-top: 1px solid #01415f;
    border-right: 1px solid #01415f;
    border-left: 1px solid #01415f;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    max-width: 1200px;
    margin: 0 auto;
  }
.playlist-header {
    max-width: 700px;
    margin: 10px auto 4px auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 6px;
    padding-right: 2px;
    box-sizing: border-box;
}

#playlist {
    display: block;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
    list-style: none;
}

.playlist-placeholder {
    font-size: 12px;
    border: 1px dotted #dbd4b4;
    border-radius: 8px;
    display: block;
    padding: 25px 5px;
    max-width: 1200px;
    margin: 20px auto;
}

.toggle-tabs-btn {
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    text-align: center;
    line-height: 10px;
    border: none;
    border-radius: 4px;
    padding: 6px 5px;
    cursor: pointer;
    font-size: 10px;
}

.cc-btn:hover, .toggle-tabs-btn:hover {
    background: var(--color-btn-hover);
    box-shadow: var(--color-btn-shadow-hover);
}

.dark-theme .toggle-tabs-btn {
    color: #1b89bc;
}

.dark-theme .toggle-tabs-btn:hover {
    color: #ffd214;
}

/* Folder group styling */
.folder-group {
    margin-bottom: 7px;
    border: 1px solid #eeece2 !important;
    border-radius: 5px;
    background: #ffffff;
    overflow: hidden;
}

.dark-theme .folder-group {
    margin-bottom: 7px;
    border: 1px solid #1e3641 !important;
    border-radius: 5px;
    background: #ffffff;
    overflow: hidden;
}

.folder-header {
    background: #eeece2;
    padding: 8px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 13px;
    /* transition: background-color 0.2s; */
    border: none;
    width: 100%;
    text-align: left;
}

.folder-header:hover {
    background: #e3e0d1;
}

.folder-toggle {
    font-size: 14px;
    color: #8db9c1;
    transition: transform 0.2s;
}

.dark-theme .folder-toggle {
    font-size: 14px;
    color: #2a95a8;
    transition: transform 0.2s;
}

.folder-group.collapsed .folder-toggle {
    transform: rotate(-90deg);
}

.folder-group.collapsed > .folder-group {
  display: none !important;
}

.folder-videos {
    display: flex;
    background: #ffffff;
    flex-wrap: wrap;
    gap: 1px;
    padding: 15px;
    justify-content: flex-start;
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.2s;
    max-height: none;
    opacity: 1;
    overflow: visible;
}

.dark-theme .folder-videos {
    display: flex;
    background: #15262E;
    flex-wrap: wrap;
    gap: 1px;
    padding: 15px;
    justify-content: flex-start;
    transition: all 0.3s ease;
}

.folder-group.collapsed .folder-videos {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.2s;
}

/* Video button styling - now cleaner without folder paths */
.video-button {
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    padding: 8px 10px;
    background: transparent;
    border-radius: 5px;
    transition: all 0.2s;
    display: inline-block;
    border: 0.5px solid transparent;
    color: inherit;
    text-decoration: none;
    /* Touch improvements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.video-button:hover {
    border: 0.5px dotted #cac6b3;
    background: white;
    transform: translateY(-2px);
    transition: all 0.5s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-button.active,
.dark-theme .video-button.active {
    background: #0f8395;
    color: white;
    border-top: 0.5px solid #3dcce2;
    border-left: 0.5px solid #158b9d;
    border-right: 0.5px solid #158b9d;
    border-bottom: 0.5px solid #046877;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.video-button.active:before,
.dark-theme .video-button.active:before {
    content: 'Playing ▶';
    display: block !important;
    background: #ffd214;
    color: black;
    margin: 0 auto;
    text-align: center;
    margin-top: -17px;
    font-size: 10px;
    width: 55px;
    margin-bottom: 5px;
    padding: 1px 2px 2px 2px;
    border-radius: 22px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, .4);
}

h1 {
    font-size: 21px !important;
    border: none !important;
    margin-bottom: 20px;
}

.top-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
    max-width: 1200px;
    margin: 5px auto 0 auto;
    padding: 4px 8px;
    border-radius: 6px;
    box-sizing: border-box;
    min-height: 0;
}

.folder-btn {
    background: transparent;
    border: 0.5px dotted #bbb;
    font-style: italic;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.folder-path {
    font-size: 16px;
    color: #222222;
    margin: 0 6px 0 0;
    white-space: normal;
    /* Change from nowrap to normal to allow wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Keep this to indicate overflow */
    font-weight: bold;
    max-width: 300px;
    /* Set fixed max-width */
    flex: 1;
    /* Allow the folder path to grow in the flex container */
}

.instruction-text {
  font-size: 12px;
}

.search-input {
    flex: 1 1 100px;
    min-width: 100px;
    max-width: 180px;
    padding: 8px 15px;
    border: 1px solid #fefcf3;
    border-radius: 44px;
    font-size: 12px;
    box-sizing: border-box;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;
  }

.theme-toggle-btn {
    background: #002b3c;
    color: #fff;
    border: none;
    border-radius: 33px;
    padding: 0 0 1px 0;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
}

.dark-theme .theme-toggle-btn {
    background: #3fbbeb;
}

.theme-toggle-btn:hover {
    /*background: #ffffff;*/
    transform: translateY(-2px);
    transition: all 0.5s ease;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}

.lang-selector {
    font-size: 10px;
    margin-left: 8px;
    padding: 4px 2px;
    background: transparent;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.dark-theme .lang-selector {
    background: #1e3641;
    color: #1b89bc
}

.install-btn {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
}

.install-btn:hover {
    background: #218838;
}


@media (max-width: 600px) {
    .other-files-masonry {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* Tablet: stack in two lines if needed */
@media (max-width: 768px) {
    .top-controls {
        gap: 5px;
        padding: 4px 4px;
    }

    .folder-path {
        /*max-width: 120px;*/
        font-size: 13px;
        /* font-weight: 600; */
    }

    .video-controls {
        gap: 1px;
    }

    .speed-controls,
    .bookmark-controls {
        gap: 1px;
    }
}

/* Mobile: stack controls in up to three lines */
@media (max-width: 500px) {
    .top-controls {
        /* flex-direction: column; */
        align-items: stretch;
        gap: 4px;
        padding: 2px 2px;
    }

    .folder-path {
        max-width: 100%;
        font-size: 12px;
        /* font-weight: 600; */
        margin: 0 0 0 3px;
        text-align: left;
    }

    .folder-videos {
        justify-content: center;
    }

    .video-controls {
        /* flex-direction: column; */
        gap: 1px;
    }

    .speed-controls,
    .bookmark-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .bookmark-controls {
        gap: 1px;
    }
}

.loading-indicator {
    margin: 20px 0;
    font-size: 12px;
    font-style: italic;
    color: #666;
}

.current-video-info {
    font-size: 17px;
    margin: 10px 0;
    color: #212121;
    font-weight: bold;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    word-wrap: break-word;
}

.scroll-to-button {
    background: transparent;
    font-size: 10px;
    color: #17A2B8;
    border: 0.5px solid #c7dbde;
    padding: 6px 10px;
    margin: 7px 0;
    border-radius: 30px;
    cursor: pointer;
    vertical-align: middle;
}

.scroll-to-button:hover {
    background: rgba(93, 92, 222, 0.1);
}

/* Dark theme toggle support */
.dark-theme body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.dark-theme .folder-btn {
    background: #1b333c;
    color: #e0e0e0;
    border-top: 1.5px solid #0b4156;
    border-right: 1.5px solid #23414d;
    border-bottom: 1.5px solid #1a5369;
    border-left: 1.5px solid #23414d;
    font-style: italic;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
}

.folder-btn:hover {
    /* background: #0e5f6c;*/
    /* background: #9f0000;*/
    border: 1.5px solid transparent;
    background: #ffc214;
    transform: translateY(-3px);
    transition: all 0.9s ease;
    box-shadow: 0 0 8px #ffd214;
}

.folder-btn:hover .logo, .dark-theme .folder-btn:hover .logo-dark {
    filter: invert();
    transition: all .9s ease;
}

.dark-theme .folder-group {
    background: #15262E;
    border-color: #444;
}

.dark-theme .folder-header {
    background: #1e3641;
    color: #e0e0e0;
}

.dark-theme .folder-header:hover {
    background: #0b515e;
}

.dark-theme .video-button {

    color: #e0e0e0;
    border: 0.5px dotted transparent;
}

.dark-theme .video-button:hover {
    background: #0f8395;
    color: white;
    border: 0.5px dotted #28adc4;
}

.dark-theme .folder-path {
    color: #ffffff;
}

.dark-theme .loading-indicator {
    color: #aaa;
}

.dark-theme .search-input {
    background-color: #03080a;
    color: #3a90b8 !important;
    border-color: #153a4a;
}

.dark-theme .current-video-info {
    color: #e3e3e3;
}

.dark-theme .scroll-to-button {
    color: #1698cc;
    border-color: #126f95;
}

.dark-theme .scroll-to-button:hover {
    background: #00415f;
    color: white;
}

/* Dark theme overrides for this section */
.dark-theme .cc-btn {
    color: #1b89bc;
    font-size: 10px;
    font-weight: 700 !important;
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    text-align: center;
    line-height: 14px;
    border: none;
    padding: 7px 0;
    cursor: pointer;
}

.dark-theme .speed-btn {
    color: #1b89bc;
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
    transition: all 0.2s;
    letter-spacing: -.1em;
    text-align: center;
    line-height: 14px;
    font-style: italic;
    border: none;
    padding: 7px 0;
    cursor: pointer;
    font-size: 10px;
}

.dark-theme .speed-btn:hover {
    background: var(--color-btn-hover);
    box-shadow: none;
    color: #ffe400;
}

.dark-theme .speed-btn.active {
    background: var(--color-btn-hover);
    color: white;
    border-bottom: 4px solid var(--color-btn-active-border);
    margin-top: -4px;

}

.dark-theme .bookmark-btn {
    color: #1b89bc;
    background: var(--color-btn-bg);
    box-shadow: var(--color-btn-shadow);
}

.dark-theme .bookmark-btn:hover {
    background: #FFD214;
    color: black;
    box-shadow: none;
}

.dark-theme .bookmark-btn.clear:hover {
    background: #ff6161;
}

.dark-theme .bookmark-btn.pip:hover {
    background: #03cebd;
}

.dark-theme .bookmarks-list {
    background: #15262E;
}

.dark-theme .bookmarks-list h3 {
    color: #e0e0e0;
}

.dark-theme .bookmark-item:hover {
    background: #171b1b;
}

.dark-theme .bookmark-item:hover .bookmark-info {
    border-bottom: 0.5px dotted transparent;
    color: white;
}

.dark-theme .bookmark-item:hover .bookmark-video {
    color: white;
}

.dark-theme .bookmark-info {
    border-bottom: 0.5px dotted #1b465a;
}

.dark-theme .bookmark-video {
    color: #f5f5f5;
}

.dark-theme .keyboard-hint {
    color: #aaa;
}

/* Dark mode support for system preference */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    .folder-group {
        background: #15262E;
        border-color: #444;
    }

    .folder-header {
        background: #3a3a3a;
        color: #e0e0e0;
    }

    .folder-header:hover {
        background: #4a4a4a;
    }

    .video-button {
        background: #0F1C21;
        color: #e0e0e0;
    }

    /* .video-button:hover {
        background: #3a3a3a;
    } */

    .folder-path {
        color: #aaa;
    }

    .loading-indicator {
        color: #aaa;
    }

    .search-input {
        background-color: #0F1C21;
        color: #e0e0e0;
        border-color: #444;
    }

    .current-video-info {
        color: #7f7eec;
    }

    .scroll-to-button {
        color: #7f7eec;
        border-color: #7f7eec;
    }

    .scroll-to-button:hover {
        background: rgba(127, 126, 236, 0.1);
    }

    .top-controls {
        background: #0F1C21;
    }

    .video-controls {
        background: #0F1C21;
    }

    .bookmarks-list {
        background: #0F1C21;
    }

    .bookmarks-list h3 {
        color: #e0e0e0;
    }

    /* .bookmark-item {
        background: #3a3a3a;
    } */

    .bookmark-item:hover {
        background: #4a4a4a;
    }

    .bookmark-video {
        color: #aaa;
    }

    .keyboard-hint {
        color: #aaa;
    }
}

#playlist.masonry-view .folder-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: none;
  opacity: 1;
  overflow: visible;
  padding: 15px;
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.2s;
}

#playlist.masonry-view .folder-group.collapsed .folder-videos {
  display: block;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.2s;
}

#playlist.horizontal-list-view .folder-videos {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1px;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  padding: 15px;
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.2s;
}

#playlist.horizontal-list-view .video-button {
  width: auto;
  min-width: 120px;
  margin: 0;
}

@media (max-width: 600px) {
  #playlist.masonry-view .folder-videos {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
}
.loop-btn {
    min-width: 50px;
}
.loop-btn span.arrow {
    font-size: 14px;
    font-weight: bold;
}
/* Loop button styling */
/* .loop-btn {
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  background: var(--button-bg);
  border: 2px solid var(--button-border);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}

.loop-btn:hover {
  background: var(--button-hover-bg);
  transform: scale(1.05);
}

.loop-btn .icon {
  font-size: 16px;
  margin-bottom: 2px;
}

.loop-btn .txt {
  font-size: 10px;
  line-height: 12px;
  font-weight: 500;
} */

/* New Footer Styles */
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
}

.dark-theme .footer-content {
  border-top: 1px solid #2a2a2a;
}

.footer-section {
  margin-bottom: 30px;
}

.footer-section:last-child {
  margin-bottom: 0;
}

/* Disclaimer Section */
.footer-section.disclaimer h4 {
  color: var(--color-text);
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.footer-section.disclaimer p {
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 14px;
  text-align: left;
}

.footer-section.disclaimer p:last-child {
  margin-bottom: 0;
}

.footer-section.disclaimer a {
  color: #01879E;
  text-decoration: underline !important;
}

.dark-theme .footer-section.disclaimer a {
  color: #25ade4;
}

.footer-section.disclaimer a:hover {
  color: #016d7a;
}

.dark-theme .footer-section.disclaimer a:hover {
  color: #1e8bb8;
}

/* Links Section */
.footer-section.links {
  text-align: center;
  padding: 15px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.dark-theme .footer-section.links {
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text);
  text-decoration: none !important;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: var(--color-btn-bg);
  border: 1px solid #e0e0e0;
}

.dark-theme .footer-links a {
  border: 1px solid #2a2a2a;
}

.footer-links a:hover {
  background: var(--color-btn-hover);
  transform: translateY(-1px);
  box-shadow: var(--color-btn-shadow);
}

/* Copyright Section */
.footer-section.copyright {
  text-align: center;
  padding-top: 15px;
}

.footer-section.copyright small {
  color: var(--color-text);
  opacity: 0.8;
  font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .footer-content {
    padding: 15px;
  }
  
  .footer-links {
    gap: 15px;
  }
  
  .footer-links a {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .footer-section.disclaimer p {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer-links a {
    width: 100%;
    text-align: center;
  }
}