.btn-file-upload {
    position: relative;
    color: #ffff !important;
}

.btn-file-upload input {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    filter: alpha(opacity=0);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    opacity: 0;
    background-color: transparent;
    color: transparent;
    cursor: pointer;
}

.btn-custom-tools {
    position: relative;
    color: #fff;
    border: 0;
    margin: 0;
    border-radius: 3px;
    line-height: 24px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 500;
    padding: 10px 15px;
    background-color: transparent;
    transition: 0.3s background-color 0s;
}

.btn-table-delete {
    display: none;
}

.btn-custom-tools:hover,
.btn-custom-tools:focus {
    color: #fff;
}

/* Realtime Date Time Styles */
#realtimeDate,
#realtimeDateNav,
#realtimeDateCard1,
#realtimeDateCard2,
#realtimeDateScan {
    font-size: 0.875rem;
    line-height: 1.2;
}

#realtimeTime,
#realtimeTimeNav,
#realtimeTimeCard1,
#realtimeTimeCard2,
#realtimeTimeScan {
    font-size: 0.875rem;
    font-weight: bold;
    line-height: 1.2;
}

.navbar-nav #realtimeDateTime {
    padding: 8px 12px;
    min-width: 200px;
}

.navbar-nav #realtimeDateTime i {
    vertical-align: middle;
    margin-right: 5px;
}

/* Responsive untuk waktu realtime */
@media (max-width: 991px) {
    .navbar-nav #realtimeDateTime {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    #realtimeDate,
    #realtimeTime {
        font-size: 0.75rem;
    }
}

.card-data {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Spinner styles */
.spinner {
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-left-color: #9c27b0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    display: block;
    /* Hidden by default */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*spinner*/
.spinner-bounce {
    margin: 0 auto;
    width: 70px;
    text-align: center;
}

.spinner-bounce > div {
    width: 18px;
    height: 18px;
    background-color: #9c27b0;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner-bounce .bounce1 {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}

.spinner-bounce .bounce2 {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
    0%, 80%, 100% {
        -webkit-transform: scale(0)
    }
    40% {
        -webkit-transform: scale(1.0)
    }
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    40% {
        -webkit-transform: scale(1.0);
        transform: scale(1.0);
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .card-header-tabs .nav-tabs {
        flex-wrap: wrap;
    }
    
    .card-header-tabs .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-panel {
        width: 100% !important;
    }
    
    video#previewKamera {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 250px;
    }
    
    /* Fix button groups on mobile */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Fix table actions on mobile */
    .table td .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .table td .btn {
        width: 100%;
    }
    
    /* Fix form spacing */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Fix card header on mobile */
    .card-header-tabs .row {
        flex-direction: column;
    }
    
    .card-header-tabs .ml-md-auto {
        margin-left: 0 !important;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .card-stats {
        margin-bottom: 1rem;
    }
    
    .card-stats .card-title {
        font-size: 1.5rem;
    }
}

/* Error Message Styles */
.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* ============================================
   INTERACTIVE & RESPONSIVE STYLES
   ============================================ */

/* Card Hover Effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

.card-stats:hover {
    transform: translateY(-6px) scale(1.02);
}

.card-stats .card-icon {
    transition: transform 0.3s ease;
}

.card-stats:hover .card-icon {
    transform: scale(1.1);
}

/* Button Interactive */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Table Row Hover */
.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

/* Form Input Focus */
.form-control:focus,
.custom-select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25) !important;
}

/* Navbar Link Hover */
.navbar-nav .nav-link {
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Alert Animation */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Video Preview */
#previewKamera {
    transition: transform 0.3s ease;
}

#previewKamera:hover {
    transform: scale(1.01);
}

/* Material Icons Hover */
.material-icons {
    transition: transform 0.3s ease;
}

.card-stats:hover .material-icons {
    transform: rotate(5deg);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .card-stats:hover {
        transform: translateY(-3px);
    }
    
    .btn:hover {
        transform: translateY(-1px);
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-2px);
    }
    
    .card-stats:hover {
        transform: translateY(-2px) scale(1);
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 16px;
    }
    
    /* Larger tap targets */
    .nav-link {
        padding: 12px 16px;
        min-height: 44px;
    }
    
    /* Improved spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }
    
    /* Prevent zoom on input focus (iOS) */
    .form-control,
    .custom-select {
        font-size: 16px;
    }
    
    /* Better mobile navigation */
    .navbar-collapse {
        margin-top: 10px;
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.95);
        border-radius: 8px;
    }
    
    /* Full width buttons on mobile */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
    }
}

/* Small Mobile (max-width: 576px) */
@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-stats .card-icon {
        font-size: 2rem;
    }
    
    /* Stack everything */
    .row > [class*='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .card:hover,
    .btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .navbar,
    .sidebar,
    .btn {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Active State */
.touch-active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Button Processing State */
.btn.processing {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Navbar Scrolled */
.navbar-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Table Active Row */
.table tbody tr.table-active {
    background-color: rgba(25, 118, 210, 0.1);
    border-left: 3px solid #1976d2;
}

/* Form Valid State */
.form-control.is-valid,
.custom-select.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}