/* WP Docs Manager — Frontend Styles */

/* ── Container ───────────────────────────────────────────────────────────── */
.wpdm-file-manager {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    font-size: 14px;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.wpdm-fe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}
.wpdm-fe-toolbar-left,
.wpdm-fe-toolbar-right { display: flex; align-items: center; gap: 8px; }
.wpdm-fe-search {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    min-width: 180px;
}
.wpdm-fe-search:focus { outline: none; border-color: #0073aa; box-shadow: 0 0 0 2px rgba(0,115,170,.15); }
.wpdm-fe-view-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all .15s;
}
.wpdm-fe-view-btn.active,
.wpdm-fe-view-btn:hover { background: #0073aa; color: #fff; border-color: #0073aa; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.wpdm-fe-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    flex-wrap: wrap;
}
.wpdm-fe-crumb {
    color: #0073aa;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
}
.wpdm-fe-crumb:hover { background: #e8f4fa; }
.wpdm-fe-crumb-sep { color: #aaa; }
.wpdm-fe-crumb:last-child { color: #333; font-weight: 600; cursor: default; }
.wpdm-fe-crumb:last-child:hover { background: none; }

/* ── File browser ─────────────────────────────────────────────────────────── */
.wpdm-fe-browser { min-height: 200px; position: relative; }

/* ── Upload button ────────────────────────────────────────────────────────── */
.wpdm-fe-btn-upload {
    padding: 6px 14px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s;
}
.wpdm-fe-btn-upload:hover { background: #005d8a; }

/* ── List view ───────────────────────────────────────────────────────────── */
.wpdm-fe-list-header {
    display: grid;
    grid-template-columns: 36px 1fr 100px 130px 110px;
    padding: 8px 14px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.wpdm-fe-item {
    display: grid;
    grid-template-columns: 36px 1fr 100px 130px 110px;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .1s;
}
.wpdm-fe-item:hover { background: #f5f9fd; }
.wpdm-fe-item:last-child { border-bottom: none; }

/* ── Grid view ───────────────────────────────────────────────────────────── */
.wpdm-fe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    padding: 16px;
}
.wpdm-fe-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.wpdm-fe-grid-item:hover { border-color: #0073aa; background: #f0f7fd; }
.wpdm-fe-grid-item .wpdm-fe-item-name { font-size: 12px; word-break: break-word; -webkit-line-clamp: 2; }

/* ── Icons ───────────────────────────────────────────────────────────────── */
.wpdm-fe-icon { font-size: 30px; line-height: 1; }
.wpdm-fe-icon-sm .wpdm-fe-icon { font-size: 20px; }
.wpdm-fe-icon-folder::before { content: '📁'; }
.wpdm-fe-icon-pdf::before    { content: '📄'; }
.wpdm-fe-icon-word::before   { content: '📝'; }
.wpdm-fe-icon-excel::before  { content: '📊'; }
.wpdm-fe-icon-image::before  { content: '🖼️'; }
.wpdm-fe-icon-video::before  { content: '🎬'; }
.wpdm-fe-icon-audio::before  { content: '🎵'; }
.wpdm-fe-icon-zip::before    { content: '🗜️'; }
.wpdm-fe-icon-text::before   { content: '📃'; }
.wpdm-fe-icon-file::before   { content: '📎'; }

/* ── Download button ─────────────────────────────────────────────────────── */
.wpdm-fe-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 12px;
    transition: background .15s;
    white-space: nowrap;
}
.wpdm-fe-dl-btn:hover { background: #005d8a; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.wpdm-fe-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    border-top: 1px solid #eee;
}
.wpdm-fe-page-btn {
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all .1s;
}
.wpdm-fe-page-btn:hover,
.wpdm-fe-page-btn.active { background: #0073aa; color: #fff; border-color: #0073aa; }

/* ── Upload area / modal ──────────────────────────────────────────────────── */
.wpdm-fe-upload-area {
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.wpdm-fe-upload-area form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wpdm-fe-upload-area input[type="file"] { flex: 1; min-width: 0; }
.wpdm-fe-notice {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin: 6px 14px;
}
.wpdm-fe-notice-success { background: #edfaed; color: #2d7a2d; border: 1px solid #b3e5b3; }
.wpdm-fe-notice-error   { background: #faeaea; color: #a00;    border: 1px solid #e5b3b3; }

/* ── Preview ──────────────────────────────────────────────────────────────── */
.wpdm-fe-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,.75);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wpdm-fe-preview-inner {
    background: #fff;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    padding: 12px;
}
.wpdm-fe-preview-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    cursor: pointer;
    background: none;
    border: none;
    color: #333;
    line-height: 1;
}
.wpdm-fe-preview-inner img { max-width: 80vw; max-height: 80vh; display: block; }
.wpdm-fe-preview-inner iframe { width: 80vw; height: 80vh; border: none; }

/* ── Favorite, Comment, Preview buttons (unified) ───────────────────────── */
.wpdm-fe-favorite-btn,
.wpdm-fe-comment-btn,
.wpdm-fe-preview-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 4px;
    padding: 3px 7px;
    cursor: pointer;
    margin-right: 4px;
    font-size: 14px;
    color: #0073aa;
    transition: all .15s;
}
.wpdm-fe-favorite-btn:hover,
.wpdm-fe-comment-btn:hover,
.wpdm-fe-preview-btn:hover {
    background: #e8f4fa;
    border-color: #0073aa;
}
.wpdm-fe-favorite-btn.active {
    background: #fff3cd;
    border-color: #d6a700;
    color: #7a5200;
}

/* ── Comments ────────────────────────────────────────────────────────────── */
.wpdm-fe-comments-list { list-style: none; padding: 0; margin: 0 0 16px; }
.wpdm-fe-comments-list li { border-bottom: 1px solid #e5e7eb; padding: 10px 0; }
.wpdm-fe-comments-list small { display: block; color: #64748b; margin-top: 4px; }
.wpdm-fe-comment-input { width: 100%; margin-bottom: 8px; }
.wpdm-fe-comments-modal .wpdm-fe-preview-inner { max-width: 500px; }

/* ── Grid actions ────────────────────────────────────────────────────────── */
.wpdm-fe-grid-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.wpdm-fe-loading {
    text-align: center;
    padding: 32px;
    color: #888;
    font-style: italic;
}
.wpdm-fe-empty {
    text-align: center;
    padding: 32px;
    color: #aaa;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.wpdm-fe-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}
.wpdm-fe-badge-expired { background: #fce; color: #900; }

/* ── Dark Mode (frontend) ──────────────────────────────────────────────── */
.wpdm-dark-mode .wpdm-file-manager {
    background: #1e1e1e;
    border-color: #444;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-toolbar {
    background: #2d2d2d;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-fe-search {
    background: #333;
    border-color: #555;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-search:focus {
    border-color: #4a9eff;
}
.wpdm-dark-mode .wpdm-fe-view-btn {
    border-color: #555;
    color: #aaa;
}
.wpdm-dark-mode .wpdm-fe-view-btn.active,
.wpdm-dark-mode .wpdm-fe-view-btn:hover {
    background: #4a9eff;
    color: #fff;
}
.wpdm-dark-mode .wpdm-fe-breadcrumb {
    background: #252525;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-fe-crumb {
    color: #4a9eff;
}
.wpdm-dark-mode .wpdm-fe-crumb:last-child {
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-list-header {
    background: #2d2d2d;
    color: #aaa;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-fe-item {
    border-color: #333;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-item:hover {
    background: #2a2a2a;
}
.wpdm-dark-mode .wpdm-fe-grid-item:hover {
    background: #2a2a2a;
    border-color: #666;
}
.wpdm-dark-mode .wpdm-fe-dl-btn {
    background: #4a9eff;
}
.wpdm-dark-mode .wpdm-fe-dl-btn:hover {
    background: #2d7ad6;
}
.wpdm-dark-mode .wpdm-fe-upload-area {
    background: #2d2d2d;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-fe-notice-success {
    background: #1e3a1e;
    color: #8bc34a;
    border-color: #2d5a2d;
}
.wpdm-dark-mode .wpdm-fe-notice-error {
    background: #3a1e1e;
    color: #ff6b6b;
    border-color: #5a2d2d;
}
.wpdm-dark-mode .wpdm-fe-preview-inner {
    background: #2d2d2d;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-page-btn {
    background: #333;
    border-color: #555;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-page-btn.active,
.wpdm-dark-mode .wpdm-fe-page-btn:hover {
    background: #4a9eff;
    color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .wpdm-fe-list-header,
    .wpdm-fe-item { grid-template-columns: 36px 1fr 100px; }
    .wpdm-fe-col-size, .wpdm-fe-col-date { display: none; }
    .wpdm-fe-toolbar { flex-direction: column; align-items: flex-start; }
    .wpdm-fe-search { min-width: 0; width: 100%; }
}

/* ── OTP modal ──────────────────────────────────────────────────────── */
.wpdm-fe-otp-modal .wpdm-fe-preview-inner { padding: 20px 24px; }
.wpdm-fe-otp-input:focus { outline: none; border-color: #0073aa; box-shadow: 0 0 0 2px rgba(0,115,170,.15); }
.wpdm-fe-otp-msg:empty { display: none; }
.wpdm-fe-otp-modal .button { padding: 6px 14px; }

/* ── Bulk ZIP bar (Partea E) ─────────────────────────────────────────── */
.wpdm-fe-bulk-bar { font-size: 13px; }
.wpdm-fe-bulk-bar .button { font-size: 12px; }
.wpdm-fe-bulk-check { margin-right: 6px; vertical-align: middle; cursor: pointer; }

/* Dark mode — bulk bar */
.wpdm-dark-mode .wpdm-fe-bulk-bar {
    background: #2d3a45 !important;
    border-color: #444 !important;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-bulk-bar .button {
    background: #333;
    border-color: #555;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-bulk-bar .button:hover {
    background: #4a9eff;
    color: #fff;
    border-color: #4a9eff;
}

/* ══════════════════════════════════════════════════════════════════
   User Dashboard ([wpdocsman_dashboard])
   ══════════════════════════════════════════════════════════════════ */
.wpdm-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.wpdm-dash-header {
    padding: 24px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.wpdm-dash-welcome h2 {
    margin: 0 0 4px;
    font-size: 22px;
    color: #1d2327;
    font-weight: 600;
    line-height: 1.2;
}
.wpdm-dash-subtitle {
    margin: 0;
    color: #646970;
    font-size: 13px;
}
.wpdm-dash-stats {
    display: flex;
    gap: 24px;
}
.wpdm-dash-stat { text-align: center; min-width: 72px; }
.wpdm-dash-stat-num {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.wpdm-dash-stat-label {
    display: block;
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 4px;
    font-weight: 500;
}

.wpdm-dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}
.wpdm-dash-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #646970;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .15s;
    font-family: inherit;
}
.wpdm-dash-tab:hover {
    color: #2271b1;
    background: #f0f6fc;
}
.wpdm-dash-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    background: #fff;
    font-weight: 600;
}

.wpdm-dash-content {
    min-height: 200px;
    padding: 16px 20px;
}
.wpdm-dash-loading {
    padding: 40px;
    text-align: center;
    color: #646970;
    font-style: italic;
    font-size: 13px;
}
.wpdm-dash-empty {
    padding: 40px;
    text-align: center;
    color: #a7aaad;
    font-size: 14px;
}
.wpdm-dash-error {
    padding: 16px 20px;
    text-align: center;
    color: #d63638;
    background: #fef0f0;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    margin: 0;
    font-size: 13px;
}

.wpdm-dash-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wpdm-dash-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    gap: 12px;
}
.wpdm-dash-item:last-child { border-bottom: none; }
.wpdm-dash-item-title {
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.wpdm-dash-item-meta {
    color: #646970;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wpdm-dash-login-notice {
    padding: 32px;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin: 20px 0;
}
.wpdm-dash-login-notice p {
    margin: 0 0 12px;
    color: #646970;
    font-size: 14px;
}
.wpdm-dash-login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
}
.wpdm-dash-login-btn:hover { background: #135e96; }

/* Dark mode */
.wpdm-dark-mode .wpdm-dashboard {
    background: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}
.wpdm-dark-mode .wpdm-dash-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    border-color: #444;
}
.wpdm-dark-mode .wpdm-dash-welcome h2 { color: #e0e0e0; }
.wpdm-dark-mode .wpdm-dash-subtitle { color: #aaa; }
.wpdm-dark-mode .wpdm-dash-stat-num { color: #4a9eff; }
.wpdm-dark-mode .wpdm-dash-stat-label { color: #aaa; }
.wpdm-dark-mode .wpdm-dash-tabs {
    background: #252525;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-dash-tab { color: #aaa; }
.wpdm-dark-mode .wpdm-dash-tab:hover {
    color: #4a9eff;
    background: #2d2d2d;
}
.wpdm-dark-mode .wpdm-dash-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
    background: #1e1e1e;
}
.wpdm-dark-mode .wpdm-dash-item { border-color: #333; }
.wpdm-dark-mode .wpdm-dash-item-title { color: #e0e0e0; }
.wpdm-dark-mode .wpdm-dash-item-meta { color: #aaa; }
.wpdm-dark-mode .wpdm-dash-loading,
.wpdm-dark-mode .wpdm-dash-empty { color: #888; }
.wpdm-dark-mode .wpdm-dash-login-notice {
    background: #1e1e1e;
    border-color: #444;
    color: #e0e0e0;
}

/* Responsive */
@media (max-width: 600px) {
    .wpdm-dash-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    .wpdm-dash-stats {
        gap: 16px;
        width: 100%;
        justify-content: space-between;
    }
    .wpdm-dash-tabs {
        overflow-x: auto;
    }
    .wpdm-dash-tab {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
    }
}


/* ═══════════════════════════════════════════════════════════════════════
   MODERN FRONTEND UI v2 — 2026 Redesign
   Îmbunătățiri: layout corect, acțiuni orizontale, design premium
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Container ────────────────────────────────────────────────────── */
.wpdm-file-manager {
    border-radius: 12px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

/* ── Toolbar ──────────────────────────────────────────────────────── */
.wpdm-fe-toolbar {
    padding: 14px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}
.wpdm-fe-search {
    padding: 8px 12px 8px 36px;
    border-radius: 8px;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="%236b7280" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') no-repeat 10px center;
    border: 1px solid #d1d5db;
    font-size: 13px;
    transition: all 0.15s;
}
.wpdm-fe-search:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
    outline: none;
}
.wpdm-fe-view-btn {
    border-radius: 6px;
    padding: 6px 10px;
    border-color: #d1d5db;
    transition: all 0.15s;
}

/* ── LIST VIEW — layout corect ────────────────────────────────────── */
.wpdm-fe-list-header {
    grid-template-columns: 28px 36px 1fr 90px 120px minmax(220px, auto);
    padding: 11px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.6px;
    align-items: center;
}

.wpdm-fe-item {
    grid-template-columns: 28px 36px 1fr 90px 120px minmax(220px, auto);
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    background: #fff;
    transition: background 0.15s ease;
    cursor: pointer;
}
.wpdm-fe-item:hover {
    background: #f9fafb;
}
.wpdm-fe-item:last-child {
    border-bottom: none;
}

.wpdm-fe-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    cursor: pointer;
    accent-color: #2271b1;
    margin: 0;
    transition: all 0.15s;
}
.wpdm-fe-item input[type="checkbox"]:hover {
    border-color: #2271b1;
}

.wpdm-fe-item .wpdm-fe-item-name {
    font-size: 13.5px;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpdm-fe-icon {
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── ACTIONS COLUMN — orizontal, spațios ──────────────────────────── */
.wpdm-fe-item-actions,
.wpdm-fe-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Buttons moderni, uniformi */
.wpdm-fe-actions .wpdm-fe-dl-btn,
.wpdm-fe-actions .wpdm-fe-favorite-btn,
.wpdm-fe-actions .wpdm-fe-comment-btn,
.wpdm-fe-actions .wpdm-fe-preview-btn,
.wpdm-fe-actions .wpdm-fe-otp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.15s ease;
    margin: 0;
    box-shadow: none;
    text-decoration: none;
}

/* Secondary buttons (Pin, Comment) */
.wpdm-fe-actions .wpdm-fe-favorite-btn,
.wpdm-fe-actions .wpdm-fe-comment-btn,
.wpdm-fe-actions .wpdm-fe-preview-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0 10px;
}
.wpdm-fe-actions .wpdm-fe-favorite-btn:hover,
.wpdm-fe-actions .wpdm-fe-comment-btn:hover,
.wpdm-fe-actions .wpdm-fe-preview-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}
.wpdm-fe-actions .wpdm-fe-favorite-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* Primary button (Download) */
.wpdm-fe-actions .wpdm-fe-dl-btn {
    background: #2271b1;
    border: 1px solid #2271b1;
    color: #fff !important;
    padding: 0 14px;
    font-weight: 600;
}
.wpdm-fe-actions .wpdm-fe-dl-btn:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
}

/* ── Breadcrumb ────────────────────────────────────────────────────── */
.wpdm-fe-breadcrumb {
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.wpdm-fe-crumb {
    padding: 3px 8px;
    border-radius: 4px;
    color: #2271b1;
    font-weight: 500;
}
.wpdm-fe-crumb:hover {
    background: #eff6ff;
}

/* ── Grid view ─────────────────────────────────────────────────────── */
.wpdm-fe-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
}
.wpdm-fe-grid-item {
    padding: 18px 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}
.wpdm-fe-grid-item:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 16px rgba(34, 113, 177, 0.12);
    transform: translateY(-3px);
    background: #fff;
}
.wpdm-fe-grid-item .wpdm-fe-item-name {
    font-size: 12.5px;
    font-weight: 500;
    margin: 10px 0 6px;
}

.wpdm-fe-grid-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
}
.wpdm-fe-grid-actions .wpdm-fe-dl-btn,
.wpdm-fe-grid-actions .wpdm-fe-favorite-btn,
.wpdm-fe-grid-actions .wpdm-fe-preview-btn {
    height: 26px;
    font-size: 11px;
    padding: 0 8px;
}

/* ── Pagination modernizat ─────────────────────────────────────────── */
.wpdm-fe-pagination {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    gap: 6px;
}
.wpdm-fe-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.wpdm-fe-page-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}
.wpdm-fe-page-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* ── Loading / Empty ───────────────────────────────────────────────── */
.wpdm-fe-loading,
.wpdm-fe-empty {
    padding: 48px 20px;
    font-size: 14px;
    color: #9ca3af;
    font-style: normal;
}
.wpdm-fe-loading::before {
    content: '⏳ ';
    font-size: 20px;
    display: block;
    margin-bottom: 12px;
}

/* ── File type icons — mai mari și colorate ───────────────────────── */
.wpdm-fe-icon-folder::before { content: '📁'; filter: saturate(1.2); }
.wpdm-fe-icon-pdf::before    { content: '📕'; }
.wpdm-fe-icon-word::before   { content: '📘'; }
.wpdm-fe-icon-excel::before  { content: '📗'; }
.wpdm-fe-icon-image::before  { content: '🖼️'; }
.wpdm-fe-icon-video::before  { content: '🎬'; }
.wpdm-fe-icon-audio::before  { content: '🎵'; }
.wpdm-fe-icon-zip::before    { content: '🗜️'; }
.wpdm-fe-icon-text::before   { content: '📄'; }
.wpdm-fe-icon-file::before   { content: '📎'; }

/* ── Dark mode — adaptat ───────────────────────────────────────────── */
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-favorite-btn,
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-comment-btn,
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-preview-btn,
.wpdm-dark-mode .wpdm-fe-actions .wpdm-fe-favorite-btn,
.wpdm-dark-mode .wpdm-fe-actions .wpdm-fe-comment-btn,
.wpdm-dark-mode .wpdm-fe-actions .wpdm-fe-preview-btn {
    background: #2d2d2d;
    border-color: #444;
    color: #ccc;
}
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-favorite-btn:hover,
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-comment-btn:hover,
.wpdm-dark-mode .wpdm-fe-item-actions .wpdm-fe-preview-btn:hover {
    background: #3a3a3a;
    border-color: #666;
    color: #fff;
}
.wpdm-dark-mode .wpdm-fe-item .wpdm-fe-item-name {
    color: #e0e0e0;
}
.wpdm-dark-mode .wpdm-fe-item {
    background: #1e1e1e;
    border-color: #333;
}
.wpdm-dark-mode .wpdm-fe-item:hover {
    background: #2a2a2a;
}
.wpdm-dark-mode .wpdm-fe-grid-item {
    background: #2d2d2d;
    border-color: #444;
}
.wpdm-dark-mode .wpdm-fe-grid-item:hover {
    background: #333;
    border-color: #4a9eff;
}

/* ── Responsive: pe mobil, acțiunile devin iconițe ─────────────────── */
@media (max-width: 782px) {
    .wpdm-fe-list-header,
    .wpdm-fe-item {
        grid-template-columns: 28px 36px 1fr auto;
    }
    .wpdm-fe-item > .wpdm-fe-col-size,
    .wpdm-fe-item > .wpdm-fe-col-date {
        display: none;
    }
    .wpdm-fe-actions .wpdm-fe-favorite-btn,
    .wpdm-fe-actions .wpdm-fe-comment-btn,
    .wpdm-fe-actions .wpdm-fe-preview-btn {
        padding: 0 8px;
        font-size: 11px;
    }
    .wpdm-fe-actions .wpdm-fe-dl-btn {
        padding: 0 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .wpdm-fe-actions .wpdm-fe-favorite-btn span:not(:only-child),
    .wpdm-fe-actions .wpdm-fe-comment-btn span:not(:only-child),
    .wpdm-fe-actions .wpdm-fe-preview-btn span:not(:only-child) {
        display: none;
    }
    .wpdm-fe-toolbar {
        padding: 10px 14px;
    }
    .wpdm-fe-item {
        padding: 10px 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DYNAMIC FIELDS — flex layout, hide non-configured columns
   ═══════════════════════════════════════════════════════════════ */

/* Switch from grid to flex */
.wpdm-fe-list-header,
.wpdm-fe-item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
}

/* Icon+checkbox column */
.wpdm-fe-col-check {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 60px;
}

/* Name — flexible */
.wpdm-fe-item .wpdm-fe-col-name {
    flex: 1 1 auto;
    min-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 500;
    color: #111827;
}

/* Fixed-width columns */
.wpdm-fe-col-size    { flex: 0 0 80px; }
.wpdm-fe-col-date    { flex: 0 0 110px; }
.wpdm-fe-col-type    { flex: 0 0 100px; }
.wpdm-fe-col-classification { flex: 0 0 130px; }
.wpdm-fe-col-expire  { flex: 0 0 100px; }
.wpdm-fe-col-downloads { flex: 0 0 70px; }
.wpdm-fe-col-version { flex: 0 0 60px; }
.wpdm-fe-col-cf,
.wpdm-fe-col-meta    { flex: 0 0 140px; }

/* Actions */
.wpdm-fe-col-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Header cells */
.wpdm-fe-list-header span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Value cells */
.wpdm-fe-item > span {
    font-size: 13px;
    color: #374151;
}

/* ── DATA-FIELDS based hiding ────────────────────────────────── */
[data-fields] .wpdm-fe-col-size,
[data-fields] .wpdm-fe-col-date,
[data-fields] .wpdm-fe-col-type,
[data-fields] .wpdm-fe-col-classification,
[data-fields] .wpdm-fe-col-expire,
[data-fields] .wpdm-fe-col-downloads,
[data-fields] .wpdm-fe-col-version { display: none; }

[data-fields~="size"] .wpdm-fe-col-size { display: block !important; }
[data-fields~="modified"] .wpdm-fe-col-date { display: block !important; }
[data-fields~="type"] .wpdm-fe-col-type { display: block !important; }
[data-fields~="classification"] .wpdm-fe-col-classification { display: block !important; }
[data-fields~="expire_date"] .wpdm-fe-col-expire { display: block !important; }
[data-fields~="downloads"] .wpdm-fe-col-downloads { display: block !important; }
[data-fields~="version"] .wpdm-fe-col-version { display: block !important; }

/* For cf_* and meta_* — always show if they exist in DOM (data-fields has them) */
[data-fields*="cf_"] .wpdm-fe-col-cf,
[data-fields*="meta_"] .wpdm-fe-col-meta { display: block !important; }

/* Dark mode */
.wpdm-dark-mode .wpdm-fe-col-name { color: #e0e0e0; }
.wpdm-dark-mode .wpdm-fe-item > span { color: #ccc; }

/* Mobile */
@media (max-width: 782px) {
    .wpdm-fe-col-size,
    .wpdm-fe-col-date,
    .wpdm-fe-col-type,
    .wpdm-fe-col-classification,
    .wpdm-fe-col-expire,
    .wpdm-fe-col-downloads,
    .wpdm-fe-col-version { display: none !important; }
}

/* Sortable fields (metabox) */
.wpdm-sortable-item .wpdm-drag-handle:hover { color: #2271b1 !important; }
.wpdm-sortable-placeholder {
    background: #e5f0fb !important;
    border: 2px dashed #2271b1 !important;
    visibility: visible !important;
    height: 32px !important;
    border-radius: 3px;
    margin: 2px 0;
}
.ui-sortable-helper { opacity: 0.8; }

/* ═══════════════════════════════════════════════════════════════
   ALIGNMENT FIX — grid cu template dinamic (var --wpdm-cols)
   ═══════════════════════════════════════════════════════════════ */

.wpdm-fe-list-header,
.wpdm-fe-item {
    display: grid !important;
    grid-template-columns: var(--wpdm-cols, 44px minmax(180px, 1fr) 90px 110px minmax(220px, auto)) !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 10px 20px !important;
}

.wpdm-fe-list-header {
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.wpdm-fe-list-header > span {
    font-size: 11px !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpdm-fe-item {
    border-bottom: 1px solid #f3f4f6 !important;
    background: #fff;
}

.wpdm-fe-item:hover {
    background: #f9fafb !important;
}

.wpdm-fe-item > span,
.wpdm-fe-list-header > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpdm-fe-col-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.wpdm-fe-col-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* Neutralizează regulile vechi data-fields */
[data-fields] .wpdm-fe-col-size,
[data-fields] .wpdm-fe-col-date,
[data-fields] .wpdm-fe-col-type,
[data-fields] .wpdm-fe-col-classification,
[data-fields] .wpdm-fe-col-expire,
[data-fields] .wpdm-fe-col-downloads,
[data-fields] .wpdm-fe-col-version {
    display: revert !important;
}

@media (max-width: 782px) {
    .wpdm-fe-list-header,
    .wpdm-fe-item {
        grid-template-columns: 44px minmax(120px, 1fr) auto !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    .wpdm-fe-list-header > span:not(.wpdm-fe-col-check):not(.wpdm-fe-col-name):not(.wpdm-fe-col-actions),
    .wpdm-fe-item > span:not(.wpdm-fe-col-check):not(.wpdm-fe-col-name):not(.wpdm-fe-col-actions) {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FIX 3 — aliniere header + data (identice 100%)
   ═══════════════════════════════════════════════════════════════ */

/* Header cells — centrate pe vertical, aliniate la stânga ca data */
.wpdm-fe-list-header > span {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Data cells — vertical centrate */
.wpdm-fe-item > span {
    align-self: center;
}

/* Acțiuni aliniate la dreapta */
.wpdm-fe-col-actions {
    justify-content: flex-end;
}

/* Coloana check+icon — fără gap dublu */
.wpdm-fe-col-check {
    justify-content: flex-start;
}

/* Icon mai compact pe list view */
.wpdm-fe-item .wpdm-fe-col-check .wpdm-fe-icon {
    font-size: 20px;
    line-height: 1;
}

/* Asigură-te că border-ul orizontal e subtil (nu-liniile verticale) */
.wpdm-fe-item {
    border-left: none !important;
    border-right: none !important;
}
