/* ====================================
   FAVORITE - sidebar star button + dashboard tiles
   ==================================== */

/* ── Buton steluta in sidebar ─────────────────────────────── */
#sidebar li.sidebar-leaf-li {
    position: relative;
}

.sidebar-fav-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: #adb5bd;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#sidebar li.sidebar-leaf-li:hover .sidebar-fav-btn,
.sidebar-fav-btn.active,
.sidebar-fav-btn:focus {
    opacity: 1;
}

.sidebar-fav-btn:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.sidebar-fav-btn.active {
    color: #f59e0b;
}

.sidebar-fav-btn.active:hover {
    color: #d97706;
}

/* Lasam loc pentru steluta in linkul din sidebar (sa nu se suprapuna textul) */
#sidebar li.sidebar-leaf-li > a {
    padding-right: 36px !important;
}

/* ── Sectiunea Favorite pe dashboard ──────────────────────── */
.dashboard-favorites {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Varianta compacta cand e sus pe pagina - bara orizontala */
.dashboard-favorites-top {
    padding: 10px 16px;
    border-left: 4px solid #f59e0b;
}

.favorites-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.favorites-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    white-space: nowrap;
    flex-shrink: 0;
}

.favorites-title i {
    color: #f59e0b;
    font-size: 16px;
}

.favorites-tiles {
    flex: 1;
    min-width: 0;
}

.favorites-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Tile compact in bara de sus */
.dashboard-favorites-top .favorite-tile {
    padding: 6px 12px 6px 8px;
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
    gap: 8px;
    border-width: 1px;
}

.dashboard-favorites-top .favorite-tile .action-icon {
    width: 26px;
    height: 26px;
    font-size: 12px;
    border-radius: 6px;
}

.dashboard-favorites-top .favorite-tile .action-label {
    font-size: 13px;
    font-weight: 500;
}

.dashboard-favorites-top .favorite-tile:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.dashboard-favorites-top .favorite-remove {
    position: static;
    margin-left: 4px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    opacity: 0;
}

.dashboard-favorites-top .favorite-tile:hover .favorite-remove {
    opacity: 0.7;
}

.dashboard-favorites-top .favorite-tile:hover .favorite-remove:hover {
    opacity: 1;
}

/* Empty state inline */
.dashboard-favorites-top .favorites-empty {
    padding: 0;
    text-align: left;
    color: #6c757d;
    font-size: 13px;
    flex: 1;
}

.dashboard-favorites-top .favorites-empty i {
    font-size: 14px;
    color: #f59e0b;
    margin: 0 2px;
}

.dashboard-favorites-top .favorites-empty p {
    margin: 0;
    font-size: 13px;
}

.dashboard-favorites .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-favorites .section-title i.fa-star {
    color: #f59e0b;
}

.favorite-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    width: 100%;
    position: relative;
    cursor: grab;
    user-select: none;
}

.favorite-tile:active {
    cursor: grabbing;
}

/* Placeholder vizibil in timpul drag-ului */
.favorite-tile-placeholder {
    visibility: visible !important;
    background: rgba(245, 158, 11, 0.08);
    border: 2px dashed #f59e0b;
    border-radius: 8px;
}

/* Cand jQuery UI muta tile-ul, dezactivam transform pentru a evita "saritul" */
.ui-sortable-helper {
    transform: none !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25) !important;
}

.favorite-tile:hover {
    border-color: #f59e0b;
    background: #fffaf0;
    color: #212529;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.favorite-tile .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #fff7e6;
    color: #f59e0b;
    flex-shrink: 0;
}

.favorite-tile:hover .action-icon {
    background: #f59e0b;
    color: #fff;
}

.favorite-tile .action-text {
    flex: 1;
    min-width: 0;
}

.favorite-tile .action-label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #adb5bd;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-tile:hover .favorite-remove {
    opacity: 1;
}

.favorite-remove:hover {
    background: #dc2626;
    color: #fff;
}

.favorites-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6c757d;
}

.favorites-empty i.fa-star,
.favorites-empty i.far {
    font-size: 28px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.favorites-empty p {
    font-size: 14px;
    margin: 0;
}

.favorites-empty p i {
    color: #f59e0b;
    font-size: inherit;
    margin: 0 2px;
}

/* ── Dark mode ────────────────────────────────────────────── */
html.dark-mode .dashboard-favorites,
[data-bs-theme="dark"] .dashboard-favorites {
    background: linear-gradient(135deg, #1a1f2e 0%, #242b3d 100%);
    border-color: #2d3548;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark-mode .dashboard-favorites .section-title,
[data-bs-theme="dark"] .dashboard-favorites .section-title {
    color: #f0f2f5;
}

html.dark-mode .favorite-tile,
[data-bs-theme="dark"] .favorite-tile {
    background: linear-gradient(135deg, #242b3d 0%, #1e2535 100%);
    border-color: #2d3548;
    color: #f0f2f5;
}

html.dark-mode .favorite-tile:hover,
[data-bs-theme="dark"] .favorite-tile:hover {
    background: linear-gradient(135deg, #2a3447 0%, #1e2738 100%);
    border-color: #f59e0b;
    color: #f0f2f5;
}

html.dark-mode .favorite-tile .action-icon,
[data-bs-theme="dark"] .favorite-tile .action-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

html.dark-mode .favorites-empty,
[data-bs-theme="dark"] .favorites-empty {
    color: #8b92a7;
}

html.dark-mode .sidebar-fav-btn,
[data-bs-theme="dark"] .sidebar-fav-btn {
    color: #6c7488;
}

html.dark-mode .sidebar-fav-btn:hover,
[data-bs-theme="dark"] .sidebar-fav-btn:hover {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

html.dark-mode .sidebar-fav-btn.active,
[data-bs-theme="dark"] .sidebar-fav-btn.active {
    color: #fbbf24;
}
