/*
 * File: slideout-menu.css
 * Description: Styles for the slide-out menu and stabilized header layout.
 */

/* 1. Auth Links Container (STABILIZED STACKED LAYOUT) */
.dtmm-top-bar-account {
    display: flex;
    flex-direction: column; 
    align-items: flex-end;  
    gap: 8px; /* Reduced gap for better vertical density */
    padding-right: 15px; /* Standardized gutter */
    max-width: 100%;
    overflow: hidden; /* Prevents container breaking */
}

/* 2. The Panel (Hidden by default, slides from LEFT) */
.dtmm-slideout-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 80%;
    height: 100vh;
    background-color: #343a40;
    z-index: 100000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.dtmm-slideout-panel.is-open {
    transform: translateX(0);
}

/* 3. The Overlay */
.dtmm-slideout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.dtmm-slideout-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* 4. Body Lock */
body.dtmm-panel-is-open {
    overflow: hidden;
}

/* 5. Panel Content */
.dtmm-slideout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 60px;
    border-bottom: 1px solid #495057;
    flex-shrink: 0;
}

.dtmm-slideout-header h3 {
    color: #f8f9fa;
    font-size: 1.2rem;
    margin: 0;
}

.dtmm-slideout-close {
    background: none;
    border: none;
    color: #f8f9fa;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
}

/* Top-of-panel actions row — Trainer Site (when applicable) + Logout.
   Placed above the nav so Logout is always visible on mobile without
   scrolling past the menu items, and so the auto-injected Trainer
   Site link reads as a primary action.
   Scoped to #dtmm-slideout-panel (the panel root) for high enough
   specificity to win against theme + wp-admin default link colors
   (which were rendering the actions as default blue underlined
   hyperlinks before this rule set landed). */
#dtmm-slideout-panel .dtmm-slideout-actions {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid #495057;
    background: #2c3338;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-slideout-action,
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-slideout-action:visited {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: background .15s, color .15s;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
#dtmm-slideout-panel .dtmm-slideout-actions .dtmm-slideout-action .dtsm-icon {
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
#dtmm-slideout-panel .dtmm-slideout-actions .dtmm-slideout-action .dtsm-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
#dtmm-slideout-panel .dtmm-slideout-actions .dtmm-slideout-action .dtsm-title {
    color: inherit;
    font-family: inherit;
}

#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-trainer,
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-trainer:visited {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-trainer:hover,
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-trainer:focus {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1e40af;
    text-decoration: none;
}

#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-logout,
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-logout:visited {
    background: #4b5563;
    color: #f3f4f6;
    border-color: #374151;
}
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-logout:hover,
#dtmm-slideout-panel .dtmm-slideout-actions a.dtmm-action-logout:focus {
    background: #6b7280;
    color: #ffffff;
    border-color: #4b5563;
    text-decoration: none;
}

.dtmm-slideout-nav {
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dtmm-slideout-nav ul {
    list-style: none;
    margin: 0;
    padding: 1rem 0;
}

.dtmm-slideout-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.5rem;
    color: #f8f9fa;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.dtmm-slideout-nav li a:hover {
    background-color: #495057;
}

.dtmm-slideout-nav .dtsm-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.dtmm-slideout-nav .dtsm-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.dtmm-slideout-nav .dtsm-title {
    flex-grow: 1;
}

.dtmm-slideout-nav ul.dtmm-slideout-logout {
   display: block; 
   margin-top: auto; 
   padding-top: 1rem;
   border-top: 1px solid #495057;
}

/*
 * ===================================================================
 * Header Auth & Social Icon Styling (STACKED & STABILIZED)
 * ===================================================================
 */

/* 1. Social Icons */
.dt-social-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    gap: 12px;
    width: 100%; 
}

.dt-social-icons .social-icon .dtsm-icon svg {
    width: 24px;
    height: 24px;
    fill: #555;
    transition: all 0.2s ease-in-out;
}

.dt-social-icons .social-icon:hover .dtsm-icon svg { 
    transform: scale(1.1);
}

/* 2. Auth Links (Mail, Account, Logout, Cart) - HORIZONTAL LAYOUT */
.dt-auth-links {
    display: flex;
    align-items: center; 
    justify-content: flex-end; 
    gap: 12px; /* Standardized spacing to prevent overflow */
    width: auto;
    white-space: nowrap; /* CRITICAL: Prevents text wrapping that breaks borders */
}

.dt-auth-link {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 6px; 
    text-decoration: none;
    font-size: 0.9rem; 
    font-weight: 500;
    color: #555;
    transition: color 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.dt-auth-link:hover {
    color: #a987c2; 
}

/* Icon Standardization */
.dt-auth-link .dtsm-icon,
.dt-notification-trigger .mail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px; 
    width: 22px;  
}

.dt-auth-link .dtsm-icon svg,
.dt-notification-trigger .mail-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Cart Anchor */
.dt-cart-link {
    margin-left: 4px;
}

/* Bolder outline icons */
.dt-cart-link svg, .dt-login-link svg {
    stroke-width: 2; 
}

/*
 * ===================================================================
 * Notification Elements
 * ===================================================================
 */

.dt-nav-unread-badge {
    background-color: #a987c2; 
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    font-family: sans-serif;
}

/* Slideout Badge (Inline Header Text) */
.dt-nav-unread-badge.slideout-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 12px;
    background-color: #a987c2;
    color: #fff;
    border-radius: 99px;
    text-decoration: none;
}

/* Mail Trigger (Top Bar) */
.dt-notification-trigger {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: 2px; /* Buffer before Account */
    color: #555;
    transition: color 0.2s ease;
}

.dt-notification-trigger:hover {
    color: #a987c2;
}

.dt-notification-trigger .notif-count {
    background-color: #a987c2;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 16px;
    text-align: center;
}

/* Left-edge "MENU" pull tab.
   A persistent, discoverable opener for the account slideout — the top-bar
   account icon isn't obvious to everyone. Vertically centred on the left edge
   with upright vertical text. Slides out of view while the panel is open. */
.dtmm-slideout-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990; /* below overlay (99999) + panel (100000) */
    background-color: #6a4c89; /* brand purple */
    color: #fff;
    border: none;
    margin: 0;
    padding: 18px 9px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
}
.dtmm-slideout-tab:hover {
    background-color: #573c73;
}
.dtmm-slideout-tab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Slide the tab away with the panel so it doesn't sit on top of it. */
body.dtmm-panel-is-open .dtmm-slideout-tab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-110%);
}

@media print {
    .dtmm-slideout-tab { display: none; }
}