/* ============================================================
   Creative Ops — Responsive Styles v1.0
   Tailwind CSS supplement untuk fine-tuning mobile/tablet/desktop
   ============================================================ */

/* --- Better touch targets for mobile --- */
@media (max-width: 767px) {
    .touch-target {
        min-height: 44px;
    }

    /* Prevent body scroll when mobile sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Full-width tables on mobile → scrollable fallback */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table-responsive-mobile table {
        min-width: 600px;
    }

    /* Form spacing for small screens */
    .form-grid-mobile {
        grid-template-columns: 1fr !important;
    }

    /* Larger buttons on mobile */
    .btn-mobile-block {
        width: 100%;
        justify-content: center;
    }

    /* Better stack for stat cards */
    .stats-mobile-stack {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Notification dropdown full-width on mobile */
    .notif-mobile-full {
        position: fixed !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: 3.5rem !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* --- Tablet fine-tuning (768px-1023px) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 3-column grids become 2-column on tablet */
    .tablet-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Sidebar width reduction on tablet */
    .sidebar-tablet-compact {
        width: 56px !important;
    }

    .sidebar-tablet-compact .nav-label {
        display: none;
    }

    /* Stat cards: 3 columns on tablet */
    .stats-tablet-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* --- Smooth sidebar transition --- */
.sidebar-transition {
    transition: transform 0.2s ease-in-out;
}

/* --- Print styles --- */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        font-size: 11pt;
    }

    .print-break-inside {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-full {
        width: 100% !important;
        max-width: 100% !important;
    }

    .print-strip-bg {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* --- Loading / skeleton animation --- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* --- Empty state --- */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

/* --- Better dropdown on small screens --- */
@media (max-width: 639px) {
    .dropdown-mobile-fixed {
        position: fixed !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: auto !important;
        bottom: auto !important;
        max-width: none !important;
        width: auto !important;
    }

    /* Stack action buttons vertically on mobile */
    .actions-mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .actions-mobile-stack > * {
        width: 100%;
    }

    /* Make badge/tags wrap properly */
    .tags-mobile-wrap {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* --- Safe area for notch devices --- */
@supports (padding: env(safe-area-inset-bottom)) {
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }
}

/* --- Data table: horizontal scroll hint --- */
.scroll-hint::after {
    content: '⇄ Geser';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0.25rem;
}

@media (min-width: 768px) {
    .scroll-hint::after {
        display: none;
    }
}
