/* Base Footer Styles */
.admin-footer {
    display: flex;
    background-color: var(--secondary-color, #111);
    color: var(--text-color, #fff);
    padding: 10px 0;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 50px; /* Prevent collapsing */
    z-index: 1000;
    box-shadow: 0 -2px 5px var(--shadow-color, rgba(0, 0, 0, 0.2));
}

.admin-footer a {
    color: var(--primary-color, #357ab7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.admin-footer a:hover {
    color: var(--accent-hover, #ffcc00);
}

/* Footer Sections */
.admin-footer .left, .admin-footer .center, .admin-footer .right {
    flex: 1;
}

.admin-footer .left {
    text-align: left;
    padding-left: 20px;
}

.admin-footer .center {
    text-align: center;
}

.admin-footer .right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    gap: 10px;
}

/* Right Section Icons */
.admin-footer .right a,
.admin-footer .right button,
.admin-footer .right img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.3s ease;
    position: relative; /* Ensure icons stay in flow */
}

.admin-footer .right a:hover,
.admin-footer .right button:hover,
.admin-footer .right img:hover {
    transform: scale(1.1);
}

.admin-footer .right img {
    object-fit: contain;
}

/* Specific Icon Styles */
#browser-toggle:hover {
    color: var(--browser-hover, #357ab7);
}

#theme-toggle {
    position: relative !important; /* Override any absolute positioning */
}

#theme-toggle:hover {
    color: var(--theme-hover, #ffcc00);
}

#logout-button {
    color: var(--logout-color, #fff);
}

#logout-button:hover {
    color: var(--logout-hover, #ff4d4d);
}

.gemini-chat-button {
    width: 40px;
    height: 40px;
    padding: 2px;
}

/* Mobile Sidebar */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color, #fff);
    cursor: pointer;
}

.mobile-sidebar-icons {
    display: none;
    position: fixed;
    right: 0;
    bottom: 4rem;
    flex-direction: column;
    background: var(--background, #222);
    padding: 0.5rem;
    border-radius: 1rem 0 0 1rem;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

body.sidebar-open .mobile-sidebar-icons {
    display: flex;
}

/* Mobile-Specific Styles */
@media (max-width: 768px) {
    .admin-footer {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 10px;
    }

    .admin-footer .left,
    .admin-footer .center,
    .footer-links,
    .separator {
        display: none;
    }

    .admin-footer .right {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 0 10px;
        justify-content: space-around;
        gap: 0;
    }

    .admin-footer .right a,
    .admin-footer .right button {
        flex: 1;
        font-size: 1.8rem;
        padding: 10px 0;
    }

    #logout-button {
        font-size: 2rem;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .desktop-footer-icons {
        display: none !important;
    }

    main {
        padding-bottom: 60px; /* Prevent overlap with fixed footer */
    }
}

/* Desktop-Specific Styles */
@media (min-width: 769px) {
    .desktop-footer-icons {
        display: inline-block !important;
    }

    .sidebar-toggle,
    .mobile-sidebar-icons,
    body.sidebar-open .mobile-sidebar-icons {
        display: none !important;
    }
}