* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; 
}

*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    -webkit-appearance: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden !important; 
    position: fixed !important; 
    
    background-color: #1e1e1e;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overscroll-behavior: none !important;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

body {
    background-color: #1e1e1e;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.app-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto !important; 
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; 
    
    background-color: #1a1a1a;
    
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.app-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}
.app-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

#pull-to-refresh {
    position: fixed;
    top: env(safe-area-inset-top);
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.ptr-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 3px solid transparent;
    border-top-color: #007bff; /* Lingkaran Biru */
    border-right-color: #007bff;
}

.ptr-spinner.spinning {
    animation: spin-ptr 0.8s linear infinite;
}

@keyframes spin-ptr {
    to { transform: rotate(360deg); }
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-image: url('../img/bg_splash.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 150px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top: 4px solid #1abc9c;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: white;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.header-section {
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 30px)); 
    
    text-align: left;
    position: relative;
    z-index: 1000;
    background-color: #1a1a1a;
    
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.banner-area {
    margin: 10px 0 15px 0;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.img-banner {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

#main-interface {
    background-color: #1a1a1a;
}

.camera-wrapper {
    position: relative;
    width: 100%;
    height: 55vh;
    background: #000;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 20px;
}

.hide-camera {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanning-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 15px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.mini-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #1abc9c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.shutter-btn-container {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
}

.shutter-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #007bff; 
    border: 5px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    transition: transform 0.2s;
}

.shutter-btn:active {
    transform: scale(0.9);
    background: #0056b3; 
}

.btn-tracking { 
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
    border-radius: 4px; 
}

.btn-tracking:hover { 
    background-color: #0d47a1 !important;
}

.btn-cancel {
    background-color: #cdd3d8 !important;
    border-color: #cdd3d8 !important;
    color: #000 !important;
    border-radius: 4px; 
}

.btn-cancel:hover {
    background-color: #bfc6cd !important;
}

.float-btn {
    position: fixed;
    bottom: 110px; 
    z-index: 99990;
    cursor: pointer;
    border-radius: 50%;
    display: none; 
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.float-btn:active { 
    transform: scale(0.9); 
}

.float-wa {
    right: 20px;
    width: 65px;
    height: 65px;
    background: transparent; 
}

.icon-img { 
    width: 150%; 
    height: 150%; 
    object-fit: contain; 
}

.float-pustaka {
    left: 20px;
    width: 50px;
    height: 50px;
    background: #343a40; 
    color: white;
    flex-direction: column;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.float-pustaka i { 
    font-size: 18px; 
    margin-bottom: 0; 
}

.label-float { 
    font-size: 8px; 
    font-weight: bold; 
    line-height: 1; 
    margin-top: 2px; 
}

#lemari-pustaka {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #2c3e50;
    z-index: 200001 !important;
    overflow-y: auto;
    padding-bottom: 50px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: block !important; 
}

#lemari-pustaka.active {
    transform: translateY(0);
}

.lemari-header {
    background: #1a252f;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border-bottom: 1px solid #34495e;
}

.lemari-rak {
    padding: 20px 10px;
    background-image: linear-gradient(#34495e 1px, transparent 1px);
    background-size: 100% 160px; 
    background-position: 0 140px; 
}

.book-cover {
    display: block;
    background: #3498db;
    border-radius: 5px 10px 10px 5px; 
    height: 120px;
    position: relative;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    text-decoration: none;
    overflow: hidden;
    border-left: 6px solid rgba(0,0,0,0.2); 
}

.book-cover:hover { transform: translateY(-5px); }
.book-item:nth-child(odd) .book-cover { background: #e74c3c; } 
.book-item:nth-child(3n) .book-cover { background: #27ae60; } 
.book-item:nth-child(4n) .book-cover { background: #8e44ad; } 

.cover-design {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.book-title {
    font-size: 9px;
    color: white;
    font-weight: bold;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.book-number { 
    font-size: 10px; 
    letter-spacing: 0.5px; 
}

#result-section {
    padding: 25px;
    margin-top: -15px;
    min-height: 80vh;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, #203a43 0%, #2c5364 100%) !important;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 9999;
}

.detail-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #16a085;
}

.label-detail {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-detail {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0;
}

.text-warning-custom { color: #f39c12; }

#form-lapor .form-control {
    background-color: #ffffff !important;
    color: #333 !important;
    border: 2px solid #ddd;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 100000;
}

#form-lapor input[readonly] {
    background-color: #e9ecef !important;
    color: #555 !important;
}

.btn-success {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff;
}

.btn-success:hover { 
    background-color: #0d47a1 !important;
    border-color: #0d47a1 !important;
}

.btn-scan {
    background-color: #cdd3d8 !important;
    border-color: #cdd3d8 !important;
    color: #000;
}

.btn-scan:hover { 
    background-color: #bfc6cd !important;
    border-color: #bfc6cd !important;
}

/* Modal Lacak */
#modal-lacak {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.8); 
    z-index: 99999; 
    justify-content: center; 
    align-items: center;
}

.modal-lacak-content {
    background: white; 
    padding: 30px; 
    border-radius: 20px; 
    width: 90%; 
    max-width: 400px; 
    text-align: center; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: popIn 0.3s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}