/**
 * YOOAdmin - Custom admin bar (frontend)
 *
 * @package YOOAdmin
 */

/* Body spacing for admin bar */
body.yooadmin-has-bar {
    padding-top: 50px !important;
}

/* Main container */
.yooadmin-frontend-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--yp-header-bg) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Inner container */
.yooadmin-bar-inner {
    max-width: 100%;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left and Right sections */
.yooadmin-bar-left,
.yooadmin-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

/* Logo */
.yooadmin-bar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.yooadmin-bar-logo img {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.yooadmin-bar-logo:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Bar items */
.yooadmin-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    color: var(--yp-text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    white-space: nowrap;
}

.yooadmin-bar-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--yp-primary);
}

.yooadmin-bar-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

/* Badge */
.yooadmin-bar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    line-height: 1;
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Avatar */
.yooadmin-bar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.yooadmin-bar-profile {
    padding: 4px;
}

/* Dropdown */
.yooadmin-bar-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.yooadmin-bar-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--yp-header-bg) !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100000;
}

.yooadmin-bar-dropdown-right {
    left: auto;
    right: 0;
}

.yooadmin-bar-dropdown.active .yooadmin-bar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.yooadmin-bar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--yp-text-primary) !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.yooadmin-bar-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--yp-primary) !important;
}

.yooadmin-bar-dropdown-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* User info in dropdown */
.yooadmin-bar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 4px;
}

.yooadmin-bar-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.yooadmin-bar-user-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yooadmin-bar-user-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--yp-text-primary);
}

.yooadmin-bar-user-info small {
    font-size: 12px;
    color: var(--yp-text-primary);
    opacity: 0.7;
}

/* Divider */
.yooadmin-bar-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Label (hide on mobile) */
.yooadmin-bar-label {
    display: none;
}

@media (min-width: 768px) {
    .yooadmin-bar-label {
        display: inline;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .yooadmin-bar-inner {
        padding: 0 12px;
    }

    .yooadmin-bar-left,
    .yooadmin-bar-right {
        gap: 4px;
    }

    .yooadmin-bar-item {
        padding: 0 8px;
    }

    .yooadmin-bar-logo {
        margin-right: 4px;
    }
}

/* Dark mode is controlled by YOOAdmin brand colors */

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom nodes from plugins (Elementor, Beaver Builder, etc.) */
.yooadmin-bar-custom-node {
    font-weight: 600;
}

.yooadmin-bar-custom-node:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Support for Elementor edit button */
.yooadmin-bar-custom-node.elementor-edit-link {
    background: var(--yp-primary);
    color: #ffffff !important;
}

.yooadmin-bar-custom-node.elementor-edit-link:hover {
    opacity: 0.9;
}

/* Support for Beaver Builder edit button */
.yooadmin-bar-custom-node.fl-builder-edit-link {
    background: var(--yp-primary);
    color: #ffffff !important;
}

.yooadmin-bar-custom-node.fl-builder-edit-link:hover {
    opacity: 0.9;
}

/* Focus styles for accessibility */
.yooadmin-bar-item:focus,
.yooadmin-bar-dropdown-item:focus {
    outline: 2px solid var(--yp-primary);
    outline-offset: 2px;
}
