/* css/style_tracuu.css - FINAL VERSION (STANDALONE) */

:root {
    --primary-color: #004b8f;
    --accent-color: #007bff;
    --bg-color: #f4f6f9;
    --text-dark: #333;
    --text-grey: #666;
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.1);
}

body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; padding-top: 140px; 
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   1. PHẦN MÀN HÌNH KHÓA (LOCK SCREEN)
   (Phải copy vào đây vì đã bỏ file style_giaohang.css)
   ========================================= */
.lock-screen-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #fff; z-index: 99999;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
}
.lock-screen-content { text-align: center; width: 100%; max-width: 350px; padding: 20px; }
.lock-icon { font-size: 60px; color: var(--accent-color); margin-bottom: 20px; }
.lock-screen-content h2 { margin: 0 0 10px 0; color: var(--text-dark); }
.lock-screen-content p { color: var(--text-grey); margin-bottom: 30px; }

.pin-display input {
    width: 300px; height: 60px; font-size: 30px; text-align: center; letter-spacing: 15px;
    border: none; border-bottom: 3px solid #ddd; background: transparent; outline: none;
    color: var(--text-dark); margin-bottom: 30px;
}
.pin-display input:focus { border-bottom-color: var(--accent-color); }

.btn-unlock {
    width: 100%; padding: 15px; background-color: var(--accent-color); color: white;
    border: none; border-radius: 30px; font-size: 18px; font-weight: bold; cursor: pointer;
}

/* Captcha trong Lockscreen */
#captchaContainer { text-align: center; }
#captchaImage { border-radius: 5px; border: 1px solid #ccc; height: 40px; }
#btnRefreshCaptcha { border: none; background: none; cursor: pointer; color: var(--accent-color); font-size: 1.2rem; }
#captchaInput {
    margin-top: 10px; width: 200px; height: 40px; border: 1px solid #ccc; border-radius: 5px;
    font-size: 18px; text-align: center; display: block; margin-left: auto; margin-right: auto;
}

/* =========================================
   2. GIAO DIỆN TRA CỨU
   ========================================= */
.tracuu-header {
    background: #ffffff;
    color: #000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.btn-back {
    color: #000;
    font-size: 1.2rem;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title { font-size: 1.1rem; font-weight: 700; margin: 0; text-transform: uppercase; }

/* =========================================
   2. SEARCH BAR (ĐÃ CÓ NÚT CLEAR)
   ========================================= */
.search-bar-container {
    position: fixed; top: 60px; left: 0; right: 0;
    background: white;
    padding: 10px 15px; 
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.search-input-wrapper { position: relative; }

.search-icon { 
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%); 
    color: var(--primary-color); font-size: 1.1rem;
}

.search-input {
    width: 100%;
    height: 45px;
    border: 1px solid #e0e0e0;
    border-radius: 25px; 
    padding-left: 45px; 
    /* (SỬA) Tăng padding bên phải để chứa cả Nút X và Spinner */
    padding-right: 75px; 
    font-size: 1.1rem; font-weight: 500; color: var(--text-dark);
    outline: none; transition: all 0.2s ease; box-sizing: border-box;
    background-color: #f8f9fa; 
}

.search-input:focus { 
    border-color: var(--accent-color); 
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 91, 159, 0.1);
}

/* (MỚI) Nút Clear (X) */
.btn-clear-search {
    position: absolute;
    right: 5px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: #bbb; font-size: 1.2rem;
    cursor: pointer;
    z-index: 1001; /* Nằm trên spinner */
}
.btn-clear-search:active { color: #666; }

/* (SỬA) Spinner - Dời sang trái một chút để không đè lên nút X */
.spinner-loader {
    position: absolute; 
    right: 45px; /* Cách lề phải xa hơn để nhường chỗ cho nút X */
    top: 12px;
    width: 20px; height: 20px;
    border: 3px solid #e9ecef; border-top: 3px solid var(--accent-color);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


.empty-state { text-align: center; color: #bbb; margin-top: 60px; }
.empty-state i { font-size: 5rem; margin-bottom: 20px; color: #e0e0e0; }

.result-container {
    padding: 20px; box-sizing: border-box; width: 100%; max-width: 600px; 
    margin: 20px auto 50px auto;
}

/* HERO CARD */
.hero-card {
    background: white; border-radius: 20px; padding: 25px 20px;
    box-shadow: var(--shadow-hover); margin-bottom: 30px; position: relative; overflow: hidden;
}
.hero-card::before {
    content: "MỚI NHẤT"; position: absolute; top: 0; right: 0;
    background: linear-gradient(to right, #007bff, #00c6ff); color: white;
    padding: 8px 15px; font-size: 0.75rem; font-weight: 800; border-bottom-left-radius: 15px;
}
.cust-name { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); margin-bottom: 5px; }
.cust-phone { font-size: 1.1rem; color: var(--text-grey); font-weight: 500; margin-bottom: 20px; display: block; }
.info-row { display: flex; margin-bottom: 12px; font-size: 1rem; color: #555; }
.info-row i { width: 24px; color: var(--accent-color); margin-top: 3px; }
.money-highlight { font-size: 1.8rem; color: #dc3545; font-weight: 800; margin-top: 20px; text-align: right; }

.hero-actions { margin-top: 20px; display: flex; gap: 12px; }
.btn-action {
    flex: 1; padding: 12px; border-radius: 12px; border: none; font-weight: 600; cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-view-img { background: #eff6ff; color: var(--accent-color); }
.btn-view-map { background: #f0fdf4; color: #16a34a; text-decoration: none; }

/* LIST */
.history-title { font-size: 0.9rem; color: #888; margin-bottom: 15px; text-transform: uppercase; font-weight: 700; padding-left: 5px; }
.history-item {
    background: white; border-radius: 15px; padding: 20px; margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-left: 6px solid #ccc; position: relative;
}
.history-item[data-status="1"] { border-left-color: #28a745; } 
.history-item[data-status="0"] { border-left-color: #ffc107; } 
.history-item[data-status="-1"] { border-left-color: #dc3545; } 
.history-date { font-weight: 600; color: var(--text-grey); font-size: 0.9rem; margin-bottom: 8px; display: block; }
.history-money { position: absolute; top: 20px; right: 20px; font-weight: 700; color: #dc3545; font-size: 1.1rem; }
.history-addr { font-size: 1rem; color: var(--text-dark); margin-bottom: 15px; padding-right: 70px; line-height: 1.4; }
.btn-sm-img {
    font-size: 0.85rem; padding: 8px 15px; background: #f8f9fa;
    border-radius: 20px; color: #555; border: 1px solid #eee; cursor: pointer; font-weight: 500;
}
.btn-load-more {
    width: 100%; padding: 15px; background: white; border: none; border-radius: 12px;
    color: var(--accent-color); font-weight: 600; font-size: 1rem; cursor: pointer;
}

/* ============================================================
   3. CSS SLIDER & MODAL (VUÔNG GÓC - SLIDE UP - FULL WIDTH)
   ============================================================ */

/* Overlay chung */
.slider-overlay {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Nền tối */
    z-index: 20000; 
    
    /* Quan trọng: Căn nội dung xuống đáy */
    align-items: flex-end; 
    justify-content: center;
}

/* Container chứa ảnh - VUÔNG GÓC, TRÀN VIỀN */
.slider-container {
    width: 100%;
    height: 100%; /* Full màn hình hoặc tùy chỉnh */
    background-color: #000;
    
    /* (FIX THEO YÊU CẦU) BỎ BO GÓC */
    border-radius: 0 !important;
    
    /* Hiệu ứng trượt từ dưới lên */
    animation: slideUpSheet 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Khu vực hiển thị ảnh */
.slider-wrapper {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

.slider-wrapper img {
    max-width: 100%; max-height: 100vh;
    object-fit: contain;
    border-radius: 0 !important; /* Ảnh cũng vuông */
}

/* Nút Close (X) */
.close-slider {
    position: absolute; top: 20px; right: 20px;
    color: #fff; font-size: 40px; z-index: 20002; cursor: pointer;
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); border-radius: 50%; /* Giữ nút này tròn cho dễ bấm */
}

/* Nút Next/Prev */
.slider-prev, .slider-next {
    cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%);
    padding: 16px; color: white; font-weight: bold; font-size: 24px;
    background-color: rgba(255, 255, 255, 0.1); border: none; z-index: 20001;
    border-radius: 0; /* Nút vuông */
}
.slider-prev { left: 0; }
.slider-next { right: 0; }

.slider-counter {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 16px; background: rgba(0,0,0,0.5); padding: 5px 15px;
    z-index: 20001; border-radius: 0;
}