/* Stili Premium Light Istituzionale & Glassmorphism */

html, body {
    touch-action: manipulation;
    
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient Orbs & Brand Background Glow */
.ambient-orb {
  pointer-events: none !important;
  z-index: -1;
    position: absolute;
    border-radius: 50%;
    filter: blur(105px);
    z-index: 0;
    pointer-events: none;
    animation: ambient-float 15s ease-in-out infinite;
}
@keyframes ambient-float {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.95; }
    50% { transform: translate(20px, -20px) scale(1.08); opacity: 1; }
}
.orb-purple {
    background: radial-gradient(circle, rgba(94, 23, 235, 0.28) 0%, rgba(94, 23, 235, 0.12) 50%, rgba(94, 23, 235, 0) 75%);
    animation-delay: 0s;
}
.orb-cyan {
    background: radial-gradient(circle, rgba(45, 212, 191, 0.22) 0%, rgba(94, 23, 235, 0.10) 50%, rgba(255, 255, 255, 0) 75%);
    animation-delay: -5s;
    animation-duration: 18s;
}
.orb-lavender {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.24) 0%, rgba(94, 23, 235, 0.09) 55%, rgba(255, 255, 255, 0) 75%);
    animation-delay: -10s;
    animation-duration: 20s;
}

/* Form Inputs */
input, select, textarea {
    transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.2);
    border-color: #500279 !important;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* Custom Scrollbar pulita */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F8F9FA;
}
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Utilities animazioni per ingressi scaglionati */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }

/* --- Elemento firma: tracciato vitale --- */
/* Usato come loader e come divisore, al posto del generico spinner/pulse */
.ecg-line {
    width: 100%;
    max-width: 220px;
    height: 28px;
    overflow: visible;
}
.ecg-line path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: ecgDraw 1.6s ease-in-out infinite;
}
@keyframes ecgDraw {
    0% { stroke-dashoffset: 300; opacity: 0.3; }
    50% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: -300; opacity: 0.3; }
}

.ecg-line.ecg-line--once path {
    animation: ecgDrawOnce 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes ecgDrawOnce {
    from { stroke-dashoffset: 300; opacity: 0; }
    to { stroke-dashoffset: 0; opacity: 1; }
}

/* Varianti card: il bordo sinistro codifica il canale/tipo, non decora soltanto */
.card-edge-a {
    border-left: 3px solid #B28CFF;
}
.card-edge-b {
    border-left: 3px solid #5EEAD4;
}
.card-edge-neutral {
    border-left: 3px solid rgba(255,255,255,0.15);
}

/* Ombre Viola Custom & Glassmorphism Cards (Enhanced Ambient Glow) */
.bento-card, .purple-shadow, [class*="shadow-[0_15px_40px_rgba(94,23,235"] {
    box-shadow: 0 16px 36px rgba(94, 23, 235, 0.18), 0 4px 12px rgba(94, 23, 235, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-card:hover, .purple-shadow:hover, [class*="shadow-[0_15px_40px_rgba(94,23,235"]:hover, [class*="hover:shadow-[0_20px_50px_rgba(94,23,235"]:hover {
    box-shadow: 0 22px 50px rgba(94, 23, 235, 0.30), 0 8px 24px rgba(94, 23, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-3px);
}

/* Custom Scrollbar Elegante per i Modali (Glassmorphism) */
.custom-modal-scroll::-webkit-scrollbar {
    width: 6px;
}
.custom-modal-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}
.custom-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(94, 23, 235, 0.4);
    border-radius: 8px;
}
.custom-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 23, 235, 0.8);
}

/* Quill Editor — Glassmorphism Integration */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(8px);
}
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    min-height: 160px;
}
.ql-editor {
    min-height: 160px;
    padding: 16px 20px;
}
.ql-editor.ql-blank::before {
    color: #9CA3AF;
    font-style: normal;
}

/* Rendered Quill Content — Feed & Detail Views */
.ql-rendered h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.ql-rendered h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}
.ql-rendered p {
    margin-bottom: 0.6rem;
}
.ql-rendered ul, .ql-rendered ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}
.ql-rendered ul {
    list-style-type: disc;
}
.ql-rendered ol {
    list-style-type: decimal;
}
.ql-rendered li {
    margin-bottom: 0.25rem;
}
.ql-rendered a {
    color: #500279;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
.ql-rendered a:hover {
    color: #4B0082;
}
.ql-rendered blockquote {
    border-left: 4px solid #500279;
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: #6B7280;
    font-style: italic;
}
.ql-rendered strong {
    font-weight: 700;
}
.ql-rendered em {
    font-style: italic;
}

/* --- Quill Modern Theme Customization --- */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-radius: 12px 12px 0 0 !important;
    padding: 12px !important;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.ql-toolbar.ql-snow .ql-formats {
    margin-right: 8px !important;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 2px;
}
.ql-toolbar.ql-snow button {
    border-radius: 6px !important;
    transition: all 0.2s !important;
}
.ql-toolbar.ql-snow button:hover {
    background: rgba(94, 23, 235, 0.1) !important;
    color: #500279 !important;
}
.ql-toolbar.ql-snow button.ql-active {
    background: rgba(94, 23, 235, 0.15) !important;
    color: #500279 !important;
}
.ql-container.ql-snow {
    border: none !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border-radius: 0 0 12px 12px !important;
    font-size: 1.05rem !important;
    font-family: inherit !important;
}
.ql-editor {
    min-height: 250px;
    padding: 24px !important;
}

/* --- Quill Dropdown & Heading Fixes for Tailwind --- */
.ql-snow .ql-picker-options {
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e5e7eb !important;
    padding: 4px 0 !important;
    z-index: 9999 !important;
}
.ql-toolbar.ql-snow {
    position: relative;
    z-index: 50 !important;
}
.ql-snow .ql-picker-item:hover {
    color: #500279 !important;
}
.ql-snow .ql-picker-label:hover {
    color: #500279 !important;
}
.ql-snow .ql-picker-label.ql-active {
    color: #500279 !important;
}
.ql-editor h1 {
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}
.ql-editor h2 {
    font-size: 1.875rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}
.ql-editor h3 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
}
.ql-editor p {
    margin-bottom: 0.75rem !important;
}
