/* ═══════════════════════════════════════════════════════════════
   PREMIUM TOOLTIPS — ProductiveApp v5.0
   Design inspire du tooltip AI Reorganize (.air-tip)
   ═══════════════════════════════════════════════════════════════ */

/* ── Base container ── */
.ptip {
    position: fixed;
    pointer-events: none;
    z-index: 2000000;
    opacity: 0;
    transform: translate(-50%, calc(-100% + 6px));
    transition: opacity .25s ease, transform .25s cubic-bezier(.21, 1.02, .73, 1);
    max-width: 280px;
    min-width: 160px;
    display: none;
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, .45));
}

/* ── Visible state ── */
.ptip.ptip-show {
    opacity: 1;
    transform: translate(-50%, -100%);
    display: block;
}

/* ── Bottom variant (when no space above) ── */
.ptip.ptip-bottom {
    transform: translate(-50%, 6px);
}
.ptip.ptip-bottom.ptip-show {
    transform: translate(-50%, 0);
}

/* ── Inner card ── */
.ptip-inner {
    background: linear-gradient(135deg, #1a1d2e 0%, #1e2235 100%);
    border: 1px solid rgba(245, 200, 66, .18);
    border-radius: 12px;
    padding: 14px 16px 12px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, .5),
        0 0 20px rgba(245, 200, 66, .05),
        inset 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Arrow (top, pointing down — default) ── */
.ptip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(245, 200, 66, .18);
}

/* ── Arrow bottom variant (pointing up) ── */
.ptip.ptip-bottom::after {
    bottom: auto;
    top: -6px;
    border-top-color: transparent;
    border-bottom-color: rgba(245, 200, 66, .18);
}

/* ── Title ── */
.ptip-title {
    font-size: .82rem;
    font-weight: 700;
    color: #f5c842;
    margin: 0 0 5px;
    line-height: 1.3;
    letter-spacing: .01em;
}

/* ── Description text ── */
.ptip-text {
    font-size: .72rem;
    color: rgba(255, 255, 255, .55);
    line-height: 1.55;
    margin: 0 0 0;
}

/* ── Hint line (shortcut, CTA, etc.) ── */
.ptip-hint {
    font-size: .62rem;
    color: rgba(245, 200, 66, .45);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding-top: 8px;
    margin-top: 8px;
}

/* ── Theme adaptation: Light mode ── */
[data-theme="light"] .ptip-inner,
.light-mode .ptip-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8f7f4 100%);
    border-color: rgba(180, 140, 30, .25);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, .15),
        0 0 20px rgba(180, 140, 30, .06),
        inset 0 1px 0 rgba(255, 255, 255, .8);
}

[data-theme="light"] .ptip-title,
.light-mode .ptip-title {
    color: #9a7200;
}

[data-theme="light"] .ptip-text,
.light-mode .ptip-text {
    color: rgba(0, 0, 0, .6);
}

[data-theme="light"] .ptip-hint,
.light-mode .ptip-hint {
    color: rgba(154, 114, 0, .5);
    border-top-color: rgba(0, 0, 0, .08);
}

[data-theme="light"] .ptip::after,
.light-mode .ptip::after {
    border-top-color: rgba(180, 140, 30, .25);
}

[data-theme="light"] .ptip.ptip-bottom::after,
.light-mode .ptip.ptip-bottom::after {
    border-top-color: transparent;
    border-bottom-color: rgba(180, 140, 30, .25);
}

/* ── Responsive: smaller on mobile ── */
@media (max-width: 768px) {
    .ptip {
        max-width: 220px;
        min-width: 140px;
    }
    .ptip-inner {
        padding: 10px 12px 8px;
    }
    .ptip-title {
        font-size: .76rem;
    }
    .ptip-text {
        font-size: .68rem;
    }
}

/* ── Hide on touch devices (hover doesn't apply well) ── */
@media (hover: none) and (pointer: coarse) {
    .ptip {
        display: none !important;
    }
}

/* ── Subtle glow animation on first appearance ── */
@keyframes ptipGlow {
    0% { box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 20px rgba(245,200,66,.05); }
    50% { box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 30px rgba(245,200,66,.1); }
    100% { box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 20px rgba(245,200,66,.05); }
}

.ptip.ptip-show .ptip-inner {
    animation: ptipGlow 2s ease-in-out 1;
}
