/**
 * Shared UI Styles
 *
 * Shared between Webapp and API for consistent styling across systems
 * Contains: Navigation, Sidebar, Account Profile, Icons, and other shared components
 *
 * WARNING: This file is imported by multiple systems - changes affect both!
 */

/* Admin Bar Adjustment */
body.admin-bar .mm_side_navigation {
    top: 32px;
    height: calc(100vh - 32px - 1rem);
}

/* Main Navigation Container */
.mm_side_navigation {
    position: fixed;
    left: 0;
    right: 0;
    width: 250px;
    height: calc(100vh - 1rem);
    margin: .5rem;
    padding: 0;
    top: 0;
    background: #fff;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Navigation Logo */
.mm_side_navigation .nav-logo {
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.mm_side_navigation .nav-logo img {
    max-width: 90%;
    margin-left: 5%;
    display: block;
}

.mm_side_navigation .wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
}

/* Navigation Content */
.side_nav_content {
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 20px;
}

.side_nav_content.no_margin {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0 !important;
}

/* Navigation Items */
.side_nav_content li {
    width: 100%;
    list-style: none;
    margin-left: 0;
    margin-bottom: 5px;
    border-radius: 8px;
}

.side_nav_content li:hover,
.side_nav_content li:active,
.side_nav_content li:focus {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

ul.side_nav_content {
    padding-left: 0;
    margin-top: 20px;
}

/* Navigation Links */
.side_nav_content a {
    display: inline-block;
    width: 100%;
    color: #1E293B;
    padding: 10px 10px;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    text-decoration: none;
}

.side_nav_content li:hover a {
    color: white;
}

.nav-tab {
    background-size: 200% 100%;
    background-position: right bottom;
    transition: all .3s ease;
}

/* Active & Hover States */
.side_nav_content a.nav-tab.nav-tab-active,
a.nav-tab:hover,
a.nav-tab:focus {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    color: #fff;
    border-radius: 8px;
}

/* Account Balance */
.side_nav_content .account_balance {
    padding: 20px;
}

/* Headers in Sidebar */
.side_nav_content h3,
.side_nav_content h2,
.side_nav_content h1 {
    color: #fff;
}

/* Account Profile Section */
.account-profile-section {
    margin-top: auto;
    padding-top: 5px;
    border-top: 1px solid #e0e0e0;
}

.account-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.account-profile-link:hover {
    background-color: #f5f5f5;
    border-radius: 6px;
}

.account-profile-link:hover .account-name {
    color: #07528f;
}

.account-profile-link img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-email {
    font-size: 11px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Icons */
.group_icon {
    margin-right: 10px;
    vertical-align: middle;
}

.group_icon.white {
    color: #fff;
}

.group_icon.bigger {
    font-size: 1.3em;
    margin-top: -5px;
    margin-right: 20px;
}

/* Processing Indicator */
.mm_side_navigation #currently-processing {
    padding: 0px 5px 2px;
    border-radius: 15px;
    border: 1px solid #b29832;
    background: #ddc03b;
    color: #222;
    font-weight: 700;
    margin-left: 7px;
    margin-top: -3px;
}

.mm_side_navigation #currently-processing.done {
    border: 1px solid #2da53a;
    background-color: rgb(33, 130, 33);
    color: #fff;
}

.mm_side_navigation #currently-processing-spinner {
    height: 15px;
    width: 15px;
}

/* Dashicons */
.mm_side_navigation .dashicons {
    font-size: 16px !important;
    padding-top: 5px;
}

/* Hide site header logo when app navigation is shown */
header .site-logo {
    display: none;
}

/* Mobile Navigation Toggle */
#mobile-nav {
    display: none !important;
    margin-left: 10px;
    border-radius: 50px;
    height: 50px;
    width: 50px;
    padding-left: 12px !important;
    margin-bottom: 20px;
    margin-top: 0;
    line-height: 22px !important;
}

#close-mobile-nav {
    display: none !important;
    border-color: #fff;
    color: #fff;
    margin: 5px;
    float: right;
    font-size: 14px;
    padding: 5px;
}

/* Mobile Responsive */
@media only screen and (max-width: 768px) {
    /* Hide main site navigation on mobile */
    .main-navigation {
        display: none !important;
    }

    /* Position mobile nav button */
    #wcd_content #mobile-nav {
        position: absolute;
        top: 30px;
        right: 20px;
    }
}

@media only screen and (max-width: 1024px) {
    #mobile-nav {
        display: block !important;
    }

    #close-mobile-nav {
        display: block !important;
    }

    .mm_side_navigation {
        position: absolute;
        z-index: 1000;
        top: 0;
        width: 300px;
        padding-top: 0;
        height: initial;
        left: -300px;
    }
}

/* Tablet and Mobile */
@media only screen and (max-width: 800px) {
    .mm_side_navigation {
        position: absolute;
        z-index: 1000;
        top: 0;
        width: 300px;
        padding-top: 0;
        height: initial;
        left: -300px;
    }
}