/* Assets/css/space-style.css */
:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    --dark-950: #020617;
    --dark-900: #0f172a;
    --dark-800: #1e293b;
    --dark-700: #334155;
}

body {
    font-family: 'Figtree', sans-serif;
    scroll-behavior: smooth;
    background-color: #f8fafc;
}

.dark body {
    background-color: var(--dark-950);
}

/* Mesh Gradient Background */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
}

.dark .mesh-bg {
    background-color: var(--dark-950);
    background-image:
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
}

/* Glassmorphism Refinement */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Spring Animations */
@keyframes spring-pop {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    70% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-spring {
    animation: spring-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Notification Pulse */
@keyframes notification-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.notification-active {
    position: relative;
}

.notification-active::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: notification-pulse 2s infinite;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}

.shadow-soft {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.shadow-premium {
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.08);
}

.shadow-panel {
    box-shadow: -15px 0 35px -5px rgba(0, 0, 0, 0.05);
}

.sidebar-item {
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid transparent;
}

.sidebar-item:hover {
    background: rgba(2, 132, 199, 0.05);
    transform: translateX(4px);
}

.dark .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-item div.w-8 {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease, color 0.4s ease;
}

.sidebar-item:hover div.w-8 {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary-100) !important;
    color: var(--primary-600) !important;
}

.dark .sidebar-item:hover div.w-8 {
    background: var(--primary-900) !important;
}

.sidebar-item:active {
    transform: scale(0.98);
}

.sidebar-item.active {
    background: white;
    box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.1), 0 4px 6px -4px rgba(2, 132, 199, 0.1);
    color: var(--primary-600);
    border: 1px solid rgba(2, 132, 199, 0.1);
}

.dark .sidebar-item.active {
    background: var(--dark-800);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 0 15px rgba(2, 132, 199, 0.1);
    color: white;
}

.dark .sidebar-item.active div.w-8 {
    background: var(--primary-600) !important;
    color: white !important;
}

.nav-parent .chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-parent.open .chevron {
    transform: rotate(90deg);
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 0;
}

.nav-parent.open .sidebar-submenu {
    max-height: 800px;
    opacity: 1;
}

.sidebar-subitem {
    position: relative;
}

.sidebar-subitem::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--primary-500);
    transition: height 0.3s;
}

.sidebar-subitem.active::before {
    height: 60%;
}

.sidebar-subitem.active {
    color: var(--primary-600);
    font-weight: 700;
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
}

.modal-hidden {
    display: none !important;
}

.panel-backdrop {
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 5000;
}

.side-panel {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5100;
}

.side-panel.open {
    transform: translateX(0);
}

.kanban-column {
    min-width: 280px;
}

.drag-over {
    background-color: rgba(2, 132, 199, 0.05);
    border-color: var(--primary-400) !important;
}

.task-card-dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
}

.dark .toast {
    background: var(--dark-800);
    border: 1px solid var(--dark-700);
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.timeline-line::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.dark .timeline-line::before {
    background: #334155;
}

.animate-fade {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-progress-ind {
    width: 30%;
    animation: progressInd 2s infinite linear;
}

@keyframes progressInd {
    0% {
        margin-left: -30%;
    }

    100% {
        margin-left: 100%;
    }
}

@media print {

    /* Hide all non-print elements */
    .no-print,
    #sidebar,
    .fixed,
    #toast-container,
    .modal-backdrop,
    .mesh-bg,
    #loading-sync,
    #login-overlay {
        display: none !important;
    }

    /* Hide all scrollbars in print */
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        overflow: visible !important;
    }

    *::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* Force pure white background and remove shadows */
    html,
    body,
    main,
    #print-layout,
    #print-task-layout {
        background: white !important;
        background-color: white !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        color: black !important;
        font-size: 10pt;
    }

    main {
        width: 100% !important;
    }

    #tasks-container {
        display: none !important;
    }

    /* Hide project header & toolbar to eliminate top whitespace */
    #view-kanban > div:first-child,
    .no-print {
        display: none !important;
    }

    /* Reset top margin so content starts flush at page margin */
    #print-layout {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Cancel space-y-6 margin-top from parent #view-kanban that pushes print-layout down */
    #view-kanban > #print-layout {
        margin-top: 0 !important;
    }

    /* Reset padding/margin on ancestor containers during print */
    #view-kanban,
    main > div,
    main {
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    html,
    body {
        height: auto !important;
        min-height: auto !important;
    }

    .flex.h-screen {
        height: auto !important;
        overflow: visible !important;
    }

    body.print-task-mode>div.flex.h-screen {
        display: none !important;
    }

    #print-layout,
    #print-task-layout {
        display: none !important;
    }

    body.print-project-mode #print-layout {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.print-task-mode #print-task-layout {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    table {
        border-collapse: collapse !important;
        width: 100% !important;
        border: 1px solid #000 !important;
    }

    th,
    td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        word-wrap: break-word;
        background: transparent !important;
    }

    .page-break-before {
        page-break-before: always;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* Spesifik dari laporan.html */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    .kop-surat {
        border-bottom: 3px double #000 !important;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        padding-bottom: 10px;
    }

    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px;
    }

    .html2pdf__page-break {
        display: block;
        page-break-before: always;
        height: 0;
        margin: 0;
        padding: 0;
    }
}

.print-report-header,
.print-footer {
    display: none;
}

@media screen {
    #view-kanban {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Auth Overlay Styles */
#login-overlay {
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.8);
    transition: opacity 0.5s ease;
}

.auth-card {
    box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.4);
    animation: authShow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.glass-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-500);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.15);
}

/* Modal and Utility Classes Fixes */
#modal-view,
#modal-preview,
#modal-checkin,
#modal-upload-evidence,
#modal-print-task {
    z-index: 6000;
}

#modal-preview {
    z-index: 7000;
}

.modal-tab.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
}

#tasks-container {
    padding-bottom: 100px;
}

/* Sidebar Custom Styling */
#sidebar {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 8000;
}

#sidebar-backdrop {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 7500;
}

#sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    #sidebar {
        z-index: 2500;
    }

    #sidebar-backdrop {
        z-index: 2400;
    }
}

/* Status Colors for Dynamic Badges */
.status-todo {
    background-color: #f1f5f9;
    color: #64748b;
}

.status-doing {
    background-color: #eff6ff;
    color: #3b82f6;
}

.status-waiting {
    background-color: #f5f3ff;
    color: #8b5cf6;
}

.status-done {
    background-color: #ecfdf5;
    color: #10b981;
}

/* Specific button styles */
.flog-btn.active {
    background-color: var(--primary-600);
    color: white;
}

/* Priority Colors */
.prio-high {
    color: #ef4444;
}

.prio-medium {
    color: #3b82f6;
}

.prio-low {
    color: #10b981;
}

/* Priority Stripes */
.card-prio-high {
    border-left: 4px solid #ef4444 !important;
}

.card-prio-medium {
    border-left: 4px solid #3b82f6 !important;
}

.card-prio-low {
    border-left: 4px solid #10b981 !important;
}

/* Dashboard Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: currentColor;
    opacity: 0.03;
    border-radius: 50%;
}

/* Kanban Drag & Drop Visuals */
.kanban-column.drag-over {
    background-color: rgba(2, 132, 199, 0.08);
    border-style: solid;
}

/* Chart Container Adjustments */
#chart-project-progress {
    width: 100% !important;
}

/* PREMIUM DASHBOARD ENHANCEMENTS */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
}

#project-progress-container .group:hover .h-full {
    filter: brightness(1.1);
}

/* Glassmorphism for tooltips */
.group\/seg:hover>div {
    opacity: 1 !important;
}

/* Smooth Progress Bar Transitions */
[style*="width"] {
    transition: width 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}

.dark .bg-white\/60 {
    background-color: rgba(15, 23, 42, 0.4);
}