/* =========================================================
   Rundown Page - Modern & Clean
   Menggunakan variable global untuk konsistensi
   ========================================================= */

/* Layout utama - full width dengan background subtle */
.rundown-page {
    min-height: calc(100vh - var(--head-offset, 0px));
    background: var(--surface-2, #f8f9fa);
    width: 100%;
}

/* Header section dengan clean design */
.page-header {
    background: var(--surface, #ffffff);
    border-bottom: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 1.75rem 0;
    margin-bottom: 1.5rem;
    width: 100%;
}

.page-title {
    font-weight: 600;
    color: var(--text, #212529);
    margin-bottom: 0.35rem;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-muted, #6c757d);
    font-size: 0.9375rem;
    max-width: 600px;
}

/* Container konten - full width dengan padding responsive */
.content-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 1.5rem;
}

/* =========================================================
   Stats Overview - Compact & Premium
   ========================================================= */
.stats-overview {
    margin-bottom: 2rem;
    width: 100%;
}

.stat-item {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 1.25rem 1rem;
    height: 100%;
    transition: all var(--motion-hover, 180ms) var(--ease-swift, cubic-bezier(0.4, 0, 0.2, 1));
    position: relative;
    overflow: hidden;
}

/* Subtle gradient overlay for depth */
.stat-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary, #0d6efd), var(--info, #0dcaf0));
    opacity: 0;
    transition: opacity var(--motion-hover, 180ms) ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: var(--shadow-soft, 0 8px 24px rgba(15, 23, 42, 0.08));
}

.stat-item:hover::after {
    opacity: 1;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm, 8px);
    background: var(--primary-subtle, #e7f1ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
    color: var(--primary, #0d6efd);
    transition: all var(--motion-hover, 180ms) ease;
}

.stat-item:hover .stat-icon {
    transform: scale(1.05);
    background: var(--primary, #0d6efd);
    color: var(--primary-contrast, #ffffff);
}

.stat-number {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text, #212529);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* =========================================================
   Filter Section - Clean & Minimal
   ========================================================= */
.filter-section {
    background: var(--surface, #ffffff);
    border-bottom: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 1.25rem 0;
    margin-bottom: 2rem;
    width: 100%;
}

.filter-label {
    font-size: 0.8125rem;
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Custom form controls - lebih clean */
.filter-section .form-control-sm {
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all var(--motion-hover, 180ms) ease;
    background-color: var(--surface-2, #f8f9fa);
}

.filter-section .form-control-sm:focus {
    border-color: var(--primary, #0d6efd);
    box-shadow: 0 0 0 3px var(--primary-subtle, #e7f1ff);
    background-color: var(--surface, #ffffff);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Custom button styles */
.filter-section .btn-primary {
    background: var(--primary, #0d6efd);
    border: none;
    border-radius: var(--radius-sm, 8px);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--motion-hover, 180ms) var(--ease-swift);
}

.filter-section .btn-primary:hover {
    background: color-mix(in srgb, var(--primary, #0d6efd) 85%, black);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.filter-section .btn-outline-secondary {
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    color: var(--text-muted, #6c757d);
    background: var(--surface-2, #f8f9fa);
    border-radius: var(--radius-sm, 8px);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--motion-hover, 180ms) var(--ease-swift);
}

.filter-section .btn-outline-secondary:hover {
    background: var(--surface, #ffffff);
    border-color: var(--primary, #0d6efd);
    color: var(--primary, #0d6efd);
    transform: translateY(-2px);
}

/* Filter badges */
.filter-section .badge {
    border-radius: var(--radius-pill, 999px);
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
    background: var(--surface-2, #f8f9fa) !important;
    color: var(--text, #212529) !important;
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
}

/* Mobile filter button */
.mobile-filter-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    background: var(--surface, #ffffff);
    color: var(--text, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--motion-hover, 180ms) ease;
}

.mobile-filter-btn:hover,
.mobile-filter-btn:active {
    background: var(--primary, #0d6efd);
    color: var(--primary-contrast, #ffffff);
    border-color: transparent;
    transform: scale(0.95);
}

/* =========================================================
   Timeline - Modern dengan Dot System
   ========================================================= */
.timeline-wrapper {
    position: relative;
    padding-left: 2rem;
    width: 100%;
}

/* Timeline line yang lebih halus */
.timeline-line {
    position: absolute;
    left: 1rem;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(15, 23, 42, 0.08) 10%,
            rgba(15, 23, 42, 0.08) 90%,
            transparent 100%);
    z-index: 1;
}

.timeline-day {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
}

/* Modern timeline marker dengan dot system */
.timeline-marker {
    position: absolute;
    left: -2rem;
    width: 32px;
    height: 32px;
    background: var(--surface, #ffffff);
    border: 2px solid var(--card-border, rgba(15, 23, 42, 0.06));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 0.875rem;
    transition: all var(--motion-hover, 250ms) var(--ease-swift);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* Inner dot untuk efek modern */
.timeline-marker::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    transition: all var(--motion-hover, 250ms) var(--ease-swift);
}

.timeline-marker.today::before {
    opacity: 1;
    background: var(--primary-contrast, #ffffff);
}

.timeline-marker.today {
    border-color: var(--primary, #0d6efd);
    background: var(--primary, #0d6efd);
    color: var(--primary-contrast, #ffffff);
    box-shadow: 0 0 0 4px var(--primary-subtle, #e7f1ff);
}

.timeline-marker.past {
    border-color: var(--secondary, #6c757d);
    background: var(--surface, #ffffff);
    color: var(--secondary, #6c757d);
}

.timeline-marker.upcoming {
    border-color: var(--success, #198754);
    background: var(--surface, #ffffff);
    color: var(--success, #198754);
}

.timeline-marker:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px var(--primary-subtle, #e7f1ff);
}

/* Day Card - Clean & Modern */
.day-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    overflow: hidden;
    transition: all var(--motion-hover, 250ms) var(--ease-swift);
    width: 100%;
    position: relative;
}

.day-card:hover {
    box-shadow: var(--shadow-soft, 0 8px 24px rgba(15, 23, 42, 0.08));
    transform: translateY(-2px);
    border-color: transparent;
}

.day-header {
    background: var(--surface, #ffffff);
    border-bottom: 1px solid var(--card-border, rgba(15, 23, 42, 0.04));
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.day-date {
    font-weight: 600;
    color: var(--text, #212529);
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Date dengan subtle icon */
.day-date::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary, #0d6efd);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.5;
}

.day-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill, 999px);
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: all var(--motion-hover, 180ms) ease;
}

.status-today {
    background: var(--primary-subtle, #e7f1ff);
    color: var(--primary, #0d6efd);
}

.status-past {
    background: var(--surface-2, #f8f9fa);
    color: var(--text-muted, #6c757d);
}

.status-upcoming {
    background: var(--success-subtle, #d1e7dd);
    color: var(--success, #198754);
}

/* Activity List - Clean spacing */
.activity-list {
    padding: 0.75rem 0;
}

.activity-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border, rgba(15, 23, 42, 0.04));
    transition: all var(--motion-hover, 180ms) var(--ease-swift);
    position: relative;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--surface-2, #f8f9fa);
    padding-left: 2rem;
}

/* Subtle indicator on hover */
.activity-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary, #0d6efd);
    opacity: 0.5;
}

.activity-time {
    min-width: 100px;
    font-weight: 600;
    color: var(--primary, #0d6efd);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-time i {
    font-size: 0.875rem;
    opacity: 0.7;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text, #212529);
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.activity-meta {
    font-size: 0.8125rem;
    color: var(--text-muted, #6c757d);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.activity-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.activity-meta i {
    width: 14px;
    color: var(--primary, #0d6efd);
    opacity: 0.5;
}

/* =========================================================
   Empty State - Engaging & Modern
   ========================================================= */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    max-width: 500px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

/* Decorative elements */
.empty-state::before,
.empty-state::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--primary-subtle, #e7f1ff);
    opacity: 0.3;
    z-index: 0;
}

.empty-state::before {
    top: -100px;
    right: -100px;
}

.empty-state::after {
    bottom: -100px;
    left: -100px;
    background: var(--info-subtle, #cff4fc);
}

.empty-icon {
    font-size: 4rem;
    color: var(--primary, #0d6efd);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-title {
    font-weight: 600;
    color: var(--text, #212529);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.empty-text {
    color: var(--text-muted, #6c757d);
    font-size: 0.9375rem;
    max-width: 360px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.empty-state .btn {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-pill, 999px);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all var(--motion-hover, 180ms) var(--ease-swift);
}

.empty-state .btn-primary {
    background: var(--primary, #0d6efd);
    border: none;
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

/* =========================================================
   Modal - Clean Design
   ========================================================= */
.modal-content {
    border: none;
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-soft, 0 8px 24px rgba(15, 23, 42, 0.08));
}

.modal-header {
    border-bottom: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text, #212529);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--card-border, rgba(15, 23, 42, 0.06));
    padding: 1.25rem 1.5rem;
}

/* =========================================================
   Responsive - Mobile First dengan Breakpoint Bootstrap
   ========================================================= */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .content-container {
        padding: 0 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .content-container {
        padding: 0 2.5rem;
    }

    .activity-item {
        display: flex;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .activity-time {
        min-width: 120px;
        text-align: left;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .content-container {
        padding: 0 3rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .content-container {
        padding: 0 4rem;
    }
}

/* Mobile specific (max-width: 767.98px) */
@media (max-width: 767.98px) {
    .page-header {
        padding: 1.25rem 0;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    .content-container {
        padding: 0 1rem;
    }

    /* Stats compact */
    .stat-item {
        padding: 0.875rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.625rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Timeline compact */
    .timeline-wrapper {
        padding-left: 1.5rem;
    }

    .timeline-line {
        left: 0.75rem;
    }

    .timeline-marker {
        left: -1.5rem;
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .day-header {
        padding: 1rem 1.25rem;
    }

    .day-date {
        font-size: 0.875rem;
    }

    .day-status {
        font-size: 0.6875rem;
        padding: 0.25rem 0.75rem;
    }

    /* Activity item stack on mobile */
    .activity-item {
        padding: 0.875rem 1.25rem;
    }

    .activity-item.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .activity-time {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .activity-title {
        font-size: 0.875rem;
    }

    .activity-meta {
        font-size: 0.75rem;
        gap: 0.375rem 0.75rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2.5rem 1.25rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-title {
        font-size: 1.125rem;
    }

    .empty-text {
        font-size: 0.8125rem;
    }

    .mobile-filter-btn {
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: var(--radius-md, 12px);
    }

    /* Hover effect untuk touch devices */
    .mobile-filter-btn:active {
        transform: scale(0.95);
        background: var(--primary, #0d6efd);
        color: var(--primary-contrast, #ffffff);
        border-color: transparent;
    }

    /* Nonaktifkan hover effect di mobile untuk stat-item */
    .stat-item:hover {
        transform: none;
        border-color: var(--card-border, rgba(15, 23, 42, 0.06));
        box-shadow: none;
    }

    .stat-item:hover .stat-icon {
        transform: none;
        background: var(--primary-subtle, #e7f1ff);
        color: var(--primary, #0d6efd);
    }

    /* Nonaktifkan hover effect di mobile untuk day-card */
    .day-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--card-border, rgba(15, 23, 42, 0.06));
    }

    /* Nonaktifkan hover effect di mobile untuk activity-item */
    .activity-item:hover {
        background: transparent;
        padding-left: 1.25rem;
    }

    .activity-item:hover::before {
        display: none;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .day-header {
        flex-wrap: wrap;
    }

    .day-date {
        width: 100%;
    }

    .day-status {
        margin-left: 0;
    }
}

/* =========================================================
   Utility Classes untuk Micro-interactions
   ========================================================= */
.app-hover-lift {
    transition: transform var(--motion-hover, 180ms) var(--ease-swift),
        box-shadow var(--motion-hover, 180ms) var(--ease-swift);
}

.app-hover-lift:active {
    transform: translateY(0);
}

/* Touch feedback untuk mobile - hanya untuk elemen interaktif */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.97);
    }

    .mobile-filter-btn:active {
        transform: scale(0.95);
    }

    /* Nonaktifkan efek press pada elemen non-interaktif */
    .stat-item:active,
    .day-card:active,
    .activity-item:active,
    .timeline-marker:active {
        transform: none !important;
        background: transparent !important;
    }
}

/* Fix mobile modal freeze */
body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

.modal {
    touch-action: auto;
}

/* =========================================
   FORCE BOOTSTRAP MODAL ABOVE ALL LAYOUT
   ========================================= */

/* backdrop harus di atas semua */
.modal-backdrop {
    z-index: 2000 !important;
}

/* modal container */
.modal {
    z-index: 2005 !important;
}

/* dialog */
.modal-dialog {
    z-index: 2010 !important;
}

/* header & navbar jangan pernah nutup modal */
header,
.navbar,
.bottom-nav,
.app-header,
.client-header {
    z-index: 1000 !important;
}

/* kalau ada wrapper transform dari layout */
.app-content,
main,
.layout-client {
    transform: none !important;
    filter: none !important;
}

/* bootstrap mobile freeze fix */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ==========================================================================
   PRESS STATE - HANYA UNTUK ELEMEN INTERAKTIF DI TOUCH DEVICE
   ========================================================================== */

/* Hanya elemen interaktif yang mendapat efek press */
.btn,
.btn-primary,
.btn-outline-secondary,
.btn-outline-primary,
.btn-sm,
.mobile-filter-btn,
.btn-close,
a[href]:not(.stat-item *):not(.day-card *):not(.timeline-marker *),
button:not(.stat-item *):not(.day-card *):not(.timeline-marker *),
[role="button"]:not(.stat-item *):not(.day-card *):not(.timeline-marker *) {
    touch-action: manipulation;
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.2),
        box-shadow 0.2s ease,
        background-color 0.2s ease;
    will-change: transform;
}

/* Efek saat disentuh (kelas .press) */
.btn.press,
.btn-primary.press,
.btn-outline-secondary.press,
.btn-outline-primary.press,
.btn-sm.press {
    transform: scale(0.96) translateY(1px) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.05s cubic-bezier(0.2, 0.9, 0.4, 1.1),
        box-shadow 0.05s ease !important;
}

.mobile-filter-btn.press {
    transform: scale(0.92) !important;
    transition: transform 0.05s ease !important;
}

.btn-close.press {
    transform: scale(0.92) !important;
    transition: transform 0.05s ease !important;
}

/* Link */
a.press {
    transform: scale(0.98);
    text-decoration: none;
}

/* Mobile: nonaktifkan semua efek press pada card dan elemen non-interaktif */
@media (hover: none) and (pointer: coarse) {

    /* Nonaktifkan efek press pada card */
    .stat-item.press,
    .day-card.press,
    .activity-item.press,
    .timeline-marker.press,
    .badge.press,
    .empty-state.press {
        transform: none !important;
        box-shadow: none !important;
        transition: none !important;
        background-color: transparent !important;
    }

    /* Nonaktifkan hover yang mengganggu */
    .stat-item:hover {
        transform: none;
        border-color: var(--card-border, rgba(15, 23, 42, 0.06));
        box-shadow: none;
    }

    .day-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--card-border, rgba(15, 23, 42, 0.06));
    }

    .activity-item:hover {
        background: transparent;
        padding-left: 1.25rem;
    }

    .activity-item:hover::before {
        display: none;
    }

    .timeline-marker:hover {
        transform: none;
        box-shadow: none;
    }

    .empty-state .btn-primary:hover {
        transform: none;
    }

    /* Hanya elemen interaktif yang tetap dapat press */
    .btn.press,
    .btn-primary.press,
    .btn-outline-secondary.press,
    .btn-outline-primary.press,
    .btn-sm.press {
        transform: scale(0.96) translateY(1px) !important;
        transition: transform 0.04s ease !important;
    }

    .mobile-filter-btn.press {
        transform: scale(0.92) !important;
    }
}

/* Jika pengguna mengurangi gerakan */
@media (prefers-reduced-motion: reduce) {

    .btn.press,
    .mobile-filter-btn.press {
        transform: none !important;
        transition: none !important;
    }
}
