/* ============================================================
   PTC Platform — Design System v2 (app.css)
   Gradienți, animații, glassmorphism, dark mode, a11y.
   Se încarcă global din templates/partials/head_assets.php
============================================================ */

:root {
    --c-primary: #2563eb;
    --c-primary-2: #7c3aed;
    --c-accent: #10b981;
    --c-accent-2: #0ea5e9;
    --grad-main: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --grad-accent: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --radius: 14px;
    --shadow-card: 0 6px 24px -4px rgb(16 24 40 / .10);
    --shadow-card-hover: 0 14px 34px -6px rgb(16 24 40 / .16);
    --ring: 0 0 0 3px rgb(37 99 235 / .18);
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-display: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Bază & tipografie ---------- */
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, .font-extrabold, .font-bold { font-family: var(--font-display); letter-spacing: -.015em; }
::selection { background: rgb(37 99 235 / .85); color: #fff; }
.font-mono { font-variant-numeric: tabular-nums; }

/* Scrollbar custom */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgb(100 116 139 / .35); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgb(37 99 235 / .55); }

/* ---------- Culori utilitare (fallback dacă lipsesc din config Tailwind) ---------- */
.text-primary { color: var(--c-primary); }
.text-accent { color: var(--c-accent); }

/* ---------- Gradienți, butoane, carduri ---------- */
.grad-bg {
    background: var(--grad-accent);
    background-size: 160% 160%;
    transition: background-position .45s ease, transform .2s ease, box-shadow .25s ease;
}
.grad-bg:hover {
    background-position: 90% 50%;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -6px rgb(16 185 129 / .45);
}
.grad-bg-main { background: var(--grad-main); background-size: 160% 160%; }
.grad-bg-main:hover { background-position: 90% 50%; }
.grad-text { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Efect "shine" pe butoanele cu gradient */
.grad-bg { position: relative; overflow: hidden; }
.grad-bg::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / .35) 50%, transparent 60%);
    transform: translateX(-130%); transition: transform .65s ease;
}
.grad-bg:hover::after { transform: translateX(130%); }

/* Carduri: umbră adâncă + hover lift (aplicat automat pe toate cardurile) */
.shadow-card {
    box-shadow: var(--shadow-card);
    border-radius: var(--radius);
    transition: transform .22s ease, box-shadow .22s ease;
}
.shadow-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

/* Glassmorphism (utilitar opțional) */
.glass { background: rgb(255 255 255 / .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ---------- Formulare: focus ring modern ---------- */
input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary) !important; box-shadow: var(--ring); outline: none; }
input[type="file"]:focus { box-shadow: none; }

/* ---------- Tabele: hover pe rânduri ---------- */
table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: rgb(37 99 235 / .045); }

/* ---------- Badge-uri de status cu glow ---------- */
.rounded-full[class*="bg-green-100"]  { box-shadow: 0 0 0 1px rgb(16 185 129 / .25), 0 2px 8px -2px rgb(16 185 129 / .35); }
.rounded-full[class*="bg-red-100"]    { box-shadow: 0 0 0 1px rgb(239 68 68 / .25), 0 2px 8px -2px rgb(239 68 68 / .35); }
.rounded-full[class*="bg-yellow-100"] { box-shadow: 0 0 0 1px rgb(245 158 11 / .30), 0 2px 8px -2px rgb(245 158 11 / .35); }
.rounded-full[class*="bg-blue-100"]   { box-shadow: 0 0 0 1px rgb(37 99 235 / .25), 0 2px 8px -2px rgb(37 99 235 / .35); }

/* ---------- Animații ---------- */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes floatY   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulseSoft{ 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.anim-fade-up   { animation: fadeUp .55s cubic-bezier(.22, .9, .34, 1) both; }
.anim-fade-in   { animation: fadeIn .4s ease both; }
.anim-float     { animation: floatY 5s ease-in-out infinite; }
.anim-pulse-soft{ animation: pulseSoft 2.2s ease-in-out infinite; }
.d1 { animation-delay: .06s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .18s; }
.d4 { animation-delay: .24s; } .d5 { animation-delay: .30s; }

/* Cascadă automată pentru liste (reclame, task-uri, tranzacții) */
.space-y-3 > *, .space-y-4 > *, .space-y-6 > * { animation: fadeUp .5s cubic-bezier(.22, .9, .34, 1) both; }
.space-y-3 > *:nth-child(1), .space-y-4 > *:nth-child(1), .space-y-6 > *:nth-child(1) { animation-delay: .03s; }
.space-y-3 > *:nth-child(2), .space-y-4 > *:nth-child(2), .space-y-6 > *:nth-child(2) { animation-delay: .08s; }
.space-y-3 > *:nth-child(3), .space-y-4 > *:nth-child(3), .space-y-6 > *:nth-child(3) { animation-delay: .13s; }
.space-y-3 > *:nth-child(4), .space-y-4 > *:nth-child(4), .space-y-6 > *:nth-child(4) { animation-delay: .18s; }
.space-y-3 > *:nth-child(5), .space-y-4 > *:nth-child(5), .space-y-6 > *:nth-child(5) { animation-delay: .23s; }
.space-y-3 > *:nth-child(n+6), .space-y-4 > *:nth-child(n+6), .space-y-6 > *:nth-child(n+6) { animation-delay: .28s; }

/* Grid KPI: cascadă pe cardurile din dashboard */
.grid > .shadow-card { animation: fadeUp .5s cubic-bezier(.22, .9, .34, 1) both; }
.grid > .shadow-card:nth-child(2) { animation-delay: .07s; }
.grid > .shadow-card:nth-child(3) { animation-delay: .14s; }
.grid > .shadow-card:nth-child(4) { animation-delay: .21s; }
.grid > .shadow-card:nth-child(5) { animation-delay: .28s; }

/* Modal & toast tranziții */
#adModal > div { animation: fadeUp .3s cubic-bezier(.22, .9, .34, 1) both; }
[class*="notyf"], [id*="notyf"], .ptc-toast { animation: fadeUp .35s ease both; }

/* Sidebar: indicator activ subtil */
aside a[class*="bg-blue-50"], aside a[class*="bg-gray-100"] { box-shadow: inset 3px 0 0 var(--c-primary); }

/* ---------- Accessibility (WCAG 2.1 AA, doc 5.1.4) ---------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important;
    }
}

/* ---------- TEMĂ DARK (se activează automat dacă selectorul de teme setează data-theme="dark") ---------- */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0b1220; color: #e2e8f0; }
html[data-theme="dark"] .bg-white\/90,
html[data-theme="dark"] .bg-white { background-color: rgb(23 32 51 / .94) !important; }
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100\/60,
html[data-theme="dark"] .bg-gray-100 { background-color: rgb(15 23 42 / .65) !important; }
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600 { color: #dbe4f0 !important; }
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 { color: #93a4bd !important; }
html[data-theme="dark"] .border-gray-200\/50,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-100 { border-color: rgb(51 65 85 / .7) !important; }
html[data-theme="dark"] .divide-gray-100 > *,
html[data-theme="dark"] .divide-gray-50 > * { border-color: rgb(51 65 85 / .55) !important; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #101a2e; color: #e2e8f0; border-color: #2b3a55 !important; }
html[data-theme="dark"] table tbody tr:hover { background: rgb(59 130 246 / .08); }
html[data-theme="dark"] .shadow-card { box-shadow: 0 8px 28px -6px rgb(0 0 0 / .5); }

/* ============================================================
   PTC Platform — Design System v3: Fundaluri & Umbre premium
   ============================================================ */

/* ---------- 1. Fundal pagină: mesh gradient subtil, fix la scroll ---------- */
body {
    background-color: #f4f7fb;
    background-image:
        radial-gradient(1200px 600px at 85% -10%, rgb(37 99 235 / .10), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgb(16 185 129 / .10), transparent 55%),
        radial-gradient(700px 420px at 50% 110%, rgb(124 58 237 / .08), transparent 60%);
    background-attachment: fixed;
}

/* ---------- 2. Carduri: umbre clare, stratificate + lumină interioară ---------- */
.shadow-card,
.bg-white\/90 {
    border: 1px solid rgb(226 232 240 / .95);
    box-shadow:
        0 1px 2px rgb(16 24 40 / .06),
        0 4px 12px -2px rgb(16 24 40 / .08),
        0 16px 32px -12px rgb(16 24 40 / .14),
        inset 0 1px 0 rgb(255 255 255 / .9);
}
.shadow-card:hover,
.bg-white\/90:hover {
    border-color: rgb(203 213 225 / .95);
    box-shadow:
        0 2px 4px rgb(16 24 40 / .08),
        0 10px 20px -4px rgb(16 24 40 / .12),
        0 28px 48px -16px rgb(16 24 40 / .20),
        inset 0 1px 0 rgb(255 255 255 / .9);
}

/* ---------- 3. Header & Sidebar: adâncime reală ---------- */
header.fixed, header.sticky {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgb(226 232 240 / .95), 0 8px 24px -12px rgb(16 24 40 / .18);
}
aside {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset -1px 0 0 rgb(226 232 240 / .95), 4px 0 24px -12px rgb(16 24 40 / .10);
}

/* ---------- 4. Butoane: umbre colorate (glow) + stare apăsată ---------- */
.grad-bg {
    box-shadow: 0 4px 14px -4px rgb(16 185 129 / .50), 0 2px 6px -2px rgb(14 165 233 / .40);
}
.grad-bg:hover {
    box-shadow: 0 8px 22px -6px rgb(16 185 129 / .60), 0 4px 10px -4px rgb(14 165 233 / .50);
}
.grad-bg:active { transform: translateY(1px) scale(.99); box-shadow: 0 3px 10px -4px rgb(16 185 129 / .55); }
button.bg-blue-600, a.bg-blue-600, button.bg-blue-500 { box-shadow: 0 4px 14px -4px rgb(37 99 235 / .45); }
button.bg-red-600, button.bg-red-500 { box-shadow: 0 4px 14px -4px rgb(220 38 38 / .45); }
button.bg-green-600, button.bg-green-500 { box-shadow: 0 4px 14px -4px rgb(22 163 74 / .45); }
button.bg-yellow-500 { box-shadow: 0 4px 14px -4px rgb(202 138 4 / .45); }
button.bg-indigo-600 { box-shadow: 0 4px 14px -4px rgb(79 70 229 / .45); }

/* ---------- 5. Formulare: adâncime interioară ---------- */
input, select, textarea { box-shadow: inset 0 1px 2px rgb(16 24 40 / .06); }

/* ---------- 6. Tabele: header cu gradient + separator clar ---------- */
table thead {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    box-shadow: inset 0 -1px 0 rgb(226 232 240 / .95);
}
table thead th { text-shadow: 0 1px 0 rgb(255 255 255 / .8); }

/* ---------- 7. Carduri KPI: bară accent colorată sus ---------- */
.grid > .shadow-card { position: relative; overflow: hidden; }
.grid > .shadow-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--grad-accent); opacity: .9;
}
.grid > .shadow-card:nth-child(2)::before { background: var(--grad-main); }
.grid > .shadow-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.grid > .shadow-card:nth-child(4)::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.grid > .shadow-card:nth-child(5)::before { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }

/* ---------- 8. Imagini & thumbnail-uri: umbră clară ---------- */
.shadow-card img, .ad-thumb, img.rounded-lg, img.rounded-xl {
    box-shadow: 0 2px 10px -2px rgb(16 24 40 / .22);
}

/* ---------- 9. Modale & toast-uri: umbre cinematice ---------- */
#adModal > div, .swal2-popup {
    box-shadow: 0 32px 64px -16px rgb(16 24 40 / .35), 0 8px 24px -8px rgb(16 24 40 / .25);
}
[class*="notyf"], .ptc-toast { filter: drop-shadow(0 12px 24px rgb(16 24 40 / .28)); }

/* ---------- 10. Secțiuni highlight (galben/albastru info): umbre moi ---------- */
.bg-blue-50, .bg-yellow-50, .bg-green-50, .bg-red-50 {
    box-shadow: 0 2px 10px -4px rgb(16 24 40 / .10), inset 0 1px 0 rgb(255 255 255 / .7);
}

/* ---------- 11. DARK MODE: fundal & umbre adaptate ---------- */
html[data-theme="dark"] body {
    background-color: #0b1220;
    background-image:
        radial-gradient(1200px 600px at 85% -10%, rgb(37 99 235 / .16), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgb(16 185 129 / .12), transparent 55%),
        radial-gradient(700px 420px at 50% 110%, rgb(124 58 237 / .14), transparent 60%);
}
html[data-theme="dark"] .shadow-card,
html[data-theme="dark"] .bg-white\/90 {
    border-color: rgb(51 65 85 / .85);
    box-shadow:
        0 1px 2px rgb(0 0 0 / .45),
        0 8px 24px -8px rgb(0 0 0 / .50),
        0 20px 40px -16px rgb(0 0 0 / .60),
        inset 0 1px 0 rgb(255 255 255 / .06);
}
html[data-theme="dark"] aside { background: linear-gradient(180deg, #101a2e 0%, #0d1526 100%); }
html[data-theme="dark"] table thead { background: linear-gradient(180deg, #16233b 0%, #121c30 100%); box-shadow: inset 0 -1px 0 rgb(51 65 85 / .8); }
html[data-theme="dark"] table thead th { text-shadow: none; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { box-shadow: inset 0 1px 3px rgb(0 0 0 / .4); }
html[data-theme="dark"] .bg-blue-50, html[data-theme="dark"] .bg-yellow-50,
html[data-theme="dark"] .bg-green-50, html[data-theme="dark"] .bg-red-50 { box-shadow: 0 2px 10px -4px rgb(0 0 0 / .4), inset 0 1px 0 rgb(255 255 255 / .05); }

/* ---------- 12. Tooltip-uri la hover (data-tip) ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    background: #0f172a; color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
    padding: 6px 9px; border-radius: 6px; white-space: nowrap;
    box-shadow: 0 4px 14px rgb(0 0 0 / .28);
    z-index: 70; pointer-events: none;
    animation: fadeIn .15s ease both;
}
[data-tip]:hover::before {
    content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 4px solid transparent; border-top-color: #0f172a;
    z-index: 70; pointer-events: none;
}
html[data-theme="dark"] [data-tip]:hover::after { background: #e2e8f0; color: #0f172a; }
html[data-theme="dark"] [data-tip]:hover::before { border-top-color: #e2e8f0; }

/* ---------- 13. Toast v2 — curat, auto-dismiss ---------- */
#ptc-toasts {
    position: fixed; top: 14px; right: 14px; z-index: 120;
    display: flex; flex-direction: column; gap: 10px;
    width: min(380px, calc(100vw - 28px)); pointer-events: none;
}
.ptc-toast {
    pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 12px; color: #fff;
    font-size: 13.5px; font-weight: 600; line-height: 1.45;
    box-shadow: 0 10px 30px -8px rgb(16 24 40 / .35);
    opacity: 0; transform: translateX(24px);
    transition: opacity .28s ease, transform .28s cubic-bezier(.22, .9, .34, 1);
}
.ptc-toast.is-in  { opacity: 1; transform: none; }
.ptc-toast.is-out { opacity: 0; transform: translateX(24px); }
.ptc-toast i { margin-top: 2px; font-size: 16px; }
.ptc-toast span { flex: 1; word-break: break-word; }
.ptc-toast__x {
    background: rgb(255 255 255 / .18); border: 0; color: #fff;
    width: 22px; height: 22px; border-radius: 6px; font-size: 14px; line-height: 1; cursor: pointer; flex: none;
}
.ptc-toast__x:hover { background: rgb(255 255 255 / .32); }
.ptc-toast--success { background: linear-gradient(135deg, #059669, #10b981); }
.ptc-toast--error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.ptc-toast--warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ptc-toast--info    { background: linear-gradient(135deg, #2563eb, #3b82f6); }
/* GT-CLEANUP-START */
#google_translate_element,.goog-te-gadget,.goog-te-banner-frame,#goog-gt-tt,.goog-tooltip,.skiptranslate{display:none!important}
body,html.translated-ltr body,html.translated-rtl body{top:0!important}
.goog-text-highlight{background:transparent!important;box-shadow:none!important}
/* GT-CLEANUP-END */
