/**
 * Favorite dashboard layouts quick-switcher styling.
 * Mirrors Apollo device UI (js/modules/favorite-layouts/favorite-layouts.css).
 */

.fav-layouts-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.fav-layouts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fav-layouts-btn:hover,
.fav-layouts-btn.is-open {
    background: rgba(var(--primary-rgb), 0.18);
    border-color: rgba(var(--primary-rgb), 0.4);
    color: #fff;
}

.fav-layouts-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.fav-layouts-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    width: 300px;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #1d1b24;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.fav-layouts-popup[hidden] {
    display: none;
}

.fav-layouts-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fav-layouts-popup-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.fav-layouts-manage-toggle {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fav-layouts-manage-toggle:hover {
    background: rgba(var(--primary-rgb), 0.18);
    border-color: rgba(var(--primary-rgb), 0.4);
    color: #fff;
}

.fav-layouts-popup-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
}

.fav-layouts-empty {
    margin: 4px 6px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

.fav-layouts-switch-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fav-layouts-switch-item:hover {
    background: rgba(var(--primary-rgb), 0.18);
    color: #fff;
}

.fav-layouts-switch-item.is-active {
    border-color: rgba(var(--primary-rgb), 0.55);
    background: rgba(var(--primary-rgb), 0.22);
    color: #fff;
}

.fav-layouts-manage-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fav-layouts-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.15s ease;
}

.fav-layouts-star svg {
    width: 16px;
    height: 16px;
}

.fav-layouts-star:hover {
    color: rgba(255, 215, 0, 0.8);
}

.fav-layouts-star.is-favorite {
    color: #ffce3a;
}

.fav-layouts-manage-name {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.fav-layouts-manage-name:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.fav-layouts-manage-name.is-active {
    border-color: rgba(var(--primary-rgb), 0.5);
    color: #fff;
}

.fav-layouts-section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 8px 6px 2px;
}
.fav-layouts-section:first-child { padding-top: 2px; }

.fav-layouts-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.fav-layouts-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.fav-layouts-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.15s ease;
}
.fav-layouts-action svg { width: 15px; height: 15px; }
.fav-layouts-action:hover {
    background: rgba(var(--primary-rgb), 0.18);
    color: #fff;
}
.fav-layouts-action-delete:hover {
    background: rgba(239, 68, 68, 0.14);
    color: var(--danger-color);
}

/* Fleet dashboard header: fav button + active layout name */

.fw-view-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.fw-view-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fw-view-layout-name {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fw-view-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
