/* =========================================
   MOBILE NATIVE FORM STYLES
   ========================================= */

/* Segmented Control (iOS Style Radio) */
.segmented-control {
    display: flex;
    background-color: #eef0f4;
    border-radius: 12px;
    padding: 6px;
    position: relative;
    width: 100%;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control .sc-label {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0;
    line-height: 1.2;
    color: #7e8299;
}

.segmented-control input[type="radio"]:checked + .sc-label {
    background-color: #ffffff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    color: #181c32;
}

/* Native Form Inputs */
#form-pengaduan .form-label {
    margin-bottom: 0.5rem;
    font-size: 0.95rem !important;
}

#form-pengaduan .form-control-solid,
#form-pengaduan .form-select-solid {
    background-color: #f5f6fa;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
    font-size: 1.05rem;
}

#form-pengaduan .form-control-solid:focus,
#form-pengaduan .form-select-solid:focus {
    background-color: #ffffff;
    border-color: #0FA769; /* Theme green */
    box-shadow: 0 0 0 4px rgba(15, 167, 105, 0.1);
}

#form-pengaduan .select2-container--bootstrap5 .select2-selection--single {
    border-radius: 14px !important;
    background-color: #f5f6fa !important;
    padding: 0.75rem 1.25rem;
}

#form-pengaduan .rounded-xl {
    border-radius: 16px !important;
}

.mobile-content-card {
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
    margin-top: -20px;
}

/* =========================================
   MOBILE NATIVE APP SHELL (UI REMODEL)
   ========================================= */

/* 1. Global Native Scrollbar Hiding */
html, body, * {
    -ms-overflow-style: none !important; /* IE and Edge */
    scrollbar-width: none !important; /* Firefox */
}

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

/* 2. Reset Body for App Feel */
body {
    background-color: #f4f6f9; /* Soft background outside the app bounds */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 2. The Main App Container
   This constraints the maximum width on desktop to look like a mobile device,
   while staying 100% width on actual mobile devices. */
.app-container {
    width: 100%;
    max-width: 480px; /* Standard mobile width for desktop view */
    margin: 0 auto; /* Added to forcefully center it on desktop */
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: 70px; /* Space for bottom nav */
}

/* 3. Top App Bar (Header) */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #0FA769; /* Primary Green */
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.app-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.app-header-icon {
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px; /* Match app-container */
    background: #ffffff;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 15px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    /* Safe area for iPhone X and newer */
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #8f95a5 !important;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 25%;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: #0FA769 !important;
}

.bottom-nav-item.active i {
    transform: translateY(-3px);
}

/* 5. Content Area Adjustments */
.app-content {
    flex-grow: 1;
    padding: 20px 15px;
}

/* 6. Fix Metronic/Bootstrap overrides for mobile feel */
.container {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Adjust card to look more native */
.custom-rounded-box {
    border-radius: 20px !important;
    margin-bottom: 20px;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* Hide desktop elements */
.d-lg-block, .desktop-only {
    display: none !important;
}

/* Full width buttons */
.btn-mobile-full {
    width: 100%;
    border-radius: 12px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* =========================================
   MOBILE NATIVE COMPONENTS
   ========================================= */

/* Swipeable Carousel (Horizontal Scroll) */
.swipeable-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 25px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.swipeable-container::-webkit-scrollbar {
    display: none !important;
}

.swipeable-item {
    flex: 0 0 calc(100% - 10px); /* 100% width adjusted for internal padding */
    scroll-snap-align: center;
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 10px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

/* Elegant Carousel Navigation Buttons */
.swipe-wrapper {
    position: relative;
    padding: 0;
}
.swipe-nav-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #ffffff;
    color: #0FA769;
    font-size: 1.1rem;
    border-radius: 50%;
    border: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.swipe-nav-btn:hover {
    background: #0FA769;
    color: #ffffff;
    border-color: #0FA769;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(15, 167, 105, 0.4);
}
.swipe-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}
.swipe-nav-btn.swipe-left {
    left: -5px; /* Overlap outside */
}
.swipe-nav-btn.swipe-right {
    right: -5px; /* Overlap outside */
}
.swipe-nav-btn:focus {
    outline: none;
}

/* =========================================
   NATIVE VERTICAL TIMELINE
   ========================================= */
.native-timeline {
    position: relative;
    padding-left: 10px;
    padding-top: 10px;
}
.native-timeline::before {
    content: '';
    position: absolute;
    top: 15px; left: 32px;
    height: 85%;
    width: 2px;
    background: #e2e8f0;
    z-index: 1;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 2;
    margin-bottom: 25px;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    
    /* Bug-free CSS animation */
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUpTimeline 0.5s ease forwards;
}
.timeline-item:hover {
    background: #f8faf9;
    transform: translateY(0) translateX(8px);
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }

.timeline-item.last-item { margin-bottom: 0; }

.timeline-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 4px solid #ffffff;
    z-index: 2;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
/* Ensure icon itself is pure white */
.timeline-icon i {
    color: #ffffff !important; 
}
.timeline-item:hover .timeline-icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}
.timeline-content {
    padding-left: 20px;
    padding-top: 8px;
    flex: 1;
}
.timeline-content h5 {
    color: #1e293b;
    font-size: 1.1rem;
    letter-spacing: -0.2px;
}
.timeline-content p {
    color: #64748b;
    line-height: 1.5;
}

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