* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 32px 24px 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
h1{
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}
h1 a {
    
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 20px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #1e293b;
    border-radius: 60px;
    border: 2px solid #334155;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    color: #f1f5f9;
    outline: none;
    border-radius: 60px;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: #64748b;
}

.camera-btn {
    background: #3b6dad;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.camera-btn:hover {
    background: #1d6ef0;
    transform: scale(1.02);
    color: white;
}

.search-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border: none;
    padding: 14px;
    border-radius: 60px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.result-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    padding: 16px;
    border: 1px solid #334155;
}
.result-card p{
    color: #aaa;
    margin-top: 5px;
}
.result-card a{
    margin: 0 auto;
    text-decoration: none;
    background-color: #244dbd;
    font-size: 20px;
    padding: 6px;
    border-radius: 10px;
}
.result-card a{
    color: #ddd;
}
.result-card span{
    color: #eb7474;
}
.no-stock{
    color: #eb7474;
}
.code-value {
    background: #0f172a;
    padding: 12px;
    border-radius: 40px;
    text-align: center;
    font-family: monospace;
    font-size: 1.2rem;
    color: #86efac;
    margin-bottom: 12px;
    word-break: break-word;
}
.code-errvalue{
    background: #0f172a;
    padding: 12px;
    border-radius: 40px;
    text-align: center;
    font-family: monospace;
    font-size: 1.2rem;
    color: #ef8686;
    margin-bottom: 12px;
    word-break: break-word;
}
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.small-btn {
    padding: 8px 20px;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.small-btn.primary {
    background: #2563eb;
    color: white;
}

.small-btn.secondary {
    background: #334155;
    color: #e2e8f0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    z-index: 1000;
}

.modal.active {
    display: flex;
    flex-direction: column;
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
}

/* video {
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 🔥 КЛЮЧЕВОЕ */
    background: black;
}

.scan-rect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid #10b981;
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.modal-footer {
    padding: 16px;
    background: #111;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.close-modal-btn {
    background: #ef4444;
    border: none;
    padding: 12px 30px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.success-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

.stock-block {
    margin-top: 10px;
    background: #0f172a;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #334155;
}

.stock-block p {
    margin: 4px 0;
    color: #cbd5f5;
    font-size: 0.95rem;
}

@keyframes slideUp {
    from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    }
    to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    }
}

.suggest-item {
    padding: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    color: #ddf;
    width: calc(100% - 30px);
    margin: 1px auto 0 auto;
}

.suggest-item:hover {
    background: #334155;
}



.stock-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 14px;
    color: #e2e8f0;
}

.stock-table th {
    background: #1e293b;
    padding: 8px;
}

.stock-table td {
    padding: 8px;
    border-bottom: 1px solid #334155;
    text-align: center;
}

.suggest-item {
    padding: 10px;
    cursor: pointer;
}

.suggest-item:hover {
    background: #1e293b;
}



.pages-block{
    position: absolute;
    display: flex;
    color: #fff;
    left: 10px;
    flex-direction: column;
    top: 10px;
    background-color: #0f172a;
    padding: 10px;
    border-radius: 10px;
    width: 160px;

}
.pages-title{
    color: #fff;
    text-align: center;
}
.pages-block a{
    display: flex;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    margin-top: 5px;
    padding: 5px;
    background-color: #1b153b;
    width: auto;
    align-items: center;
    border: 1px solid #29215c;
    border-radius: 5px;
}
.pages-block a span{
    margin-right: 5px;
    color: #2563eb;
}
@media (max-width: 920px) {
    body{
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 10px;
        gap: 5px;
    }
    .pages-block{
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
        position: inherit;
        align-items: center;
        width: 100%;
        gap: 5px;
    }
    .pages-block a {
        margin-top: 0;
        margin-left: 5px;
    }
    .container{
        margin-top: auto;
        margin-bottom: auto
    }
}