/* ============================================================
   ph_manager - Design system + panneau utilisateur connecte
   ============================================================
   Refonte "moderne neutre" : white space, ombres douces,
   coins arrondis legers, typo systeme lisible, transitions
   subtiles.

   Les variables CSS ci-dessous sont reutilisees par
   connector.css et front.css : ce fichier est toujours charge
   par hookDisplayHeader, il sert donc de base au design system.

   Pour adapter aux couleurs de la marque, surcharge la variable
   --phm-accent dans un custom CSS (ex : --phm-accent: #7c3aed).
   ============================================================ */

:root {
    /* Surfaces & arriere-plans */
    --phm-bg:           #ffffff;
    --phm-surface:      #ffffff;
    --phm-surface-alt:  #f9fafb;
    --phm-surface-hover:#f3f4f6;

    /* Bordures */
    --phm-border:       #e5e7eb;
    --phm-border-hover: #d1d5db;
    --phm-border-focus: #6366f1;

    /* Texte */
    --phm-text:         #111827;
    --phm-text-muted:   #6b7280;
    --phm-text-subtle:  #9ca3af;
    --phm-text-on-accent:#ffffff;

    /* Accent (surchargable par la marque) */
    --phm-accent:        #6366f1;
    --phm-accent-hover:  #4f46e5;
    --phm-accent-soft:   #eef2ff;

    /* Statuts */
    --phm-danger:        #ef4444;
    --phm-danger-soft:   #fef2f2;
    --phm-success:       #10b981;
    --phm-success-soft:  #ecfdf5;

    /* Overlay modal */
    --phm-overlay:       rgba(15, 23, 42, 0.55);

    /* Radius */
    --phm-radius-xs:   4px;
    --phm-radius-sm:   6px;
    --phm-radius-md:  10px;
    --phm-radius-lg:  16px;
    --phm-radius-full: 9999px;

    /* Ombres - tres subtiles, "soft shadows" */
    --phm-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --phm-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08),
                     0 1px 2px rgba(15, 23, 42, 0.04);
    --phm-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07),
                     0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --phm-shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.10),
                     0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --phm-shadow-xl: 0 20px 40px -10px rgba(15, 23, 42, 0.15),
                     0 8px 16px -4px rgba(15, 23, 42, 0.06);

    /* Transitions */
    --phm-transition-fast: 120ms ease;
    --phm-transition:      180ms ease;

    /* Echelle d'espacement (8px grid) */
    --phm-space-1:  4px;
    --phm-space-2:  8px;
    --phm-space-3: 12px;
    --phm-space-4: 16px;
    --phm-space-5: 20px;
    --phm-space-6: 24px;
    --phm-space-8: 32px;
}

/* ============================================================
   Police Protomolecule conservee (heritage du theme)
   ============================================================ */
@font-face {
    font-family: "protoMollecule";
    src: url(../font/Protomolecule-Regular.eot);
    src: url(../font/Protomolecule-Regular.woff)  format("woff"),
         url(../font/Protomolecule-Regular.woff2) format("woff2"),
         url(../font/Protomolecule-Regular.svg)   format("svg");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ============================================================
   Reset utile pour les composants du plugin
   ============================================================ */
.popup_container *,
#profile_menu *,
#totUserInfo *,
#acb-banner * {
    box-sizing: border-box;
}

/* ============================================================
   Header user / your_account
   ============================================================ */
#header_user .both          { min-height: 0; clear: both; }
#header_user.totUserInfo    { display: flex; align-items: center; }
#header_user a span         { padding-left: var(--phm-space-2); }

li#your_account {
    position: relative;
    min-width: 280px;
}

/* ============================================================
   Notifications dans le header
   ============================================================ */
#header_notification li {
    display: flex;
    align-items: center;
    padding-bottom: var(--phm-space-2);
}

#header_notification li img.thumb_icon {
    width: 40px;
    height: 40px;
    border-radius: var(--phm-radius-full);
    object-fit: cover;
}

.notification,
.notification.active {
    background: url(../../../../../img/notification.png) no-repeat;
    background-size: 22px;
    background-position-y: 14px;
    padding: 0 var(--phm-space-5);
    height: 50px;
    transition: filter var(--phm-transition);
}

.notification.active {
    background-image: url(../../../../../img/notification-active.png);
}

.notification:hover { filter: brightness(0.92); }

.minimenu_update_count_bubble {
    position: absolute;
    display: none;
    height: 18px;
    min-width: 18px;
    padding: 0 5px;
    margin: -4px 0 0 -8px;
    background: var(--phm-danger);
    color: #fff;
    border-radius: var(--phm-radius-full);
    text-align: center;
    line-height: 18px;
    font-size: 10px;
    font-weight: 600;
    font-style: normal;
    box-shadow: var(--phm-shadow-sm);
}

.notification.active .minimenu_update_count_bubble {
    display: inline-block;
}

/* ============================================================
   Pulldown panel (notifications deroulees)
   ============================================================ */
.pulldown_contents {
    position: absolute;
    top: 56px;
    width: 480px;
    max-width: 92vw;
    padding: var(--phm-space-3);
    background: var(--phm-surface);
    border: 1px solid var(--phm-border);
    border-radius: var(--phm-radius-lg);
    box-shadow: var(--phm-shadow-xl);
    overflow: hidden;
    z-index: 99;
    display: none;
}

.notification_item_general {
    line-height: 1.5;
    padding: var(--phm-space-2) var(--phm-space-3);
    margin: 0;
    border-radius: var(--phm-radius-sm);
    transition: background var(--phm-transition);
}

.notification_item_general:hover {
    background: var(--phm-surface-hover);
}

/* ============================================================
   Acces backend (badge admin)
   ============================================================ */
span.admin-access {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 var(--phm-space-4) 0 var(--phm-space-8);
    background: url(../img/accesbackend.png) no-repeat left center;
    background-size: 22px 22px;
    border-radius: var(--phm-radius-md);
    color: var(--phm-text);
    font-weight: 500;
    transition: background-color var(--phm-transition), color var(--phm-transition);
}

span.admin-access:hover {
    background-color: var(--phm-accent-soft);
    color: var(--phm-accent);
}

/* ============================================================
   Panneau utilisateur connecte (sous menu client)
   ============================================================ */
#totUserInfo {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5000;
    width: 320px;
    background: var(--phm-surface);
    border: 1px solid var(--phm-border);
    border-radius: var(--phm-radius-lg);
    box-shadow: var(--phm-shadow-xl);
    line-height: normal;
    display: none;
    overflow: hidden;
}

#totUserInfo form {
    display: block;
    padding: var(--phm-space-5);
}

#totUserInfo form div         { min-height: 21px; }
#totUserInfo form > div > p   { color: var(--phm-text); margin: 0 0 var(--phm-space-2); }

#totUserInfo form div:first-child p {
    text-align: left;
    font-size: 0.95rem;
    margin-bottom: var(--phm-space-2);
    color: var(--phm-text-muted);
}

#totUserInfo form .totLeft {
    float: left;
    width: 140px;
    padding-right: var(--phm-space-1);
}

#totUserInfo form .totRight {
    float: left;
    width: calc(100% - 140px);
    text-align: center;
}

#totUserInfo form div:last-child p { margin: var(--phm-space-2) 0; }

#totUserInfo form input {
    width: 100%;
    padding: 10px var(--phm-space-3);
    background: var(--phm-surface-alt);
    color: var(--phm-text);
    border: 1px solid var(--phm-border);
    border-radius: var(--phm-radius-sm);
    font-size: 0.95rem;
    transition: border-color var(--phm-transition), background var(--phm-transition);
}

#totUserInfo form input:focus {
    outline: none;
    background: var(--phm-surface);
    border-color: var(--phm-border-focus);
    box-shadow: 0 0 0 3px var(--phm-accent-soft);
}

#totUserInfo form input#SubmitLogin {
    background: var(--phm-accent);
    color: var(--phm-text-on-accent);
    border-color: var(--phm-accent);
    font-weight: 600;
    cursor: pointer;
}

#totUserInfo form input#SubmitLogin:hover {
    background: var(--phm-accent-hover);
    border-color: var(--phm-accent-hover);
}

.totConnect {
    padding: var(--phm-space-5);
    margin-top: 0;
}

.totConnect .button_form a {
    cursor: pointer;
    color: var(--phm-text-on-accent);
}

#totUserInfo .newAccount {
    padding: var(--phm-space-4) var(--phm-space-5) var(--phm-space-5);
    text-align: center;
    border-top: 1px solid var(--phm-border);
    background: var(--phm-surface-alt);
}

#totUserInfo .newAccount p {
    margin: 0 0 var(--phm-space-3);
    color: var(--phm-text-muted);
    font-size: 0.9rem;
}

#totUserInfo .newAccount a {
    display: inline-block;
    padding: 10px var(--phm-space-5);
    background: var(--phm-surface);
    color: var(--phm-text);
    border: 1px solid var(--phm-border);
    border-radius: var(--phm-radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--phm-transition);
}

#totUserInfo .newAccount a:hover {
    border-color: var(--phm-accent);
    color: var(--phm-accent);
    background: var(--phm-accent-soft);
}

#header_user #your_account #totUserInfo .newAccount a {
    font-weight: 500;
}

#header_user #totUserInfo .logout {
    text-align: center;
    color: var(--phm-text-muted);
    font-size: 0.9rem;
}

#header_user #your_account #totUserInfo ul li .icon {
    display: none;
}

#totUserInfo > div > ul > li.mailalerts > a > i {
    display: none;
}

/* Boutons du sous-menu client (deja base sur les variables du theme,
   on garde la compatibilite descendante avec --links-color) */
#header_user .totConnect ul li a,
#header_nav  .totConnect ul.bullet li a,
#totUserInfo .button_form {
    display: block;
    padding: 10px var(--phm-space-5);
    margin-bottom: var(--phm-space-1);
    background-color: var(--links-color, var(--phm-accent));
    color: var(--links-color-contrast, var(--phm-text-on-accent));
    border-radius: var(--corner-radius, var(--phm-radius-sm));
    text-decoration: none;
    transition: all var(--phm-transition);
}

#header_user .totConnect ul li a:hover,
#header_nav  .totConnect ul.bullet li a:hover,
#totUserInfo .button_form:hover {
    background-color: var(--links-hover-color, var(--phm-accent-hover));
    color: var(--links-color-hover-contrast, var(--phm-text-on-accent));
    transform: translateY(-1px);
    box-shadow: var(--phm-shadow-sm);
}

/* ============================================================
   Shopping cart icone dans header_user
   ============================================================ */
#header_user #shopping_cart a {
    display: inline-flex;
    align-items: center;
    padding: var(--phm-space-1) 0;
    line-height: 1.4;
    text-decoration: none;
}

#header_user #shopping_cart a:before {
    content: "\f07a";
    font-family: FontAwesome;
    font-size: 1.25rem;
    color: var(--phm-text);
    padding-right: var(--phm-space-2);
}

/* ============================================================
   Avatar (image ronde)
   ============================================================ */
#your_account img.thumb_icon {
    border-radius: var(--phm-radius-full);
}

/* ============================================================
   Lien mot de passe perdu
   ============================================================ */
a.lostPwd {
    display: block;
    padding: var(--phm-space-3);
    margin-top: var(--phm-space-1);
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--phm-text-muted);
    text-decoration: none;
    transition: color var(--phm-transition);
}

a.lostPwd:hover {
    color: var(--phm-accent);
}

#header_user #your_account a span.login {
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}

/* ============================================================
   Bandeau maintenance pour l'admin
   ============================================================ */
#maintenanceAdminAccess {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    z-index: 99999;
    padding: 0 var(--phm-space-6);
    line-height: 44px;
    color: #fff;
    background: linear-gradient(135deg, #1e293b, #334155);
    font-size: 0.9rem;
    box-shadow: var(--phm-shadow-md);
}

#maintenanceAdminAccess a {
    color: #fff;
    text-decoration: underline;
}

#maintenanceAdminAccess .admin-access {
    height: 26px;
    line-height: 26px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767px) {
    #totUserInfo {
        top: 0;
        left: 50px;
        width: 92vw;
        max-width: 320px;
        z-index: 8000;
    }
    #menu_nav_inner { position: relative; }
    #menu_nav {
        display: block;
        line-height: 1.5;
        text-align: center;
        margin: 0;
    }
    #menu_nav li {
        display: inline-block;
        float: none;
        line-height: 60px;
        min-width: 50px;
    }
    #menu_nav li a {
        display: block;
        min-height: 50px;
    }
    #mobile_home,
    #mobile_notification,
    #mobile_messenger,
    #mobile_firends {
        display: block;
        height: 60px;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 32px;
    }
    #mobile_home          { background-image: url(../../../../../img/Home.png); }
    #mobile_notification  { background-image: url(../../../../../img/notification.png); }
    #mobile_messenger     { background-image: url(../../../../../img/messenger.png); }
    #mobile_firends       { background-image: url(../../../../../img/friends.png); }
}

@media (max-width: 419px) {
    #header_notification {
        position: absolute;
        right: 0;
    }
    .pulldown_contents {
        position: fixed;
        left: var(--phm-space-2);
        right: var(--phm-space-2);
        top: 60px;
        width: auto;
        max-width: none;
    }
}
