/* CSS for Public Inventory View & Mobile Optimization - NEAT & MODERN */

.public-scan-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.kode-inv-box {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: inline-block;
    max-width: 100%;
}

.kode-inv-text {
    color: #0B3D91;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: 1px;
    word-break: break-all; /* Prevent overflow */
    font-size: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f5;
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

.detail-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 0 0 40%;
}

.detail-value {
    color: #212529;
    font-weight: 600;
    text-align: right;
    flex: 0 0 60%;
    word-break: break-word;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .public-scan-card {
        margin-bottom: 2rem;
    }

    .kode-inv-box {
        padding: 0.8rem 1rem;
    }

    .kode-inv-text {
        font-size: 1.25rem;
    }

    .detail-item {
        flex-direction: column; /* Stack vertically for neatness */
        align-items: flex-start;
        padding: 10px 0;
    }

    .detail-label {
        flex: 0 0 100%;
        margin-bottom: 4px;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .detail-value {
        flex: 0 0 100%;
        text-align: left;
        font-size: 1rem;
    }

    .card-header {
        padding: 1.5rem 1rem !important;
    }

    .card-header h4 {
        font-size: 1.1rem;
    }

    /* SCOPED BUTTONS - Only target buttons inside scan/detail containers */
    .public-scan-card .btn, 
    #scanner-section .btn,
    #detail-section .btn {
        width: 100% !important;
        margin-bottom: 0.5rem;
        display: block;
    }

    /* Exceptions for small inline buttons if any */
    .public-scan-card .btn-sm {
        width: auto !important;
        display: inline-block !important;
    }

    /* Scanner UI Fix */
    #qr-reader {
        border-radius: 15px !important;
        overflow: hidden;
        border: none !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    
    #qr-reader__scan_region video {
        border-radius: 15px !important;
    }

    /* Prevent any horizontal scroll */
    body, html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
}
