body {
    background-image: url('/static/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
} 

/* --- QR Scanner Notifications --- */
.qr-notification {
    animation: qrNotificationSlideIn 0.3s ease-out;
}

.qr-notification-overlay {
    animation: qrNotificationFadeIn 0.3s ease-out;
}

@keyframes qrNotificationSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes qrNotificationFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.qr-notification .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

.qr-notification .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

.qr-notification .alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 2px solid #17a2b8;
    color: #0c5460;
}

.qr-notification .btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.qr-notification .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* --- Modal Z-Index Fixes --- */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

/* Убеждаемся, что модальные окна всегда поверх уведомлений */
.modal.show {
    z-index: 1055 !important;
}

.modal-backdrop.show {
    z-index: 1045 !important;
}

/* --- Дизайн в стиле design1.jpg для .card-header.stats-header-green --- */
.card-header.stats-header-green {
    background: #1a1915 !important;
    color: #f5f5f5 !important;
    border-radius: 8px 8px 0 0;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}
.card-header.stats-header-green h3,
.card-header.stats-header-green h5 {
    color: #f5f5f5 !important;
}
.card-header.stats-header-green .btn-outline-light {
    border-color: #f5f5f5;
    color: #f5f5f5;
    background: transparent;
    transition: background 0.2s;
}
.card-header.stats-header-green .btn-outline-light:hover {
    background: #23221e;
    color: #fff;
}
.card-header.stats-header-green::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 220px;
    background: url('data:image/svg+xml;utf8,<svg width="220" height="60" viewBox="0 0 220 60" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity="0.22"><line x1="0" y1="15" x2="120" y2="15" stroke="%23555555" stroke-width="6" stroke-linecap="round"/><circle cx="120" cy="15" r="7" fill="%23555555"/><line x1="0" y1="30" x2="80" y2="30" stroke="%23555555" stroke-width="6" stroke-linecap="round"/><circle cx="80" cy="30" r="7" fill="%23555555"/><line x1="0" y1="45" x2="40" y2="45" stroke="%23555555" stroke-width="6" stroke-linecap="round"/><circle cx="40" cy="45" r="7" fill="%23555555"/></g></svg>') no-repeat left center;
    background-size: contain;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}
.card-header.stats-header-green > * {
    position: relative;
    z-index: 1;
}

/* --- Modern QR Scanner Styles --- */
.qr-scan-btn {
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.qr-scan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.qr-scan-btn:hover::before {
    left: 100%;
}

.camera-container {
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(233, 236, 239, 0.95) 100%);
    border: 1px solid rgba(222, 226, 230, 0.8);
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.05);
}

.camera-container video {
    border: 3px solid #28a745;
    box-shadow: 
        0 8px 24px rgba(40, 167, 69, 0.3),
        0 4px 12px rgba(0,0,0,0.1);
}

.scan-frame {
    animation: scanFramePulse 2s ease-in-out infinite;
}

@keyframes scanFramePulse {
    0%, 100% { 
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
        border-color: #28a745;
    }
    50% { 
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.6);
        border-color: #20c997;
    }
}

.scan-corner {
    animation: cornerGlow 1.5s ease-in-out infinite alternate;
}

@keyframes cornerGlow {
    from { 
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
        background: #28a745;
    }
    to { 
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
        background: #20c997;
    }
}

.scan-line {
    animation: scanAnimation 2s linear infinite;
}

@keyframes scanAnimation {
    0% { 
        transform: translateY(0); 
        opacity: 1;
        background: linear-gradient(90deg, transparent, #28a745, transparent);
    }
    50% { 
        transform: translateY(200px); 
        opacity: 0.8;
        background: linear-gradient(90deg, transparent, #20c997, transparent);
    }
    100% { 
        transform: translateY(0); 
        opacity: 1;
        background: linear-gradient(90deg, transparent, #28a745, transparent);
    }
}

/* Улучшенные стили для полей ввода с QR сканером */
.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    transition: all 0.3s ease;
}

/* Анимация для кнопок при наведении */
.qr-scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Стили для инструкций */
.camera-container .instructions {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,249,250,0.8) 100%);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    border-left: 4px solid #17a2b8;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .camera-container {
        padding: 16px;
        margin: 12px 0;
    }
    
    .camera-container video {
        max-width: 280px;
        height: 210px;
    }
    
    .scan-frame {
        width: 180px;
        height: 180px;
    }
    
    .qr-scan-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
} 