/* ========================================
   PENGHUNI KOST PAGE STYLES - CLEAN & CONSOLIDATED
   
   Clean sections with headers outside cards
======================================== */

/* Mobile: Hide desktop badges, show image overlays */
@media (max-width: 1023px) {
    .desktop-badges-header,
    .desktop-badges,
    .desktop-status-badge {
        display: none !important;
    }
}

/* ========================================
   MAIN CONTAINER
======================================== */
.penghuni-kost-container {
    padding: 20px 16px;
}

/* ========================================
   KOST CONTENT LAYOUT  
======================================== */
.kost-content {
    gap: 24px;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    min-height: 100vh;
}

/* ========================================
   SECTION HEADERS (Outside Cards)
======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.view-all-btn {
    background: transparent;
    border: none;
    color: var(--blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    background: rgba(27, 117, 187, 0.1);
    color: var(--dark-blue);
}

/* ========================================
   GLOBAL ELEMENT STYLING - CONSISTENT ACROSS ALL SIZES
======================================== */

/* Status and Highlight Elements */
.booking-id-highlight {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    background: rgba(0, 0, 0, 0.025);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 400;
    color: #9CA3AF;
}

.room-number-highlight {
    background: rgba(255, 193, 7, 0.12);
    color: var(--gold) !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
}

.price {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--blue) !important;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(13, 71, 161, 0.1);
}

.info-value.status-active {
    color: var(--green);
    background: var(--btn-green4);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
}

.info-value.due-date {
    color: var(--amber-500);
    font-weight: 600;
}

.due-date-urgent {
    color: var(--btn-red) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    background: rgba(220, 38, 38, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Button Styling - Global */
.manage-reservation-btn {
    background: var(--blue);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manage-reservation-btn:hover {
    background: #0D47A1;
}

.review-btn {
    background: white;
    color: var(--blue);
    border: 1.5px solid var(--blue);
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-btn:hover {
    background: #0D47A1;
    color: white;
}

/* ========================================
   RESERVASI CARD STYLES - VERTICAL LAYOUT (MOBILE BASE)
======================================== */
.reservation-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.reservation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.reservation-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.reservation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.reservation-card:hover .reservation-image img {
    transform: scale(1.02);
}

.reservation-details {
    padding: 16px;
}

.reservation-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: right;
}

/* Image Overlay Badges - Mobile */
.image-badges-top {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.image-badges-top .papi-property-badges {
    display: flex;
    gap: 0.5rem;
}

.image-badges-bottom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
}

.image-badges-top .papi-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.image-badges-top .papi-gender-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.status-overlay-badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-overlay-badge.status-active {
    background: rgba(34, 197, 94, 0.95);
    color: var(--white);
    border-color: rgba(34, 197, 94, 0.3);
}

.property-header {
    margin-bottom: 8px;
}

.property-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.papi-location {
    font-size: 14px;
    margin-bottom: 12px;
    color: #555;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.papi-location .location-pin {
    color: var(--tab-active);
    flex-shrink: 0;
}

/* ========================================
   SURVEY CARD - CLEAN LAYOUT
======================================== */
.survey-horizontal-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray2);
    padding: 16px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.survey-horizontal-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.survey-top-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.survey-image {
    width: 25%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.survey-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.survey-content {
    width: 75%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
}

.survey-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.survey-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.survey-location .location-pin {
    color: var(--orange);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.survey-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.survey-date .date-icon {
    color: var(--gray);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.survey-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.survey-time .time-icon {
    color: var(--gray);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.survey-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.survey-btn-secondary {
    background: var(--yellow);
    color: var(--black);
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-height: 44px;
}

.survey-btn-secondary:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
}

.survey-btn-primary {
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-height: 44px;
}

.survey-btn-primary:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
}

.survey-image .image-badges-bottom {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.survey-image .status-overlay-badge {
    background: var(--yellow);
    color: var(--black);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ========================================
   RESERVATION ACTIONS
======================================== */
.reservation-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.manage-reservation-btn,
.review-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: auto;
    flex: 0 0 auto;
}

/* ========================================
   RESPONSIVE DESIGN - CONSOLIDATED
======================================== */

/* Mobile - Show image overlay badges */
@media (max-width: 1023px) {
    .desktop-badges,
    .desktop-status-badge {
        display: none !important;
    }
    
    .image-badges-top,
    .image-badges-bottom {
        display: block !important;
    }
    
    .reservation-image {
        width: 120px;
        height: 100px;
        margin: 0;
        border-radius: 0;
    }
    
    .reservation-image img {
        border-radius: 0;
    }
}

/* Desktop & Large Tablet (1024px and up) */
@media (min-width: 1024px) {
    /* Hide mobile overlay badges on desktop only */
    .image-badges-top,
    .image-badges-bottom {
        display: none;
    }
    
    .penghuni-kost-container {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px 16px;
        gap: 24px;
    }
    
    .section-header {
        margin-bottom: 16px;
        padding: 0 4px;
    }
    
    .section-title {
        font-size: 22px;
        font-weight: 700;
    }
    
    .view-all-btn {
        font-size: 14px;
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    /* Refined Tokopedia-style Cards */
    .reservation-card {
        display: flex;
        flex-direction: row;
        max-width: 100%;
        margin-bottom: 14px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.05);
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        overflow: hidden;
        background: var(--white);
        transition: all 0.25s ease;
    }
    
    .reservation-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-color: var(--blue);
    }
    
    /* Improved Image with spacing */
    .reservation-image {
        width: 160px;
        height: 120px;
        flex-shrink: 0;
        border-radius: 8px;
        margin: 12px;
        overflow: hidden;
    }
    
    .reservation-image img {
        border-radius: 8px;
    }
    
    /* Compact Content */
    .reservation-details {
        flex: 1;
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .property-header {
        margin-bottom: 8px;
    }
    
    .property-name {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 6px;
        color: #1F2937;
        line-height: 1.3;
        letter-spacing: -0.005em;
    }
    
    .papi-location {
        font-size: 14px;
        margin-bottom: 16px;
        color: #666666;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    /* Improved Info Grid */
    .reservation-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 20px;
        margin-bottom: 16px;
        padding: 12px 0;
    }
    
    .info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .info-label {
        font-size: 11px;
        color: #888888;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .info-value {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-dark);
    }
    
    /* Buttons positioned in bottom-right corner */
    .reservation-actions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        align-self: flex-end;
        margin-top: auto;
    }
    
    .manage-reservation-btn,
    .review-btn {
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: auto;
    }
    
    /* Desktop badges header - top row with status on right */
    .desktop-badges-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
    }
    
    .desktop-badges {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .desktop-badges .papi-badge,
    .desktop-badges .papi-gender-badge {
        padding: 4px 8px;
        font-size: 10px;
        border-radius: 6px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 4px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .desktop-status-badge {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 6px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
    }
}

/* Medium Tablet (768px to 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
    .penghuni-kost-container {
        max-width: 700px;
        margin: 0 auto;
        padding: 20px 16px;
        gap: 28px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .reservation-card {
        display: flex;
        flex-direction: row;
        margin-bottom: 20px;
    }
    
    .reservation-image {
        width: 200px;
        height: 160px;
        flex-shrink: 0;
    }
    
    .reservation-details {
        flex: 1;
        padding: 20px;
    }
    
    .property-name {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .reservation-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 16px;
        margin-bottom: 20px;
    }
    
    /* Tablet-optimized button spacing for finger-friendly interaction */
    .reservation-actions {
        gap: 10px;
    }
    
    .manage-reservation-btn,
    .review-btn {
        padding: 10px 18px;
        min-height: 44px;
    }
}

/* Tablet & Mobile Portrait (768px and below) */
@media (max-width: 768px) {
    .survey-horizontal-card {
        padding: 12px;
    }
    
    .survey-top-row {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .survey-title {
        font-size: 15px;
    }
    
    .survey-btn-secondary,
    .survey-btn-primary {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .section-title {
        font-size: 18px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .penghuni-kost-container {
        padding: 12px;
        gap: 16px;
    }
    
    .section-header {
        margin-bottom: 10px;
        padding: 0 2px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .reservation-image {
        height: 180px;
        width: 100%;
    }
    
    .property-name {
        font-size: 16px;
    }
}

/* ===== FILTER & SEARCH DISPLAY STYLES ===== */
/* CSS untuk fitur search, filter, dan display reservasi */

/* Filter Section */
.reservasi-filters {
    background: var(--white);
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-gray);
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title i {
    color: var(--blue);
    font-size: 18px;
}

/* Status Filter Buttons - Horizontal Scroll */
.status-filters {
    display: flex;
    flex-wrap: nowrap !important; /* CRITICAL: Force horizontal scroll */
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.status-filters::-webkit-scrollbar {
    display: none;
}

.status-filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-gray);
    background: var(--white);
    color: var(--text-gray);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Active button state - Yellow brand color */
.status-filter-btn.active {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 241, 0, 0.25);
}

.status-filter-btn.active.all {
    background: var(--gray);
    border-color: var(--gray);
}

.status-filter-btn.active.pending {
    background: var(--orange);
    border-color: var(--orange);
}

.status-filter-btn.active.confirmed {
    background: var(--blue);
    border-color: var(--blue);
}

.status-filter-btn.active.checkin {
    background: var(--green);
    border-color: var(--green);
}

.status-filter-btn.active.checkout {
    background: var(--gray3);
    border-color: var(--gray3);
}

.status-filter-btn.active.cancelled {
    background: var(--red);
    border-color: var(--red);
}

/* Hover effects - ONLY for devices that support hover */
@media (hover: hover) {
    .status-filter-btn:hover {
        border-color: var(--blue);
        color: var(--blue);
        background: rgba(27, 117, 187, 0.08);
        box-shadow: 0 2px 6px rgba(27, 117, 187, 0.15);
    }
    
    .status-filter-btn.active:hover {
        background: var(--yellow);
        border-color: var(--yellow);
        color: var(--black);
        box-shadow: 0 3px 10px rgba(255, 241, 0, 0.3);
    }
}

/* Remove hover effects on touch devices */
@media (hover: none) {
    .status-filter-btn:hover {
        background: var(--white);
        border-color: var(--border-gray);
        color: var(--text-gray);
        transform: none;
        box-shadow: none;
    }
    
    .status-filter-btn.active:hover {
        background: var(--yellow);
        border-color: var(--yellow);
        color: var(--black);
        transform: none;
        box-shadow: 0 2px 8px rgba(255, 241, 0, 0.25);
    }
}

/* Search Input */
.search-input-group {
    position: relative;
    max-width: 400px;
}

.search-input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 15px;
    z-index: 2;
}

#searchReservasi {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    transition: all 0.2s ease;
    outline: none;
    height: 42px;
    box-sizing: border-box;
    line-height: 1.4;
}

#searchReservasi:focus {
    border-color: var(--yellow);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(255, 241, 0, 0.15);
}

#searchReservasi::placeholder {
    color: var(--gray3);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .reservasi-filters {
        margin-bottom: 10px;
        padding: 16px;
        border-radius: 10px;
    }
    
    .status-filters {
        padding-right: 15px !important; /* Minimal padding to prevent clipping */
        position: relative;
    }
    
    /* Ultra-thin fade - only 3px wide to prevent button clipping */
    .status-filters::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 3px; /* Ultra thin to prevent clipping */
        background: linear-gradient(to right, 
            rgba(248, 249, 250, 0) 0%, 
            rgba(248, 249, 250, 0.3) 100%
        );
        pointer-events: none;
        z-index: 1;
    }
    
    .search-input-group {
        max-width: 100%;
    }
    
    #searchReservasi {
        padding: 6px 10px 6px 32px;
        font-size: 14px;
        height: 36px;
    }
    
    .search-input-group i {
        left: 10px;
        font-size: 13px;
    }
}

/* Loading and Empty States */
.reservasi-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--gray2);
    border-top: 3px solid var(--blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reservasi-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    border: 2px dashed var(--gray2);
    margin: 20px 0;
}

.reservasi-empty i {
    font-size: 48px;
    color: var(--gray3);
    margin-bottom: 15px;
    display: block;
}

.reservasi-empty h3 {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 600;
}

.reservasi-empty p {
    color: var(--gray3);
    font-size: 14px;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* Filter Results Info */
.filter-results-info {
    background: var(--base);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--blue);
}

.filter-results-info p {
    margin: 0;
    color: var(--gray);
    font-size: 14px;
}

.filter-results-info strong {
    color: var(--blue);
    font-weight: 600;
}