/* Admin Bar - Mobile First */
.admin-bar {
    background: #23282d;
    color: #fff;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 50px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-bar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.admin-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.admin-bar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.admin-bar-logo:hover {
    opacity: 0.8;
}

.admin-bar-logo-svg {
    height: 40px;
    width: auto;
    display: block;
}

.admin-bar-logo-text {
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
}

/* Mobile Menu Toggle Button */
.admin-bar-menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 20px;
    transition: transform 0.3s ease;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-text {
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Hamburger to Cross Animation */
.admin-bar-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.admin-bar-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.admin-bar-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.admin-bar-menu-toggle.active .menu-text {
    opacity: 0;
}

/* Hide links on mobile by default */
.admin-bar-links {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: #23282d;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.admin-bar-links.active {
    display: flex;
    max-height: 400px;
}

.admin-bar-links a {
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.admin-bar-links a:hover {
    background: rgba(255,255,255,0.1);
}

.admin-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-bar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.85rem;
}

.admin-bar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Hide user info on mobile */
.admin-bar-user-info {
    display: none;
}

.admin-bar-username {
    font-weight: bold;
}

.admin-bar-role {
    font-size: 0.75rem;
    color: #b4b9be;
}

.admin-bar-logout {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    background: #dc3545;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: background 0.3s;
    white-space: nowrap;
}

.admin-bar-logout:hover {
    background: #c82333;
}

/* Adjust body when admin bar is present */
body.has-admin-bar {
    padding-top: 50px;
}

body.has-admin-bar header {
    margin-top: 0;
}

/* Tablet - 600px and up */
@media (min-width: 600px) {
    .admin-bar-container {
        padding: 0 15px;
    }
    
    .admin-bar-left {
        gap: 15px;
    }
    
    .admin-bar-logo {
        font-size: 1.05rem;
        gap: 10px;
    }
    
    .admin-bar-logo img {
        height: 30px;
    }
    
    .admin-bar-right {
        gap: 12px;
    }
    
    /* Show username on tablet */
    .admin-bar-user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .admin-bar-logout {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
}

/* Desktop - 768px and up */
@media (min-width: 768px) {
    .admin-bar-container {
        padding: 0 20px;
    }
    
    .admin-bar-left {
        gap: 20px;
    }
    
    .admin-bar-logo {
        font-size: 1.1rem;
    }
    
    /* Hide mobile menu toggle on desktop */
    .admin-bar-menu-toggle {
        display: none;
    }
    
    /* Show navigation links on desktop */
    .admin-bar-links {
        display: flex;
        position: static;
        flex-direction: row;
        gap: 12px;
        align-items: center;
        background: transparent;
        box-shadow: none;
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    
    .admin-bar-links a {
        padding: 6px 10px;
        border-bottom: none;
        border-radius: 3px;
        font-size: 0.85rem;
    }
    
    .admin-bar-links a:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .admin-bar-right {
        gap: 15px;
    }
    
    .admin-bar-user {
        gap: 10px;
        font-size: 0.9rem;
    }
    
    .admin-bar-logout {
        padding: 5px 15px;
    }
}

/* Large Desktop - 1024px and up */
@media (min-width: 1024px) {
    .admin-bar-links {
        gap: 15px;
    }
    
    .admin-bar-links a {
        font-size: 0.9rem;
        padding: 5px 12px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .admin-bar-logo,
    .admin-bar-logout {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-bar-user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .admin-bar-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}


.admin-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-bar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.85rem;
}

.admin-bar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Hide user info on mobile */
.admin-bar-user-info {
    display: none;
}

.admin-bar-username {
    font-weight: bold;
}

.admin-bar-role {
    font-size: 0.75rem;
    color: #b4b9be;
}

.admin-bar-logout {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    background: #dc3545;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: background 0.3s;
    white-space: nowrap;
}

.admin-bar-logout:hover {
    background: #c82333;
}

/* Adjust body when admin bar is present */
body.has-admin-bar {
    padding-top: 50px;
}

body.has-admin-bar header {
    margin-top: 0;
}

/* Tablet - 600px and up */
@media (min-width: 600px) {
    .admin-bar-container {
        padding: 0 15px;
    }
    
    .admin-bar-left {
        gap: 15px;
    }
    
    .admin-bar-logo {
        font-size: 1.05rem;
        gap: 10px;
    }
    
    .admin-bar-logo img {
        height: 30px;
    }
    
    .admin-bar-right {
        gap: 12px;
    }
    
    /* Show username on tablet */
    .admin-bar-user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .admin-bar-logout {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
}

/* Desktop - 768px and up */
@media (min-width: 768px) {
    .admin-bar-container {
        padding: 0 20px;
    }
    
    .admin-bar-left {
        gap: 20px;
    }
    
    .admin-bar-logo {
        font-size: 1.1rem;
    }
    
    /* Show navigation links on desktop */
    .admin-bar-links {
        display: flex;
        gap: 12px;
        align-items: center;
    }
    
    .admin-bar-links a {
        color: #fff;
        text-decoration: none;
        padding: 6px 10px;
        border-radius: 3px;
        transition: background 0.3s;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .admin-bar-links a:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .admin-bar-right {
        gap: 15px;
    }
    
    .admin-bar-user {
        gap: 10px;
        font-size: 0.9rem;
    }
    
    .admin-bar-logout {
        padding: 5px 15px;
    }
}

/* Large Desktop - 1024px and up */
@media (min-width: 1024px) {
    .admin-bar-links {
        gap: 15px;
    }
    
    .admin-bar-links a {
        font-size: 0.9rem;
        padding: 5px 12px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .admin-bar-logo,
    .admin-bar-links a,
    .admin-bar-logout {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-bar-user-avatar {
        width: 36px;
        height: 36px;
    }
}
