/* Integrated LANPlayerWeb UI styles (shortened) */
/* Background and text colors matching Android app */
body { 
    font-family: Arial, sans-serif; 
    background: #1C1B1F; /* background_dark from Android */
    color: #E3E3E3; /* text_primary from Android */
    margin: 0;
}
.hidden { display: none !important; }

/* Link styling - elegant dark blue-gray, no underline */
#file-table a {
    color: #E3E3E3; /* text_primary from Android */
    text-decoration: none;
    transition: color 0.2s ease;
}

#file-table a:visited {
    color: #E3E3E3;
}

/* Disabled link during encoding */
#file-table a.link-disabled {
    color: #666666 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.5 !important;
}

/* Hover effect only on devices with precise pointing (mouse) */
@media (hover: hover) and (pointer: fine) {
    #file-table a:hover {
        color: #6750A4; /* primary from Android */
    }
}

/* Special folder link colors - matching Android app */
#file-table a.recent-videos-link {
    color: #FF6B35; /* hot_folder_orange */
}

#file-table a.recent-videos-link:visited {
    color: #FF6B35;
}

#file-table a.recently-watched-link {
    color: #2196F3; /* blue for recently watched */
}

#file-table a.recently-watched-link:visited {
    color: #2196F3;
}

#file-table a.corrupted-videos-link {
    color: #FFC107; /* corrupted_folder_amber */
}

#file-table a.corrupted-videos-link:visited {
    color: #FFC107;
}

#file-table a.custom-folder-link {
    color: #FFD700; /* gold for custom folders (star) */
}

#file-table a.custom-folder-link:visited {
    color: #FFD700;
}

header { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    box-sizing: border-box; 
    background: #2E3136; /* dialog_surface from Android */
    padding: 20px 64px 20px 20px; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); 
    z-index: 1000; 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    gap: 12px;
}
h1 { 
    margin: 0; 
    font-size: 20px; 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: calc(100% - 240px); 
    padding: 0 20px;
    color: #FFFFFF; /* dialog_text_primary from Android */
}
.filter-container { 
    position: absolute; 
    right: 63px; /* Move right - adjust this value */
    display: flex; 
    align-items: center; 
    justify-content: center;
    flex: 0 1 280px; 
    max-width: clamp(160px, 40vw, 320px); 
    min-width: 32px; /* Smaller circular size for collapsed state */
    width: 32px; /* Fixed width when collapsed - adjust this value */
    height: 32px; /* Fixed height when collapsed - adjust this value */
    transition: all 0.3s ease;
    border-radius: 50%; /* Perfect circle when collapsed */
    background: rgba(46, 49, 54, 0.9); /* dialog_surface with transparency */
    backdrop-filter: blur(12px);
    border: 1px solid #40454B; /* dialog_border */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filter-container:has(#filter-input:focus), 
.filter-container:has(#filter-input:not(:placeholder-shown)) { 
    right: 65px; /* Adjusted position when expanded - adjust this value */
    width: clamp(220px, 40vw, 320px); /* Allow width to expand */
    min-width: 200px; /* Expanded width */
    border-radius: 25px; /* Rounded rectangle when expanded */
    padding-left: 25px;
    padding-right: 25px;
}
.filter-icon { 
    position: absolute; 
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 14px; /* Smaller icon to match smaller container */
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: none; /* Prevent click interference */
}

/* When expanded, move icon to left */
.filter-container:has(#filter-input:focus) .filter-icon,
.filter-container:has(#filter-input:not(:placeholder-shown)) .filter-icon {
    left: 18px;
    transform: translateY(-50%);
}

.filter-icon:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transform: translate(-50%, -50%) scale(1.1);
}
#filter-input { 
    padding-left: 56px; 
    padding-right: 52px;
    width: 0; 
    opacity: 0; /* Hide when collapsed */
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    outline: none;
    color: #FFFFFF; /* dialog_text_primary */
    font-size: 14px;
    height: 32px; /* Match smaller container height */
    border-radius: 25px;
}

#filter-input:focus,
#filter-input:not(:placeholder-shown) { 
    width: clamp(220px, 40vw, 320px);
    opacity: 1;
    color: #FFFFFF;
}

#filter-input::placeholder {
    color: #8B9199; /* dialog_text_muted from Android */
}

.menu .menu-item .menu-item-text {
    flex: 1;
}

.clear-icon { 
    position: absolute; 
    right: 16px; 
    background: none; 
    border: none; 
    cursor: pointer; 
    display: none;
    color: transparent;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-icon:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transform: scale(1.1);
}
.filter-container:has(#filter-input:focus) .clear-icon, 
.filter-container:has(#filter-input:not(:placeholder-shown)) .clear-icon { 
    display: flex; 
}
/* Menu overlay for background click */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.hamburger-menu { 
    cursor: pointer; 
    position: absolute; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    z-index: 1001; 
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    transform: translateY(-50%) scale(1.1);
}

.hamburger-menu span { 
    display: block; 
    width: 25px; 
    height: 3px; 
    margin: 3px 0; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover span {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.menu { 
    display: none; 
    position: fixed; 
    top: 0; 
    right: 0; 
    width: 300px; 
    height: 100%; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0,0,0,0.3); 
    padding: 80px 0 20px 0; 
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu.open { 
    display: block; 
    transform: translateX(0);
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    margin: 8px 20px;
}

.menu .menu-item {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.menu .menu-item .menu-item-text {
    flex: 1;
}

.menu .menu-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.menu .menu-item:hover:before {
    left: 100%;
}

.menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.menu .menu-item:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.menu .menu-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu .upload-item {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.menu .upload-item:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.close-menu { 
    position: absolute; 
    bottom: 20px; 
    left: 20px;
    right: 20px;
    text-align: center; 
    padding: 16px 0; 
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 19, 38, 0.55);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 24px;
    box-sizing: border-box;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(135deg, #ffffff 0%, #f7f8ff 100%);
    color: #1f1f2f;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(65, 78, 128, 0.35);
    width: clamp(280px, 92vw, 520px);
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close-button {
    background: none;
    border: none;
    color: #667eea;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.modal-close-button:hover {
    transform: scale(1.1);
    color: #764ba2;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-button-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-action-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    color: #3b3b54;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-action-button i {
    font-size: 18px;
    color: #667eea;
}

.modal-action-button:hover {
    transform: translateY(-2px);
    background: rgba(102, 126, 234, 0.18);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
}

.modal-action-button.secondary {
    background: rgba(118, 75, 162, 0.12);
    border-color: rgba(118, 75, 162, 0.25);
}

.modal-action-button.secondary i {
    color: #764ba2;
}

.tag-type-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tag-type-editor .add-tag-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-type-editor .add-tag-row input[type="text"] {
    flex: 1 1 220px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.tag-type-editor .add-tag-row input[type="text"]:focus {
    outline: none;
    border-color: rgba(118, 75, 162, 0.6);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.12);
}

.tag-type-editor .add-tag-row button {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #00d4aa 0%, #00c0ff 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag-type-editor .add-tag-row button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 208, 255, 0.3);
}

.tag-type-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 6px;
}

.tag-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.tag-type-name {
    font-weight: 600;
    color: #2f2f44;
    flex: 1;
    word-break: break-word;
}

.tag-type-actions {
    display: flex;
    gap: 8px;
}

.tag-type-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag-type-actions .edit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tag-type-actions .delete-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #fff;
}

.tag-type-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.tag-type-empty {
    text-align: center;
    color: #8d8da3;
    font-size: 14px;
    font-style: italic;
}

.tag-folder-instructions {
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    padding: 16px 18px;
    color: #384260;
    line-height: 1.6;
}

.tag-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 6px;
}

.tag-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.tag-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.tag-checkbox-item label {
    flex: 1;
    font-size: 14px;
    cursor: pointer;
    color: #2f2f44;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer button {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-footer .cancel-button {
    background: rgba(203, 212, 255, 0.55);
    color: #4a4a6a;
}

.modal-footer .primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.modal-footer button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.25);
}

.modal-helper-text {
    font-size: 13px;
    color: #667;
    line-height: 1.5;
}

.modal-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-chip {
    background: rgba(102, 126, 234, 0.18);
    color: #4a4a6a;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.custom-folder-manager {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.custom-folder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 6px;
}

.custom-folder-empty {
    padding: 20px;
    text-align: center;
    color: #747491;
    background: rgba(102, 126, 234, 0.08);
    border: 1px dashed rgba(102, 126, 234, 0.35);
    border-radius: 12px;
    font-size: 13px;
}

.custom-folder-add {
    align-self: flex-start;
    margin-bottom: 20px;
    padding: 10px 18px;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #00bcd4, #7c4dff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-folder-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.custom-folder-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
}

.custom-folder-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.custom-folder-name {
    font-size: 15px;
    font-weight: 600;
    color: #2f2f44;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-folder-meta {
    font-size: 12px;
    color: #6b6b84;
}

.custom-folder-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.custom-folder-tag {
    background: rgba(118, 75, 162, 0.15);
    color: #5a4d79;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.custom-folder-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-folder-toggle {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #42d392 0%, #1abc9c 100%);
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-folder-toggle.disabled {
    background: linear-gradient(135deg, #c4c4d4 0%, #9fa0b8 100%);
    color: #f8f8ff;
}

.custom-folder-toggle:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(26, 188, 156, 0.25);
}

.custom-folder-edit {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-folder-edit i {
    font-size: 14px;
}

.custom-folder-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(118, 75, 162, 0.25);
}

.custom-folder-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.custom-folder-label {
    font-weight: 600;
    font-size: 13px;
    color: #4b4b63;
}

.custom-folder-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    font-size: 14px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.custom-folder-input:focus {
    outline: none;
    border-color: rgba(118, 75, 162, 0.6);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.12);
}

.custom-folder-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 6px;
}

.custom-folder-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.18);
    font-size: 13px;
    color: #2f2f44;
}

.custom-folder-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.custom-folder-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.custom-folder-editor-actions .cancel-button,
.custom-folder-editor-actions .primary-button,
.custom-folder-editor-actions .danger-button {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-folder-editor-actions .cancel-button {
    background: rgba(203, 212, 255, 0.55);
    color: #4a4a6a;
}

.custom-folder-editor-actions .primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.custom-folder-editor-actions .danger-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #fff;
}

.custom-folder-editor-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(102, 126, 234, 0.2);
}
.container { width:100%; padding:62px 0 0 0; }
#file-table { 
    width: 100%; 
    border-collapse: collapse; 
    table-layout: fixed;
    background: #1C1B1F; /* background_dark from Android */
}
#file-table th, #file-table td { 
    border: 1px solid #40454B; /* dialog_border from Android */
    padding: 8px;
    color: #E3E3E3; /* text_primary from Android */
}
#file-table th { 
    cursor: pointer; 
    position: relative; 
    background: #2E3136; /* dialog_surface from Android */
    color: #FFFFFF; /* dialog_text_primary from Android */
}

#file-table tbody tr {
    background: #24272B; /* dialog_bg from Android */
    transition: background-color 0.2s ease;
}

/* Hover effect only on devices with precise pointing (mouse) */
@media (hover: hover) and (pointer: fine) {
    #file-table tbody tr:hover {
        background: #363A40; /* dialog_surface_highlight from Android */
    }
}

/* Prevent focus/active state from persisting */
#file-table tbody tr:focus,
#file-table tbody tr:active,
#file-table tbody tr.active,
#file-table tbody tr.focused {
    outline: none;
}

/* Sort icon positioning */
#file-table th {
    position: relative;
    padding-right: 35px; /* Make room for sort icons */
}

/* Sort icons container */
#file-table th .sort-icons {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 10px;
}

/* Individual sort arrows */
#file-table th .sort-up,
#file-table th .sort-down {
    transition: all 0.2s ease;
}

/* Active column styles */
#file-table th.active-asc .sort-up {
    color: #333; /* Black filled */
}
#file-table th.active-asc .sort-down {
    color: #ccc; /* White outline */
}

#file-table th.active-desc .sort-up {
    color: #ccc; /* White outline */
}
#file-table th.active-desc .sort-down {
    color: #333; /* Black filled */
}

/* Inactive column styles */
#file-table th:not(.active-asc):not(.active-desc) .sort-up,
#file-table th:not(.active-asc):not(.active-desc) .sort-down {
    color: #ddd; /* Very light gray */
}

/* Date column styling */
#file-table th:first-child,
#file-table td:first-child { 
    width: 85px; /* Fixed width for yyyy/MM/dd + small margin */
    min-width: 85px;
    max-width: 100px;
    white-space: nowrap;
    vertical-align: top;
}

/* Tag column styling */
#file-table th.tag-column,
#file-table td.tag-column { 
    width: 100px;
    min-width: 10px;
    max-width: 150px;
    vertical-align: top;
    transition: all 0.3s ease;
}

#file-table td.tag-column[style*="cursor: pointer"]:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

#file-table th.tag-column.hidden,
#file-table td.tag-column.hidden {
    display: none;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
}

.tag-container.stack-vertical {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
}

.tag-container.stack-vertical .tag {
    width: fit-content;
}

.tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.tag:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Custom folder tags with different color */
.tag.custom-folder-tag {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tag.custom-folder-tag:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.no-tags {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Date cell content wrapper */
.date-cell-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.date-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}
.folder-icon, .movie-icon, .image-icon, .audio-icon, .custom-folder-icon, .recent-folder-icon, .recently-watched-folder-icon, .corrupted-folder-icon { margin-right:8px; }
.folder-icon::before, .movie-icon::before, .image-icon::before, .audio-icon::before, .custom-folder-icon::before, .recent-folder-icon::before, .recently-watched-folder-icon::before, .corrupted-folder-icon::before { font-family:"Font Awesome 5 Free"; font-weight:900; }
.folder-icon::before { content:"\f07b"; color: #FFD700; }
.movie-icon::before { content:"\f008"; }
.image-icon::before { content:"\f03e"; color: #9C27B0; }
.audio-icon::before { content:"\f001"; color: #FF5722; }
.custom-folder-icon::before { content:"\f005"; color: #FFD700; }
.recent-folder-icon::before { content:"\f017"; color: #2196F3; }
.recently-watched-folder-icon::before { content:"\f1da"; color: #FF9800; }
.corrupted-folder-icon::before { content:"\f071"; color: #f44336; }
.play-icon { 
    position: absolute; 
    left: 1%; 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 20px;
    color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.play-icon:active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}
#VideoContainer { position:fixed; top:0; left:0; width:100%; height:100%; background:#000; z-index:10000; display:flex; justify-content:center; align-items:center; }
#VideoContainer video { max-width:100%; max-height:100%; }
.rename-button, .delete-button, .convert-button { 
    display: none; 
    padding: 7px 12px;
    margin: 1px 0;
    border: none;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}
.rename-button i, .delete-button i, .convert-button i {
    margin-right: 4px;
    font-size: 10px;
}

.rename-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.delete-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.convert-button {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    color: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.35);
    letter-spacing: 0.02em;
}

.rename-button:before, .delete-button:before, .convert-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.rename-button:hover:before, .delete-button:hover:before, .convert-button:hover:before {
    left: 100%;
}

.rename-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.delete-button:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.convert-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.rename-button:active, .delete-button:active, .convert-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.rename-button.show, .delete-button.show, .convert-button.show { 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    animation: buttonSlideIn 0.3s ease-out;
}

.transcode-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.transcode-status {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.transcode-status.show {
    display: flex;
}

.transcode-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.transcode-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #00c6ff 0%, #18a7ff 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.transcode-status-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #2f2f44;
}

.transcode-status--completed .transcode-progress-fill {
    background: linear-gradient(135deg, #42d392 0%, #1abc9c 100%);
}

.transcode-status--completed .transcode-status-text {
    color: #1b9a59;
}

.transcode-status--error .transcode-progress-bar {
    background: rgba(217, 83, 79, 0.2);
}

.transcode-status--error .transcode-status-text {
    color: #d9534f;
}

.transcode-status--waiting .transcode-progress-bar {
    background: rgba(0, 0, 0, 0.05);
}

.transcode-status--waiting .transcode-progress-fill {
    width: 35%;
    animation: transcodeWaiting 1.2s infinite linear;
}

@keyframes transcodeWaiting {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(220%); }
}

.tag-edit-button {
    display: none;
    padding: 6px 10px;
    margin: 1px 0;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #00bcd4 0%, #009688 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-edit-button i {
    margin-right: 4px;
    font-size: 9px;
}

.tag-edit-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.tag-edit-button:hover:before {
    left: 100%;
}

.tag-edit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.4);
    background: linear-gradient(135deg, #009688 0%, #00bcd4 100%);
}

.tag-edit-button.show {
    display: inline-block;
    animation: buttonSlideIn 0.3s ease-out;
}

body.convert-mode-active .tag-edit-button {
    display: none !important;
}

@keyframes buttonSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.progress-container { 
    position: relative; 
    width: 95%; 
    margin: 12px auto 8px auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
}

#upload-progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    overflow: hidden;
}

#upload-progress::-webkit-progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#upload-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #00d4aa, #00d4ff);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#upload-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #00d4aa, #00d4ff);
    border-radius: 4px;
}

#upload-percentage { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#upload-file-list, #upload-file-list-modal {
    max-height: 200px; 
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    margin-top: 8px;
    color: #ffffff;
    font-size: 12px;
}

#upload-file-list-modal {
    max-height: 400px;
    background: transparent;
    padding: 0;
    margin-top: 0;
}

#upload-file-list::-webkit-scrollbar, #upload-file-list-modal::-webkit-scrollbar {
    width: 6px;
}

#upload-file-list::-webkit-scrollbar-track, #upload-file-list-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#upload-file-list::-webkit-scrollbar-thumb, #upload-file-list-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#upload-file-list::-webkit-scrollbar-thumb:hover, #upload-file-list-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.upload-file-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin-bottom: 4px;
}

.upload-file-item .filename {
    font-weight: 600;
    color: #E3E3E3;
    word-break: break-word;
}

.upload-file-item .status {
    font-size: 11px;
    color: #B3B3B3;
}

.upload-file-item .pf-progress {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.2);
}

.upload-file-item .pf-progress::-webkit-progress-bar {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.upload-file-item .pf-progress::-webkit-progress-value {
    background: linear-gradient(135deg, #6750A4 0%, #4CAF50 100%);
    border-radius: 2px;
}

.upload-file-item .pf-percent {
    font-size: 11px;
    color: #6750A4;
    font-weight: 600;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}
