:root {
    --vlc-bg: #f0f0f0;
    --vlc-border: #a0a0a0;
    --vlc-menu: #e4e4e4;
    --vlc-text: #000000;
    --vlc-highlight: #cce8ff;
    --vlc-accent: #ff8800; /* VLC Orange */
    --vlc-dark: #000000;
}

/* GLOBAL CURSOR DEFAULT: Forces the native desktop arrow across the entire app */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif; 
    user-select: none; 
    cursor: default !important; 
}

/* Exception for actual text inputs so users can type */
input[type="text"], input[type="number"], textarea { 
    cursor: text !important; 
}

/* Exception for explicit hyperlinks in the about box */
a { 
    cursor: pointer !important; 
}

body { 
    overflow: hidden; 
    background: #ffffff; 
    color: var(--vlc-text);
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Restore interaction for sliders and inputs to fix Firefox drag freezing */
input, textarea, select {
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
}

/* SIMULATED DESKTOP WINDOW */
.vlc-window {
    width: 100vw;
    height: 100vh;
    background: var(--vlc-bg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--vlc-border);
}

/* MENU BAR */
.menu-bar {
    background: var(--vlc-bg);
    display: flex;
    padding: 2px 5px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--vlc-border);
}
.menu-item {
    padding: 4px 8px;
    position: relative;
}
.menu-item:hover, .menu-item.open { 
    background: var(--vlc-highlight); 
    border-radius: 2px; 
}
.dropdown {
    display: none;
    position: absolute;
    top: 100%; 
    left: 0;
    background: var(--vlc-bg);
    border: 1px solid var(--vlc-border);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 260px;
}

/* JavaScript toggles this class to open the menu */
.menu-item.open .dropdown { 
    display: block; 
}

.dropdown-item { 
    padding: 6px 15px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 15px; 
}
.dropdown-item:hover { 
    background: var(--vlc-highlight); 
}
.dropdown-item-text { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.dropdown-shortcut { 
    color: #666; 
    font-size: 0.75rem; 
    white-space: nowrap; 
}
.dropdown-separator { 
    border-top: 1px solid #ccc; 
    margin: 4px 0; 
}
.dropdown-item.disabled { 
    color: #888; 
    pointer-events: none; 
}

/* NESTED DROPDOWNS */
.nested-dropdown-parent { 
    position: relative; 
}
.nested-dropdown {
    display: none;
    position: absolute;
    top: 0; 
    left: 100%;
    background: var(--vlc-bg);
    border: 1px solid var(--vlc-border);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    min-width: 150px;
    z-index: 1001;
}

/* Sub-menus still open on hover standard to desktop behavior */
.nested-dropdown-parent:hover > .nested-dropdown { 
    display: block; 
}

.dropdown-item i.ph-caret-right { 
    font-size: 0.75rem; 
    color: #777; 
    margin-left: auto; 
}

/* RIGHT CLICK CONTEXT MENU */
.context-menu {
    display: none;
    position: fixed;
    background: var(--vlc-bg);
    border: 1px solid var(--vlc-border);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    z-index: 3000;
    min-width: 220px;
    padding: 2px 0;
}
.context-menu.show {
    display: block;
}
.context-item {
    padding: 6px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
    position: relative;
}
.context-item:hover {
    background: var(--vlc-highlight);
}
.context-item-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.context-separator {
    border-top: 1px solid #ccc;
    margin: 4px 0;
}

.context-nested-parent {
    /* position: relative handled by context-item */
}
.context-nested {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: var(--vlc-bg);
    border: 1px solid var(--vlc-border);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    min-width: 120px;
    z-index: 3001;
}
.context-nested-parent:hover > .context-nested {
    display: block;
}
/* This class is applied via JS if the menu is too close to the right edge */
.context-nested.flip-left {
    left: auto;
    right: 100%;
}


/* MAIN DISPLAY AREA */
.main-display-area {
    flex: 1;
    background: var(--vlc-dark);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.main-display-area.dragover { 
    border: 2px dashed var(--vlc-accent); 
}

#main-player { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    display: none; 
    z-index: 3; 
    position: relative;
}

#yt-player {
    width: 100%; 
    height: 100%; 
    border: none;
    display: none; 
    z-index: 3; 
    position: relative;
}

/* SUBTITLE TEXT STYLING (Native WebVTT) */
::cue {
    background: transparent;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    text-shadow: 2px 2px 1px #000000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

#album-art { 
    width: auto; 
    height: 100%; 
    max-width: 100%; 
    object-fit: contain; 
    z-index: 2; 
    position: relative; 
    display: none; 
}

.idle-logo {
    z-index: 1;
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 100%;
    height: 100%;
}

.idle-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* VOLUME OSD OVERLAY */
.osd-text {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    z-index: 100;
    pointer-events: none;
    max-width: 80%;
    text-align: right;
}
.osd-text.show {
    opacity: 1;
    transition: none;
}

/* FULLSCREEN FLOATING CONTROL BAR */
#fs-control-bar {
    display: none;
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    max-width: 900px;
    background: rgba(235, 235, 235, 0.9);
    border: 1px solid #aaa;
    border-radius: 6px;
    padding: 10px 15px;
    z-index: 2147483647;
    box-shadow: 0px 5px 20px rgba(0,0,0,0.5);
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fs-progress-row { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-size: 0.8rem; 
    color: #222; 
}
.fs-progress-bar-container {
    flex: 1; 
    height: 10px; 
    background: linear-gradient(to bottom, #d0d0d0, #e8e8e8); 
    border: 1px solid #999;
    border-radius: 5px; 
    position: relative; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
.fs-progress-fill { 
    height: 100%; 
    width: 0%; 
    background: linear-gradient(to bottom, #4da6ff, #0078d7); 
    position: relative;
    border-radius: 4px 0 0 4px;
}
.fs-thumb {
    position: absolute; 
    right: -7px; 
    top: -3px; 
    width: 14px; 
    height: 14px; 
    background: linear-gradient(to bottom, #f9f9f9, #d0d0d0); 
    border: 1px solid #777; 
    border-radius: 50%; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.fs-button-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
#fs-combined-time { 
    font-size: 0.8rem; 
    color: #222; 
    min-width: 80px; 
    text-align: right; 
}

/* PLAYLIST OVERLAY */
#playlist-view {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: #fff; 
    z-index: 10; 
    display: none; 
    flex-direction: column;
}
.playlist-header { 
    background: #f4f4f4; 
    padding: 5px 15px; 
    border-bottom: 1px solid #ccc; 
    display: grid; 
    grid-template-columns: 4fr 1fr 2fr 30px; 
    gap: 10px;
    font-size: 0.85rem; 
    font-weight: bold; 
}
.playlist-items { 
    overflow-y: auto; 
    flex: 1; 
    color: #000; 
    font-size: 0.9rem; 
}
.track-item { 
    display: grid; 
    grid-template-columns: 4fr 1fr 2fr 30px; 
    gap: 10px;
    padding: 4px 15px; 
    border-bottom: 1px solid #eee; 
    align-items: center;
}
.track-item:nth-child(even) { 
    background: #fafafa; 
}
.track-item:hover { 
    background: #e0f0ff; 
}
.track-item.active { 
    background: #0078d7; 
    color: #fff; 
}
.track-info { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.track-duration { 
    color: inherit; 
    opacity: 0.8; 
}
.track-album { 
    color: inherit; 
    opacity: 0.8; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.remove-track-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1rem;
    cursor: default !important;
    border-radius: 3px;
    height: 24px;
    width: 24px;
}
.remove-track-btn:hover {
    color: #d00;
    background: rgba(200, 0, 0, 0.1);
}

/* ADVANCED CONTROLS */
.advanced-controls {
    display: none; 
    background: var(--vlc-bg); 
    padding: 5px 10px;
    border-bottom: 1px solid #ccc; 
    gap: 10px; 
    align-items: center;
}
.advanced-controls.show { 
    display: flex; 
}
.rec-indicator { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background: red; 
    display: none; 
    animation: pulse 1s infinite; 
}
@keyframes pulse { 
    0% { opacity: 1; } 
    50% { opacity: 0.3; } 
    100% { opacity: 1; } 
}

/* CONTROLS AREA MATCHING SCREENSHOT */
.controls-wrapper { 
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0); 
    padding: 4px 15px 5px 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    border-top: 1px solid #c0c0c0;
}

/* PROGRESS BAR ROW */
.progress-row { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.75rem; 
    color: #333; 
}
.progress-bar-container {
    flex: 1; 
    height: 10px; 
    background: linear-gradient(to bottom, #c8c8c8, #e8e8e8); 
    border: none; 
    border-radius: 5px; 
    position: relative; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
    overflow: hidden;
}
.progress-fill { 
    height: 100%; 
    width: 0%; 
    background: linear-gradient(to bottom, #4da6ff, #0078d7); 
    position: relative; 
}

/* NEW SEEK TOOLTIP */
.seek-tooltip {
    display: none;
    position: fixed; 
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 2147483647;
    white-space: nowrap;
    transform: translate(-50%, -30px);
}

/* BUTTON BAR ROW */
.button-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.left-controls { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}
.btn-group { 
    display: flex; 
    gap: 3px; 
    align-items: center; 
}

/* BUTTON SHAPE AND BLUE HOVER STATE */
.vlc-btn {
    background: linear-gradient(to bottom, #ffffff, #f2f2f2);
    border: 1px solid #c8c8c8; 
    width: 26px; 
    height: 24px;
    padding: 0;
    border-radius: 3px; 
    font-size: 1.05rem; 
    color: #666;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 1px 1px rgba(0,0,0,0.03);
    transition: background 0.1s, border-color 0.1s;
}
.vlc-btn:hover { 
    background: linear-gradient(to bottom, #e5f3ff, #cce8ff); 
    border-color: #0078d7; 
}
.vlc-btn:active { 
    background: linear-gradient(to bottom, #cce8ff, #99d1ff); 
    border-color: #005a9e;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2); 
}

.vlc-btn.play-btn { 
    font-size: 1.35rem; 
    width: 32px; 
    height: 32px; 
}
.vlc-btn.play-btn .ph-play { 
    margin-left: -2px; 
}

.vlc-btn.active-state { 
    background: #d0e8ff; 
    border-color: #0078d7; 
    color: #0078d7; 
}
.vlc-btn:disabled { 
    color: #aaa; 
    background: transparent; 
    border-color: transparent; 
}

/* CUSTOM VOLUME CONTROLS */
.right-controls { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    position: relative; 
}
.vol-slider-wrap {
    position: relative;
    width: 100px; 
    height: 24px;
    display: flex;
    align-items: center;
}
.vlc-vol-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    margin: 0;
}

/* Fixed invisible thumb so Firefox correctly processes drag events */
.vlc-vol-slider::-moz-range-thumb {
    width: 15px; 
    height: 24px;
    background: rgba(128, 128, 128, 0.01);
    border: none;
    border-radius: 0;
}
.vlc-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px; 
    height: 24px;
    background: rgba(128, 128, 128, 0.01);
    border: none;
}

.vol-percent-text {
    position: absolute;
    top: -12px;
    left: 5px;
    font-size: 0.7rem;
    color: #555;
    pointer-events: none;
}

/* STATUS BAR */
.status-bar {
    background: var(--vlc-bg); 
    padding: 2px 10px; 
    font-size: 0.8rem; 
    color: #555;
    border-top: 1px solid var(--vlc-border); 
    display: none; 
    justify-content: space-between;
}

/* FLOATING WINDOWS - Rounded Corners */
.dialog-window {
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    background: var(--vlc-bg); 
    border: 1px solid #777; 
    box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
    z-index: 2000; 
    width: 400px; 
    display: none; 
    flex-direction: column;
    border-radius: 8px; 
    overflow: hidden;
    will-change: left, top;
}
.dialog-header { 
    background: #fff; 
    padding: 6px 10px; 
    border-bottom: 1px solid #ccc; 
    display: flex; 
    justify-content: space-between; 
    font-weight: bold; 
    font-size: 0.9rem; 
}
.dialog-close { 
    color: #d00; 
    font-weight: bold; 
    border: none; 
    background: none; 
    font-size: 1.1rem; 
}
.dialog-content { 
    padding: 15px; 
}

/* DIALOG TAB STYLING FOR EFFECTS */
.dialog-tabs { 
    display: flex; 
    border-bottom: 1px solid #ccc; 
    background: #e4e4e4; 
}
.tab-btn { 
    flex: 1; 
    padding: 6px; 
    border: none; 
    border-right: 1px solid #ccc; 
    background: #e4e4e4; 
    font-size: 0.85rem; 
    color: #333; 
}
.tab-btn:last-child { 
    border-right: none; 
}
.tab-btn.active { 
    background: #fff; 
    border-bottom: 1px solid #fff; 
    font-weight: bold; 
    margin-bottom: -1px; 
}
.tab-pane { 
    padding-top: 10px; 
    display: none; 
}
.tab-pane.active { 
    display: block; 
}

/* VIDEO FILTER SLIDERS */
.filter-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
    font-size: 0.85rem;
}
.filter-row label { 
    width: 100px; 
}
.filter-row input[type=range] { 
    flex: 1; 
}

/* PREFERENCES MENU */
.pref-section { 
    border-bottom: 1px solid #ccc; 
    padding-bottom: 15px; 
    margin-bottom: 15px; 
}
.pref-row { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 8px; 
    font-size: 0.85rem; 
}

/* EQ SLIDERS */
.eq-sliders-container { 
    display: flex; 
    justify-content: space-between; 
    height: 120px; 
    margin-top: 15px; 
}
.eq-band { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px; 
}
.eq-band label { 
    font-size: 0.7rem; 
    color: #333; 
}
input[type=range].vert-slider {
    appearance: slider-vertical;
    -webkit-appearance: slider-vertical;
    width: 15px; 
    height: 100px;
}

.file-input { 
    display: none; 
}
#recordings-list a { 
    display: block; 
    color: #0078d7; 
    text-decoration: none; 
    font-size: 0.85rem; 
    margin-bottom: 5px; 
}

/* Utility spacing for empty icon alignment */
.empty-icon-space { 
    display: inline-block; 
    width: 16px; 
}