/* ============================================
   MOBILE FIRST - APP LIKE DESIGN
   ============================================ */

/* Reset & Base */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    background: #f5f7fa;
    width: 100%;
    max-width: 100vw;
}

/* Fix container shifting */
.container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

@media (max-width: 767px) {
    .navbar>.container {
        padding-left: 0;
        padding-right: 0;
        justify-content: center !important;
    }

    .navbar-brand {
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .row {
        margin-left: -8px;
        margin-right: -8px;
    }

    .col,
    [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Mobile Container */
.mobile-container {
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .mobile-container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .mobile-container {
        max-width: 960px;
    }
}

/* Mobile Bottom Navigation */
.mobile-nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    padding: 8px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 10px;
    padding: 4px 10px;
    transition: all 0.3s ease;
}

.mobile-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.mobile-nav-item.active {
    color: var(--dark-green);
}

.mobile-nav-item:active {
    transform: scale(0.9);
}

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--medium-green) 100%);
    z-index: 1030;
    padding: 12px 16px;
    box-shadow: 0 2px 20px rgba(13, 115, 119, 0.3);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.mobile-logo img {
    height: 36px;
    margin-right: 10px;
}

.mobile-logo-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Mobile Main Content */
.mobile-main {
    padding-top: 70px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Mobile Cards */
.mobile-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: none;
}

.mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mobile-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Mobile Buttons */
.btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    width: 100%;
    transition: all 0.3s ease;
}

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

.btn-mobile-primary {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--medium-green) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
}

.btn-mobile-outline {
    background: transparent;
    color: var(--dark-green);
    border: 2px solid var(--dark-green);
}

/* Mobile Form Elements */
.mobile-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    -webkit-appearance: none;
}

.mobile-input:focus {
    outline: none;
    border-color: var(--dark-green);
    box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.1);
}

.mobile-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* Mobile Hero */
.mobile-hero {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--medium-green) 100%);
    padding: 24px 16px 40px;
    border-radius: 0 0 30px 30px;
    margin-bottom: 20px;
    color: white;
}

.mobile-hero-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.mobile-hero-subtitle {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Mobile Stats */
.mobile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mobile-stat-item {
    background: white;
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.mobile-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 22px;
}

.mobile-stat-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-green);
    display: block;
}

.mobile-stat-label {
    font-size: 11px;
    color: #6c757d;
}

/* Mobile Service Grid */
.mobile-services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mobile-service-item {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.mobile-service-item:active {
    transform: scale(0.95);
}

.mobile-service-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.1) 0%, rgba(20, 145, 155, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    color: var(--dark-green);
}

.mobile-service-title {
    font-size: 12px;
    font-weight: 600;
}

/* Mobile News Card */
.mobile-news {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-news-item {
    display: flex;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.mobile-news-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.mobile-news-content {
    padding: 12px;
    flex: 1;
}

.mobile-news-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-news-date {
    font-size: 12px;
    color: #6c757d;
}

/* Mobile Section */
.mobile-section {
    margin-bottom: 24px;
}

.mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.mobile-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.mobile-section-link {
    font-size: 14px;
    color: var(--dark-green);
    text-decoration: none;
    font-weight: 600;
}

/* Mobile Menu Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: scroll !important; /* Force scrollbar if needed */
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer-header {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--medium-green) 100%);
    padding: 24px;
    color: white;
}

.mobile-drawer-menu {
    list-style: none;
    padding: 16px 0 80px 0; /* Extra bottom padding for scroll */
    margin: 0;
}

.mobile-drawer-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-drawer-item i {
    width: 32px;
    font-size: 18px;
    color: var(--dark-green);
}

.mobile-drawer-item:active {
    background: #f8f9fa;
}

.mobile-drawer-item.active {
    color: var(--dark-green);
    font-weight: 700;
    border-left: 4px solid var(--dark-green);
    background: rgba(13, 115, 119, 0.05);
}

/* Mobile Dropdown */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.mobile-dropdown.open .fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background: #f8f9fa;
    transition: max-height 0.3s ease;
}

.mobile-dropdown.open .mobile-dropdown-menu {
    max-height: 1000px;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 12px 24px 12px 56px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.mobile-dropdown-menu li a.active {
    color: var(--dark-green);
    font-weight: 700;
    background: rgba(13, 115, 119, 0.06);
    border-left: 4px solid var(--dark-green);
}

.mobile-dropdown-menu li a:active {
    background: #e9ecef;
}

/* Mobile Tracking Card */
.mobile-tracking {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.mobile-tracking-input {
    display: flex;
    gap: 8px;
}

.mobile-tracking-input input {
    flex: 1;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
}

.mobile-tracking-input button {
    padding: 16px 20px;
    background: var(--dark-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
}

/* Status Badge Mobile */
.mobile-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.mobile-status-diterima {
    background: #d4edda;
    color: #155724;
}

.mobile-status-diproses {
    background: #fff3cd;
    color: #856404;
}

.mobile-status-selesai {
    background: #d1ecf1;
    color: #0c5460;
}

.mobile-status-ditolak {
    background: #f8d7da;
    color: #721c24;
}

/* Mobile Responsive Utilities */
@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    h1,
    .h1 {
        font-size: 1.5rem;
    }

    h2,
    .h2 {
        font-size: 1.3rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .card {
        border-radius: 16px;
    }

    .table-responsive {
        border-radius: 16px;
    }

    /* Move toast to top on mobile to avoid blocking bottom nav */
    #toast-container {
        top: 20px !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        padding: 0 !important;
    }

    .custom-toast {
        min-width: 100%;
        margin-bottom: 10px;
        animation: slideInDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .mobile-only {
        display: none !important;
    }

    .mobile-nav-bottom {
        display: none;
    }

    .mobile-main {
        padding-bottom: 20px;
    }
}

/* Pull to refresh indicator */
.pull-to-refresh {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

.pull-to-refresh i {
    margin-right: 8px;
}

/* Swipe gesture hint */
.swipe-hint {
    text-align: center;
    padding: 8px;
    color: #6c757d;
    font-size: 12px;
}

.swipe-hint i {
    animation: swipeHint 1.5s ease infinite;
}

@keyframes swipeHint {

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

    50% {
        transform: translateX(10px);
    }
}

/* Touch feedback */
.touch-feedback {
    position: relative;
    overflow: hidden;
}

.touch-feedback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.touch-feedback:active::after {
    width: 200px;
    height: 200px;
}

/* Floating Action Button (FAB) */
.mobile-fab {
    position: fixed;
    bottom: 90px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--medium-green) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(13, 115, 119, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1020;
    transition: all 0.3s ease;
}

.mobile-fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(13, 115, 119, 0.3);
}

/* Breadcrumb mobile */
.mobile-breadcrumb {
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* Page title mobile */
.mobile-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    padding: 0 4px;
}

/* Empty state mobile */
.mobile-empty {
    text-align: center;
    padding: 40px 20px;
}

.mobile-empty-icon {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: #adb5bd;
}

.mobile-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.mobile-empty-text {
    font-size: 14px;
    color: #6c757d;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Toast notification mobile */
.mobile-toast {
    position: fixed;
    bottom: 90px;
    left: 16px;
    right: 16px;
    background: #333;
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.mobile-toast.success {
    background: #28a745;
}

.mobile-toast.error {
    background: #dc3545;
}