/* ============================================================
   PurpleZ Design System — Custom CSS
   ============================================================ */

/* ---- Form Inputs ---- */
.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.35rem;
}

.field-input {
    background: #fff;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    width: 100%;
    color: #222;
    font-size: 0.875rem;
    font-family: 'Inter Tight', system-ui, sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.field-input::placeholder { color: #999; }
.field-input:disabled {
    background: #F2F2F2;
    color: #777;
    cursor: not-allowed;
}

/* ---- Select Dropdown (Custom Arrow) ---- */
select.field-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ---- Textarea ---- */
textarea.field-input {
    resize: vertical;
    min-height: 5rem;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CCC; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BBB; }

/* ---- Login Background ---- */
.login-bg {
    background-color: #E9E9E9;
    background-image:
        radial-gradient(ellipse at 20% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
}

/* ---- Progress Shimmer ---- */
.progress-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(167, 139, 250, 0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ---- Drop Zone ---- */
.drop-zone {
    transition: border-color 0.2s, background-color 0.2s;
}
.drop-zone.drag-over {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.04);
}

/* ---- Stagger Delays ---- */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ---- Checkmark Draw Animation ---- */
.check-svg.drawn path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkDraw 0.4s ease-out forwards;
}

/* ---- SortableJS Overrides ---- */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(124, 58, 237, 0.06) !important;
    border: 2px dashed #7c3aed !important;
    border-radius: 8px;
}
.sortable-chosen {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.sortable-drag {
    opacity: 0.9;
    transform: rotate(1deg);
}

/* ---- Mobile Sidebar ---- */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(34, 34, 34, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 16rem;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.mobile-sidebar.open {
    transform: translateX(0);
}

/* ---- Skeleton Pulse ---- */
.skeleton-pulse {
    background: linear-gradient(90deg, #E9E9E9 25%, #F2F2F2 50%, #E9E9E9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* ---- Toast pointer-events fix ---- */
#toast-container > * {
    pointer-events: auto;
}

/* ---- Transition utilities ---- */
.transition-height {
    transition: height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

/* ---- Active nav item ---- */
.nav-active {
    background: rgba(124, 58, 237, 0.06);
    color: #7c3aed;
    font-weight: 500;
}

/* ---- Tab underline ---- */
.tab-active {
    border-bottom: 2px solid #7c3aed;
    color: #7c3aed;
    font-weight: 600;
}
.tab-inactive {
    border-bottom: 2px solid transparent;
    color: #777;
}
.tab-inactive:hover {
    border-bottom-color: #D0D0D0;
    color: #444;
}
