/**
 * assets/css/chat_page/files.css
 * AbraCollab Files & Folder Management Styling
 * Built on the AbraCollab BrightSaaS design system
 * Supports Dark Mode and Light Mode seamlessly
 */

/* ============================================================
   1. ASIDE SIDEBAR (COLUMN 1)
   ============================================================ */
.files_management_module {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

body.dark_mode .files_management_module {
    background: #0b0f19 !important;
    color: #e2e8f0 !important;
}

body.light_mode .files_management_module {
    background: #ffffff !important;
    color: #334155 !important;
}

.files_sidebar_view {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
    overflow-y: auto;
    padding: 16px 14px;
}

.files_sidebar_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 4px;
}

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

.files_header_icon {
    font-size: 22px;
    color: #6366f1;
}

.files_view_title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body.dark_mode .files_view_title {
    color: #ffffff !important;
}

body.light_mode .files_view_title {
    color: #0f172a !important;
}

.files_view_actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.files_btn_icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

body.dark_mode .files_btn_icon {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark_mode .files_btn_icon:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #ffffff !important;
}

body.light_mode .files_btn_icon {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light_mode .files_btn_icon:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Quick Search Box */
.files_quick_search_wrap {
    position: relative;
    margin-bottom: 16px;
}

.files_search_icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #64748b;
    pointer-events: none;
}

.files_quick_search_input {
    width: 100%;
    height: 38px;
    padding: 8px 32px 8px 36px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

body.dark_mode .files_quick_search_input {
    background: #151d2f !important;
    border: 1px solid #23314d !important;
    color: #e2e8f0 !important;
}

body.dark_mode .files_quick_search_input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

body.light_mode .files_quick_search_input {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light_mode .files_quick_search_input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.files_search_clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

/* Navigation Lists & Items */
.files_nav_list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.files_nav_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.files_nav_main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.files_nav_icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #94a3b8;
}

.files_nav_label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files_color_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Hierarchical Folder Tree */
.files_tree_node {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.files_tree_children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.files_tree_toggle {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    font-size: 11px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.files_tree_toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

body.light_mode .files_tree_toggle {
    color: #64748b;
}

body.light_mode .files_tree_toggle:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.08);
}

.files_tree_spacer {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
}

.files_tree_icon {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex-shrink: 0;
}

.files_count_badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

body.dark_mode .files_nav_item {
    color: #cbd5e1;
}

body.dark_mode .files_nav_item:hover {
    background: #1e293b;
    color: #ffffff;
}

body.dark_mode .files_nav_item.active {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #ffffff !important;
    border-left: 3px solid #6366f1;
}

body.dark_mode .files_count_badge {
    background: #1e293b;
    color: #94a3b8;
}

body.dark_mode .files_nav_item.active .files_count_badge {
    background: #6366f1;
    color: #ffffff;
}

body.light_mode .files_nav_item {
    color: #475569;
}

body.light_mode .files_nav_item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.light_mode .files_nav_item.active {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border-left: 3px solid #6366f1;
}

body.light_mode .files_count_badge {
    background: #f1f5f9;
    color: #64748b;
}

body.light_mode .files_nav_item.active .files_count_badge {
    background: #6366f1;
    color: #ffffff;
}

/* Section Blocks */
.files_section_block {
    margin-top: 18px;
}

.files_section_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.files_section_title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.files_section_add_btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.files_section_add_btn:hover {
    background: rgba(99, 102, 241, 0.12);
}


/* ============================================================
   2. MIDDLE CONTENT VIEW (COLUMN 2)
   ============================================================ */
.files_middle_view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.files_view_panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Top Toolbar */
.files_topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid;
    flex-shrink: 0;
    flex-wrap: wrap;
}

body.dark_mode .files_topbar {
    background: #0f172a;
    border-color: #1e293b;
}

body.light_mode .files_topbar {
    background: #ffffff;
    border-color: #e2e8f0;
}

.files_topbar_left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.files_grid_back_btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
}

.files_title_wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.files_current_view_title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

body.dark_mode .files_current_view_title { color: #ffffff; }
body.light_mode .files_current_view_title { color: #0f172a; }

.files_view_count_badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #6366f1;
    color: #ffffff;
}

/* Breadcrumbs bar */
.files_breadcrumbs_bar {
    display: flex;
    align-items: center;
}

.files_breadcrumb_list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
}

.files_breadcrumb_item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}

.files_breadcrumb_item a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.files_breadcrumb_item a:hover {
    color: #6366f1;
}

.files_breadcrumb_item.active {
    font-weight: 700;
}

body.dark_mode .files_breadcrumb_item.active { color: #ffffff; }
body.light_mode .files_breadcrumb_item.active { color: #0f172a; }

.files_breadcrumb_sep {
    color: #64748b;
    font-size: 12px;
}

/* Center Search */
.files_topbar_center {
    flex: 1;
    max-width: 400px;
    min-width: 180px;
}

.files_topbar_center:empty {
    display: none;
}

.files_search_box {
    position: relative;
    display: flex;
    align-items: center;
}

.files_search_box i {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
}

.files_search_input {
    width: 100%;
    height: 38px;
    padding: 8px 34px 8px 36px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

body.dark_mode .files_search_input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}

body.dark_mode .files_search_input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

body.light_mode .files_search_input {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

body.light_mode .files_search_input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.files_search_clear_btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

/* Right Toolbar Items */
.files_topbar_right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.files_view_mode_toggle {
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 2px;
    border: 1px solid;
}

body.dark_mode .files_view_mode_toggle {
    background: #1e293b;
    border-color: #334155;
}

body.light_mode .files_view_mode_toggle {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.files_view_toggle_btn {
    width: 32px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.15s ease;
}

.files_view_toggle_btn.active {
    background: #6366f1;
    color: #ffffff;
}

.files_sort_dropdown_wrap select,
.files_sort_select {
    height: 36px;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    color-scheme: dark;
}

.files_sort_dropdown_wrap select option,
.files_sort_select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

body.dark_mode .files_sort_dropdown_wrap select,
body.dark_mode .files_sort_select {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    color-scheme: dark;
}

body.dark_mode .files_sort_dropdown_wrap select:focus,
body.dark_mode .files_sort_select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

body.dark_mode .files_sort_dropdown_wrap select option,
body.dark_mode .files_sort_select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

body.light_mode .files_sort_dropdown_wrap select,
body.light_mode .files_sort_select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    color-scheme: light;
}

body.light_mode .files_sort_dropdown_wrap select:focus,
body.light_mode .files_sort_select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

body.light_mode .files_sort_dropdown_wrap select option,
body.light_mode .files_sort_select option {
    background-color: #ffffff;
    color: #334155;
}

/* Modal select dropdowns */
body.dark_mode .files_modal_card select,
body.dark_mode .files_share_group_select,
body.dark_mode .files_share_perm_select {
    color-scheme: dark;
}

body.dark_mode .files_modal_card select option,
body.dark_mode .files_share_group_select option,
body.dark_mode .files_share_perm_select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

body.light_mode .files_modal_card select,
body.light_mode .files_share_group_select,
body.light_mode .files_share_perm_select {
    color-scheme: light;
}

body.light_mode .files_modal_card select option,
body.light_mode .files_share_group_select option,
body.light_mode .files_share_perm_select option {
    background-color: #ffffff;
    color: #334155;
}

/* Layout Body: Main Content + Details Panel */
.files_layout_body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.files_main_content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

body.dark_mode .files_main_content {
    background: #0b0f19;
}

body.light_mode .files_main_content {
    background: #f8fafc;
}

/* Drag & Drop Overlay */
.files_drag_overlay {
    position: absolute;
    inset: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 2px dashed #6366f1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.files_drag_box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6366f1;
    font-size: 18px;
    font-weight: 600;
}

.files_drag_box i {
    font-size: 48px;
}

/* Section Title Rows */
.files_section_title_row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.files_sec_title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body.dark_mode .files_sec_title { color: #f1f5f9; }
body.light_mode .files_sec_title { color: #1e293b; }

.files_folders_count_text,
.files_files_count_text {
    font-size: 12px;
    color: #64748b;
}


/* ============================================================
   3. FOLDER CARDS (Matching Screenshot files1.jpg)
   ============================================================ */
.files_folders_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.folder_card {
    border-radius: 12px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

body.dark_mode .folder_card {
    background: #151d2f;
    border-color: #23314d;
}

body.dark_mode .folder_card:hover {
    background: #1c273e;
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark_mode .folder_card.selected {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.15) !important;
}

body.light_mode .folder_card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light_mode .folder_card:hover {
    background: #ffffff;
    transform: translateY(-2px);
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

body.light_mode .folder_card.selected {
    border-color: #6366f1 !important;
    background: #eef2ff !important;
}

.folder_card_fav_star {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: color 0.15s ease;
}

.folder_card_top_actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.folder_card_top_actions .folder_card_fav_star,
.folder_card_top_actions .folder_card_fav_badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 13px;
    line-height: 1;
}

.folder_card_fav_badge {
    pointer-events: none;
}

.folder_card_fav_star.active,
.folder_card_fav_star:hover {
    color: #f59e0b;
}

.file_card_top_actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    flex-shrink: 0;
}

.file_card_top_actions .file_card_fav_star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.files_list_actions_wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.files_item_menu_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s ease;
    flex-shrink: 0;
    line-height: 1;
}

.files_item_menu_btn i {
    font-size: 15px;
    line-height: 1;
}

.files_item_menu_btn:hover,
.files_item_menu_btn.open {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

body.light_mode .files_item_menu_btn {
    color: #64748b;
}

body.light_mode .files_item_menu_btn:hover,
body.light_mode .files_item_menu_btn.open {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

.file_card:has(.files_item_menu_dropdown.open),
.folder_card:has(.files_item_menu_dropdown.open),
.files_list_row:has(.files_item_menu_dropdown.open),
.file_card.menu_active,
.folder_card.menu_active,
.files_list_row.menu_active {
    overflow: visible !important;
    z-index: 50 !important;
}

.folder_card.menu_active .folder_card_top_actions,
.file_card.menu_active .file_card_top_actions,
.folder_card:has(.files_item_menu_dropdown.open) .folder_card_top_actions,
.file_card:has(.files_item_menu_dropdown.open) .file_card_top_actions {
    z-index: 60 !important;
}

.files_item_menu_dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1050;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    min-width: 140px;
    max-width: calc(100vw - 20px);
    padding: 4px;
    list-style: none;
    margin: 0;
    text-align: left;
}

body.dark_mode .files_item_menu_dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

body.light_mode .files_item_menu_dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.files_item_menu_dropdown.open {
    display: block;
}

.files_item_menu_dropdown li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
    color: #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}

.files_item_menu_dropdown li i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

body.dark_mode .files_item_menu_dropdown li {
    color: #e2e8f0;
}

body.dark_mode .files_item_menu_dropdown li:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
}

.files_item_menu_dropdown li.files_item_menu_delete {
    color: #f87171;
}

body.dark_mode .files_item_menu_dropdown li.files_item_menu_delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.light_mode .files_item_menu_dropdown li {
    color: #334155;
}

body.light_mode .files_item_menu_dropdown li:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.light_mode .files_item_menu_dropdown li.files_item_menu_delete {
    color: #dc2626;
}

body.light_mode .files_item_menu_dropdown li.files_item_menu_delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.folder_card_icon_wrap {
    font-size: 40px;
    margin-bottom: 8px;
    line-height: 1;
    color: #f59e0b;
}

.folder_card_name {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

body.dark_mode .folder_card_name { color: #f8fafc; }
body.light_mode .folder_card_name { color: #0f172a; }

.folder_card_meta {
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}


/* ============================================================
   4. FILE CARDS (GRID VIEW - Matching Screenshot files1.jpg)
   ============================================================ */
.files_cards_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.file_card {
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

body.dark_mode .file_card {
    background: #151d2f;
    border-color: #23314d;
}

body.dark_mode .file_card:hover {
    background: #1a243a;
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.dark_mode .file_card.selected {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

body.light_mode .file_card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light_mode .file_card:hover {
    transform: translateY(-2px);
    border-color: #6366f1;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.1);
}

body.light_mode .file_card.selected {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Drag and Drop internal move styles */
.file_card[draggable="true"],
.folder_card[draggable="true"],
.files_list_row[draggable="true"] {
    cursor: grab;
}

.file_card.is_dragging,
.folder_card.is_dragging,
.files_list_row.is_dragging {
    opacity: 0.45 !important;
    transform: scale(0.97);
    cursor: grabbing !important;
}

/* Valid drop target hover highlight */
.folder_card.drag_target_over,
.files_tree_node .files_nav_item.drag_target_over,
.files_primary_filters .files_nav_item.drag_target_over,
.crumb_link.drag_target_over {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.28) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5) !important;
    transform: scale(1.03);
    transition: all 0.15s ease;
}

.files_primary_filters .files_nav_item[data-filter="trash"].drag_target_over {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.28) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5) !important;
}

.files_primary_filters .files_nav_item[data-filter="favorites"].drag_target_over {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.28) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5) !important;
}

body.light_mode .folder_card.drag_target_over,
body.light_mode .files_tree_node .files_nav_item.drag_target_over,
body.light_mode .files_primary_filters .files_nav_item.drag_target_over,
body.light_mode .crumb_link.drag_target_over {
    background: #e0e7ff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35) !important;
}

body.light_mode .files_primary_filters .files_nav_item[data-filter="trash"].drag_target_over {
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35) !important;
}

body.light_mode .files_primary_filters .files_nav_item[data-filter="favorites"].drag_target_over {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.35) !important;
}

/* Drag ghost badge */
.files_drag_ghost {
    position: fixed;
    top: -9999px;
    left: -9999px;
    background: #6366f1;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 99999;
    pointer-events: none;
}

/* Card Header */
.file_card_header {
    padding: 14px 14px 8px 14px;
    display: flex;
    flex-direction: column;
}

.file_card_top_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.file_card_title {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

body.dark_mode .file_card_title { color: #f8fafc; }
body.light_mode .file_card_title { color: #0f172a; }

.file_card_fav_star {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.file_card_fav_star.active,
.file_card_fav_star:hover {
    color: #f59e0b;
}

.file_card_desc {
    font-size: 11.5px;
    color: #3b82f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    min-height: 16px;
}

/* Card Visual / Thumbnail Body */
.file_card_visual_wrap {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    position: relative;
}

body.dark_mode .file_card_visual_wrap { background: #0c1220; }
body.light_mode .file_card_visual_wrap { background: #f1f5f9; }

/* Image Visual */
.file_card_image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.file_card:hover .file_card_image {
    transform: scale(1.02);
}

/* Iconic PDF Red Badge (matching reference screenshot files1.jpg & files2.jpg) */
.file_card_pdf_badge {
    width: 82%;
    height: 80%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
}

.file_card_pdf_text {
    color: #ffffff;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.08em;
    font-family: system-ui, -apple-system, sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Generic File Visual Placeholder */
.file_card_generic_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file_card_generic_placeholder img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease;
}

.file_card:hover .file_card_generic_placeholder img {
    transform: scale(1.05);
}

.file_card_generic_placeholder i {
    font-size: 54px;
    color: #6366f1;
}

/* Video Indicator Overlay */
.file_card_video_indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.file_card_video_indicator i {
    font-size: 44px;
    color: #ffffff;
    opacity: 0.9;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Card Footer */
.file_card_footer {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.file_card_date {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
}

.file_card_collab_actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Comments Bubble Button */
.card_comment_btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #2563eb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.card_comment_btn:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px) scale(1.05);
}

.card_comment_count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    color: #ffffff !important;
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0c1220;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    line-height: 1;
    z-index: 2;
    letter-spacing: -0.2px;
}

body.light_mode .card_comment_count {
    border-color: #ffffff;
}

/* 3 Reaction Buttons: Like, Neutral, Dislike */
.card_react_btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 14px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    user-select: none;
    box-sizing: border-box;
}

.card_react_btn:hover {
    transform: translateY(-1px) scale(1.05);
}

.card_react_btn:active {
    transform: scale(0.95);
}

/* Thumbs Up (Like) */
.card_react_btn.btn_like {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25);
}
.card_react_btn.btn_like:hover {
    background: rgba(16, 185, 129, 0.28);
    color: #34d399;
}
.card_react_btn.btn_like.active {
    background: #059669;
    color: #ffffff;
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45), 0 2px 8px rgba(5, 150, 105, 0.4);
}

/* Neutral */
.card_react_btn.btn_neutral {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.25);
}
.card_react_btn.btn_neutral:hover {
    background: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}
.card_react_btn.btn_neutral.active {
    background: #d97706;
    color: #ffffff;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 2px 8px rgba(217, 119, 6, 0.4);
}

/* Thumbs Down (Dislike) */
.card_react_btn.btn_dislike {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
}
.card_react_btn.btn_dislike:hover {
    background: rgba(239, 68, 68, 0.28);
    color: #f87171;
}
.card_react_btn.btn_dislike.active {
    background: #dc2626;
    color: #ffffff;
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.45), 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* Number Container inside Reaction Buttons */
.card_react_cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.2px;
    transition: all 0.15s ease;
}

/* Inactive button count styling (when reactions exist, crisp high-contrast pill) */
.card_react_btn .card_react_cnt {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
}

body.light_mode .card_react_btn .card_react_cnt {
    background: rgba(0, 0, 0, 0.12);
    color: #0f172a !important;
}

/* Active buttons: darker, high-contrast dedicated badge inside the pill */
.card_react_btn.btn_like.active .card_react_cnt {
    background: #064e3b;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card_react_btn.btn_neutral.active .card_react_cnt {
    background: #78350f;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card_react_btn.btn_dislike.active .card_react_cnt {
    background: #7f1d1d;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Toast alert notification */
.files_toast_alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    background: #1e293b;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    pointer-events: none;
    animation: filesToastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.files_toast_alert.success {
    background: #065f46;
    border-color: #10b981;
}

.files_toast_alert.error {
    background: #7f1d1d;
    border-color: #ef4444;
}

.files_toast_alert.info {
    background: #1e3a8a;
    border-color: #3b82f6;
}

@keyframes filesToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   5. LIST VIEW (TABLE LAYOUT)
   ============================================================ */
.files_list_view {
    width: 100%;
    overflow-x: auto;
}

.files_list_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.files_list_table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid;
    cursor: pointer;
    user-select: none;
}

body.dark_mode .files_list_table th { border-color: #1e293b; }
body.light_mode .files_list_table th { border-color: #e2e8f0; }

.files_list_table td {
    padding: 12px 14px;
    border-bottom: 1px solid;
    vertical-align: middle;
}

body.dark_mode .files_list_table td {
    border-color: #1a243a;
    color: #cbd5e1;
}

body.light_mode .files_list_table td {
    border-color: #f1f5f9;
    color: #334155;
}

.files_list_row {
    cursor: pointer;
    transition: background 0.15s ease;
}

body.dark_mode .files_list_row:hover { background: #151d2f; }
body.dark_mode .files_list_row.selected { background: rgba(99, 102, 241, 0.2) !important; }

body.light_mode .files_list_row:hover { background: #f8fafc; }
body.light_mode .files_list_row.selected { background: #eef2ff !important; }

.list_name_cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.list_file_icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}


/* ============================================================
   6. RIGHT DETAILS PANEL (Matching Screenshot files2.jpg)
   ============================================================ */
.files_details_panel {
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.25s ease;
}

body.dark_mode .files_details_panel {
    background: #0f172a;
    border-color: #1e293b;
    color: #e2e8f0;
}

body.light_mode .files_details_panel {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

.files_details_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid;
}

body.dark_mode .files_details_header { border-color: #1e293b; }
body.light_mode .files_details_header { border-color: #e2e8f0; }

.files_details_title_wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}

.files_details_close_btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.files_details_close_btn:hover {
    color: #ef4444;
}

.files_details_body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Hero Thumbnail Preview */
.detail_preview_hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid;
}

body.dark_mode .detail_preview_hero { border-color: #1e293b; }
body.light_mode .detail_preview_hero { border-color: #e2e8f0; }

.detail_hero_thumb_container {
    width: 120px;
    height: 120px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
}

.detail_hero_pdf_badge {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.detail_hero_pdf_badge span {
    color: #ffffff;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.detail_hero_image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.detail_item_name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    word-break: break-all;
}

.detail_item_meta_sub {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 2x3 Actions Matrix */
.detail_actions_matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail_actions_matrix .actions_row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.detail_act_btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

body.dark_mode .detail_act_btn {
    background: #151d2f;
    border-color: #23314d;
    color: #cbd5e1;
}

body.dark_mode .detail_act_btn:hover {
    background: #1e293b;
    border-color: #6366f1;
    color: #ffffff;
}

body.light_mode .detail_act_btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body.light_mode .detail_act_btn:hover {
    background: #f1f5f9;
    border-color: #6366f1;
    color: #0f172a;
}

.detail_act_btn i {
    font-size: 16px;
}

.detail_act_btn.act_delete {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.detail_act_btn.act_delete:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* Properties List */
.detail_properties_section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12.5px;
    padding-bottom: 14px;
    border-bottom: 1px solid;
}

body.dark_mode .detail_properties_section { border-color: #1e293b; }
body.light_mode .detail_properties_section { border-color: #e2e8f0; }

.detail_prop_row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.prop_label {
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.prop_value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

/* Reactions Bar in Details Panel */
.detail_reactions_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.reactions_bar_title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.reactions_buttons_wrap {
    display: flex;
    gap: 6px;
}

.react_btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

body.dark_mode .react_btn {
    background: #151d2f;
    border-color: #23314d;
}

body.light_mode .react_btn {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.react_btn.react_like { color: #10b981; }
.react_btn.react_like.active {
    background: #059669;
    color: #ffffff;
    border-color: #34d399;
}

.react_btn.react_neutral { color: #f59e0b; }
.react_btn.react_neutral.active {
    background: #d97706;
    color: #ffffff;
    border-color: #fbbf24;
}

.react_btn.react_dislike { color: #ef4444; }
.react_btn.react_dislike.active {
    background: #dc2626;
    color: #ffffff;
    border-color: #f87171;
}

/* Comments Section in Details Panel */
.comments_section_header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.detail_comments_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.detail_comment_item {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.detail_comment_avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.detail_comment_bubble {
    flex: 1;
    border-radius: 10px;
    padding: 8px 10px;
    position: relative;
}

body.dark_mode .detail_comment_bubble { background: #151d2f; }
body.light_mode .detail_comment_bubble { background: #f1f5f9; }

.detail_comment_meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 3px;
    color: #64748b;
}

.detail_comment_author {
    font-weight: 600;
    color: inherit;
}

.detail_comment_text {
    word-break: break-word;
    line-height: 1.4;
}

.detail_comment_del_btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.detail_add_comment_box textarea {
    width: 100%;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    outline: none;
    resize: none;
    margin-bottom: 6px;
}

body.dark_mode .detail_add_comment_box textarea {
    background: #151d2f;
    border: 1px solid #23314d;
    color: #e2e8f0;
}

body.light_mode .detail_add_comment_box textarea {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.detail_comment_actions {
    display: flex;
    justify-content: flex-end;
}


/* ============================================================
   7. MODALS & POPUPS
   ============================================================ */
.files_modal_overlay.d-none {
    display: none !important;
}

.files_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 16px;
}

.files_modal_card {
    width: 100%;
    max-width: 480px;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.15) !important;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.files_modal_card.modal_card_sm {
    max-width: 420px;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

body.dark_mode .files_modal_card {
    background: #0b0f19 !important;
    border: 1px solid #1e293b !important;
    color: #f8fafc;
}

body.light_mode .files_modal_card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a;
}

.files_modal_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 16px 24px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body.dark_mode .files_modal_header { border-color: rgba(255, 255, 255, 0.06) !important; }
body.light_mode .files_modal_header { border-color: #e2e8f0 !important; }

.files_modal_title {
    font-size: 16px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff !important;
}

body.light_mode .files_modal_title {
    color: #0f172a !important;
}

.files_modal_close_btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.files_modal_close_btn:hover {
    color: #ffffff;
}

body.light_mode .files_modal_close_btn:hover {
    color: #0f172a;
}

.files_modal_body {
    padding: 22px 24px !important;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
}

.files_modal_body .form_group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 !important;
    width: 100% !important;
}

.files_modal_body .form_label {
    display: block !important;
    margin: 0 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    user-select: none;
}

body.light_mode .files_modal_body .form_label {
    color: #475569 !important;
}

/* ============================================================
   MODAL INPUTS & SELECTS (Matching Notes styling: notes_search_input & notes_sort_select)
   ============================================================ */

/* Select dropdowns matching notes_sort_select */
.files_modal_card select,
.files_modal_card .form_control.files_share_group_select,
.files_modal_card .form_control.files_share_perm_select {
    width: 100% !important;
    background: #111827 !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px !important;
    padding: 10px 38px 10px 14px !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    outline: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px !important;
    box-sizing: border-box !important;
    height: 44px !important;
    line-height: 22px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.files_modal_card select:focus,
.files_modal_card .form_control.files_share_group_select:focus,
.files_modal_card .form_control.files_share_perm_select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    background-color: #131b2e !important;
}

.files_modal_card select option,
.files_modal_card .form_control.files_share_group_select option,
.files_modal_card .form_control.files_share_perm_select option {
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 10px 12px !important;
}

body.light_mode .files_modal_card select,
body.light_mode .files_modal_card .form_control.files_share_group_select,
body.light_mode .files_modal_card .form_control.files_share_perm_select {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

body.light_mode .files_modal_card select option,
body.light_mode .files_modal_card .form_control.files_share_group_select option,
body.light_mode .files_modal_card .form_control.files_share_perm_select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Text inputs and single-row textareas matching notes_search_input */
.files_modal_card input[type="text"],
.files_modal_card textarea,
.files_modal_card .form_control.files_user_search_input,
.files_modal_card .form_control.files_share_message_input,
.files_modal_card .form_control.files_new_folder_name_input,
.files_modal_card .form_control.files_new_folder_desc_input,
.files_modal_card .form_control.files_rename_input,
.files_modal_card .form_control.files_desc_textarea {
    width: 100% !important;
    background: #111827 !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    outline: none !important;
    height: 44px !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.files_modal_card .form_control.files_user_search_input {
    padding-left: 42px !important;
}

.files_modal_card input[type="text"]::placeholder,
.files_modal_card textarea::placeholder,
.files_modal_card .form_control::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
    font-size: 13.5px !important;
}

.files_modal_card input[type="text"]:focus,
.files_modal_card textarea:focus,
.files_modal_card .form_control:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    background: #131b2e !important;
}

body.light_mode .files_modal_card input[type="text"],
body.light_mode .files_modal_card textarea,
body.light_mode .files_modal_card .form_control {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light_mode .files_modal_card input[type="text"]::placeholder,
body.light_mode .files_modal_card textarea::placeholder,
body.light_mode .files_modal_card .form_control::placeholder {
    color: #94a3b8 !important;
}

/* Modal Footer & Action Buttons */
.files_modal_footer {
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body.dark_mode .files_modal_footer {
    border-color: rgba(255, 255, 255, 0.06) !important;
    background: #0b0f19 !important;
}

body.light_mode .files_modal_footer {
    border-color: #e2e8f0 !important;
    background: #f8fafc !important;
}

.files_modal_footer .files_modal_cancel_btn {
    border-radius: 50rem !important;
    background: #172033 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 24px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.files_modal_footer .files_modal_cancel_btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.light_mode .files_modal_footer .files_modal_cancel_btn {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light_mode .files_modal_footer .files_modal_cancel_btn:hover {
    background: #cbd5e1 !important;
    color: #0f172a !important;
}

.files_modal_footer .files_do_share_btn,
.files_modal_footer .btn-primary {
    border-radius: 50rem !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 8px 26px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.65), 0 2px 10px rgba(79, 70, 229, 0.5) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.files_modal_footer .files_do_share_btn:hover,
.files_modal_footer .btn-primary:hover {
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.9), 0 4px 14px rgba(79, 70, 229, 0.6) !important;
    transform: translateY(-1px) !important;
}

/* Move Modal Destination Tree */
.files_move_tree_container {
    max-height: 280px;
    overflow-y: auto;
    border-radius: 10px;
    padding: 6px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.dark_mode .files_move_tree_container {
    background: #0b1120;
    border: 1px solid #1e293b;
}

body.light_mode .files_move_tree_container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.move_tree_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer !important;
    font-size: 13.5px;
    font-weight: 500;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.move_tree_item * {
    cursor: pointer !important;
    user-select: none !important;
    pointer-events: none;
}

body.dark_mode .move_tree_item {
    color: #cbd5e1;
}

body.dark_mode .move_tree_item:hover {
    background: #1e293b;
    color: #ffffff;
}

body.dark_mode .move_tree_item.selected {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
    font-weight: 600;
}

body.light_mode .move_tree_item {
    color: #334155;
}

body.light_mode .move_tree_item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.light_mode .move_tree_item.selected {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border-color: #6366f1 !important;
    font-weight: 600;
}

.move_tree_item i {
    font-size: 15px;
    flex-shrink: 0;
}

.move_tree_item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.move_item_check {
    margin-left: auto;
    font-size: 15px;
    color: #6366f1;
    display: none;
    font-weight: bold;
}

.move_tree_item.selected .move_item_check {
    display: inline-block;
}

/* Share Folder Specific Styles */
.files_share_folder_badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    box-sizing: border-box;
    width: 100%;
}

body.dark_mode .files_share_folder_badge {
    background: #111827 !important;
    border: 1px solid #1e293b !important;
    color: #ffffff !important;
}

body.light_mode .files_share_folder_badge {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

.files_share_folder_badge i {
    font-size: 19px !important;
    color: #3b82f6 !important;
}

.files_share_folder_badge .share_target_folder_name {
    color: #ffffff !important;
    font-weight: 600;
}

body.light_mode .files_share_folder_badge .share_target_folder_name {
    color: #0f172a !important;
}

.files_user_chips_container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.user_chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.user_chip_avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.user_chip_remove {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.files_user_predictive_search_wrap {
    position: relative;
    width: 100%;
}

.files_mention_icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #cbd5e1 !important;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

body.light_mode .files_mention_icon {
    color: #475569 !important;
}

.files_user_search_input {
    padding-left: 42px !important;
}

.files_predictive_results_dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    border-radius: 10px;
    overflow: hidden;
    z-index: 60;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark_mode .files_predictive_results_dropdown {
    background: #1e293b;
    border: 1px solid #334155;
}

body.light_mode .files_predictive_results_dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.files_predictive_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.files_predictive_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 13px;
}

body.dark_mode .files_predictive_item:hover { background: #334155; }
body.light_mode .files_predictive_item:hover { background: #f1f5f9; }

.predictive_user_avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.predictive_user_info {
    display: flex;
    flex-direction: column;
}

.predictive_user_name { font-weight: 600; }
.predictive_user_sub { font-size: 11px; color: #64748b; }

/* Color pickers for folder */
.files_folder_color_pickers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.folder_color_dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease;
}

.folder_color_dot:hover { transform: scale(1.15); }
.folder_color_dot.selected { border-color: #ffffff; box-shadow: 0 0 0 2px #6366f1; }

/* Lightbox Preview Modal */
.files_preview_lightbox_card {
    width: 90vw;
    max-width: 1000px;
    height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.dark_mode .files_preview_lightbox_card { background: #0b0f19; border: 1px solid #1e293b; }
body.light_mode .files_preview_lightbox_card { background: #ffffff; border: 1px solid #e2e8f0; }

.files_preview_topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid;
}

body.dark_mode .files_preview_topbar { border-color: #1e293b; }
body.light_mode .files_preview_topbar { border-color: #e2e8f0; }

.files_preview_file_title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
}

.files_preview_actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.files_preview_close_btn {
    background: transparent;
    border: none;
    font-size: 26px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.files_preview_viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}

.files_preview_img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.files_preview_video,
.files_preview_pdf_frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.files_preview_text {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 16px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    border-radius: 8px;
}

body.dark_mode .files_preview_text { background: #151d2f; color: #f1f5f9; }
body.light_mode .files_preview_text { background: #f8fafc; color: #0f172a; }

/* Empty state */
.files_empty_state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.files_empty_icon {
    font-size: 54px;
    color: #64748b;
    margin-bottom: 12px;
}

.files_empty_state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.files_empty_state .files_upload_btn {
    margin-top: 14px;
}

/* Floating Upload Tray */
.files_upload_tray {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    overflow: hidden;
}

body.dark_mode .files_upload_tray { background: #151d2f; border: 1px solid #23314d; color: #f8fafc; }
body.light_mode .files_upload_tray { background: #ffffff; border: 1px solid #e2e8f0; color: #0f172a; }

.upload_tray_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid;
    font-size: 13px;
    font-weight: 600;
}

body.dark_mode .upload_tray_header { border-color: #23314d; }
body.light_mode .upload_tray_header { border-color: #e2e8f0; }

.upload_tray_close {
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
}

.upload_tray_items {
    padding: 10px 14px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload_tray_item {
    font-size: 12px;
}

.upload_item_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    font-weight: 500;
}

.upload_item_progress_bar {
    height: 4px;
    border-radius: 2px;
    background: #334155;
    overflow: hidden;
}

.upload_item_progress_fill {
    height: 100%;
    background: #10b981;
    width: 0%;
    transition: width 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .files_details_panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        z-index: 40;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 770.98px) {
    .files_topbar {
        padding: 10px 12px;
        gap: 8px;
    }
    .files_topbar_left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .files_topbar_left::-webkit-scrollbar {
        display: none;
    }
    .files_topbar_right {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }
    .files_topbar_right .files_share_folder_btn {
        padding: 0 10px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .files_topbar_right .files_share_folder_btn span {
        display: none;
    }
    .files_sort_dropdown_wrap {
        flex: 1 1 0;
        min-width: 0;
    }
    .files_sort_select {
        width: 100%;
        min-width: 0;
        text-overflow: ellipsis;
        padding: 6px 8px;
        font-size: 12.5px;
    }
    .files_upload_btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 14px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .files_topbar_center {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 4px;
    }
    .files_cards_grid {
        grid-template-columns: 1fr;
    }
    .files_details_panel {
        width: 100%;
    }
}

@media (max-width: 340px) {
    .files_upload_btn span {
        display: none;
    }
}

/* ============================================================
   12. ANIMATED EMPTY TRASH BUTTON (Inspired by Joel Mone)
   ============================================================ */
.files_empty_trash_btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 45%, #dc2626 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 0 1px rgba(0, 0, 0, 0.8) !important;
    transition:
        padding 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-radius 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        gap 0.3s ease;
    overflow: visible;
    outline: none;
    user-select: none;
    perspective: 800px;
    z-index: 10;
    white-space: nowrap;
}

body.dark_mode .files_empty_trash_btn {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 45%, #dc2626 100%) !important;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

body.light_mode .files_empty_trash_btn {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 45%, #dc2626 100%) !important;
    box-shadow: 0 2px 12px rgba(225, 29, 72, 0.4);
}

.files_empty_trash_btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #fb7185 0%, #f43f5e 45%, #e11d48 100%) !important;
    box-shadow: 0 0 24px rgba(244, 63, 94, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.45) !important;
    transform: translateY(-1px);
}

.files_empty_trash_btn:active:not(.disabled) {
    transform: translateY(1px);
}

.files_empty_trash_btn.disabled,
.files_empty_trash_btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none !important;
    pointer-events: none;
    background: #475569 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Circular morph (post-letters eaten state) */
.files_empty_trash_btn.is-circle {
    padding: 0 !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    gap: 0 !important;
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.9), 0 0 50px rgba(244, 63, 94, 0.5) !important;
}

/* Pulsing effect while circle is active */
.files_empty_trash_btn.is-pulsing {
    animation: trashPulseZoom 1.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes trashPulseZoom {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* Luminous rotating rings */
.files_anim_ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 240deg,
        #fca5a5 290deg,
        #ffffff 330deg,
        #fca5a5 350deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}

.files_anim_ring.ring-2 {
    inset: -9px;
    background: conic-gradient(
        from 180deg,
        transparent 0deg,
        transparent 250deg,
        #ef4444 290deg,
        #ffffff 335deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
}

.files_empty_trash_btn.ring-active .files_anim_ring.ring-1 {
    opacity: 1;
    animation: trashSpinRing 1.4s linear infinite;
}

.files_empty_trash_btn.ring-active .files_anim_ring.ring-2 {
    opacity: 1;
    animation: trashSpinRing 1.9s linear infinite reverse;
}

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

/* Trash Icon Wrapper */
.files_anim_trash_wrapper {
    position: relative;
    width: 18px;
    height: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
    z-index: 3;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.files_empty_trash_btn.is-circle .files_anim_trash_wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* Trash Can Body */
.files_anim_trash_can,
body.dark_mode .files_anim_trash_can,
body.light_mode .files_anim_trash_can {
    width: 15px;
    height: 15px;
    border: 2px solid #ffffff !important;
    border-top: none !important;
    border-radius: 0 0 3px 3px;
    position: relative;
    background: transparent !important;
}

.files_anim_trash_can::before,
.files_anim_trash_can::after,
body.dark_mode .files_anim_trash_can::before,
body.dark_mode .files_anim_trash_can::after,
body.light_mode .files_anim_trash_can::before,
body.light_mode .files_anim_trash_can::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 1.5px;
    height: 8px;
    background: #ffffff !important;
    border-radius: 1px;
}
.files_anim_trash_can::before { left: 3px; }
.files_anim_trash_can::after  { right: 3px; }

/* Trash Lid */
.files_anim_trash_lid,
body.dark_mode .files_anim_trash_lid,
body.light_mode .files_anim_trash_lid {
    width: 18px;
    height: 3px;
    background: #ffffff !important;
    border-radius: 2px;
    position: absolute;
    top: 1px;
    transform-origin: left bottom;
    transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.files_anim_trash_lid::before,
body.dark_mode .files_anim_trash_lid::before,
body.light_mode .files_anim_trash_lid::before {
    content: '';
    position: absolute;
    top: -2.5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 2.5px;
    background: #ffffff !important;
    border-radius: 2px 2px 0 0;
}

/* Open Lid State */
.files_anim_trash_wrapper.lid-open .files_anim_trash_lid {
    transform: rotate(-75deg) translateY(-2px);
}

/* Impact Shake when letters land inside */
.files_anim_trash_wrapper.impact-shake {
    animation: trashImpactShake 0.15s ease-in-out;
}

@keyframes trashImpactShake {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(-1.5px, -1.5px); }
    50%      { transform: translate(1.5px, 1.5px); }
    75%      { transform: translate(-1px, 1px); }
}

/* Text Wrapper & Letters */
.files_anim_text_wrapper,
.files_empty_trash_btn .files_anim_text_wrapper,
body.dark_mode .files_empty_trash_btn .files_anim_text_wrapper,
body.light_mode .files_empty_trash_btn .files_anim_text_wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.files_empty_trash_btn.is-circle .files_anim_text_wrapper {
    opacity: 0;
    transform: scale(0.4);
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.files_anim_text_wrapper .letter,
.files_empty_trash_btn .files_anim_text_wrapper .letter,
body.dark_mode .files_empty_trash_btn .files_anim_text_wrapper .letter,
body.light_mode .files_empty_trash_btn .files_anim_text_wrapper .letter {
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19);
    z-index: 1;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 0 1px rgba(0, 0, 0, 0.8) !important;
}

.files_anim_text_wrapper .letter.flying {
    opacity: 0;
    transform: translate(calc(var(--fly-x, -60px)), calc(var(--fly-y, -20px))) scale(0.2) rotate(180deg);
}

/* ============================================================
   13. HEIC / HEIF THUMBNAIL DECODING & SPINNERS
   ============================================================ */
.file_card_heic_wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.heic_placeholder_inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.heic_fallback_icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.75;
}

.heic_convert_spinner {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.heic_convert_spinner i,
.spin-icon {
    display: inline-block;
    animation: heicSpin 1s linear infinite;
}

@keyframes heicSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
