/**
STAGE.HR VENDOR SCANNER APP STYLES
*/
.scanner-app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #1a1a2e;
    border-radius: 16px;
    color: white;
}

/* Header */
.scanner-header {
    text-align: center;
    margin-bottom: 20px;
}

.scanner-header h2 {
    margin: 0 0 10px;
    color: white;
}

.scanner-status {
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    font-size: 14px;
}

#scanner-status-text.ready { background: #2ecc71; color: white; }
#scanner-status-text.scanning { background: #3498db; color: white; }
#scanner-status-text.checking { background: #f39c12; color: white; }

/* Mode Switcher */
.scanner-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.mode-btn.active {
    background: #3498db;
    border-color: #2980b9;
}

/* Scanner View - POPRAVLJENO */
.scanner-view {
    position: relative; /* KLJUČNO: mora biti relative za apsolutno pozicioniranje djece! */
    display: none;
    margin-bottom: 20px;
}

.scanner-view.active {
    display: block;
}

#scanner-video {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    background: #000;
    object-fit: cover; /* DODANO: bolje prikazivanje videa */
    display: block; /* DODANO: uklanja dodatni prostor */
}

.scanner-overlay {
    position: absolute; /* PROMIJENJENO: iz relative u absolute */
    top: 0; /* DODANO: poklopi se s vrhom videa */
    left: 0; /* DODANO */
    right: 0; /* DODANO */
    bottom: 0; /* DODANO: poklopi se s dnom videa */
    margin-top: 0; /* UKLONJENO: bio je -200px */
    height: auto; /* PROMIJENJENO: iz 200px u auto */
    pointer-events: none;
    display: flex; /* DODANO: za centriranje */
    align-items: center; /* DODANO: vertikalno centriranje */
    justify-content: center; /* DODANO: horizontalno centriranje */
}

.scanner-frame {
    position: relative; /* PROMIJENJENO: iz absolute u relative */
    width: 200px;
    height: 200px;
    border: 3px solid #3498db;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    /* UKLONJENO: top, left, transform nisu potrebni s flexbox centriranjem */
}

.scanner-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.scanner-controls button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2ecc71;
    color: white;
}

.btn-primary:hover {
    background: #27ae60;
}

.btn-secondary {
    background: #e74c3c;
    color: white;
}

.btn-secondary:hover {
    background: #c0392b;
}

/* Manual Entry */
#manual-ticket-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#manual-ticket-code {
    padding: 16px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#manual-ticket-code::placeholder {
    color: rgba(255,255,255,0.5);
}

/* Scan Result */
.scan-result {
    display: none;
    margin: 20px 0;
    padding: 20px;
    border-radius: 12px;
    animation: slideIn 0.3s;
}

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

.scan-result.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.scan-result.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.ticket-valid h3, .ticket-invalid h3, .check-in-success h3 {
    margin: 0 0 15px;
    font-size: 24px;
}

.ticket-details-large {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.ticket-details-large div {
    margin: 8px 0;
    font-size: 16px;
}

.btn-check-in {
    width: 100%;
    padding: 16px;
    background: white;
    color: #2ecc71;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.btn-check-in:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* Scan History */
.scan-history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(255,255,255,0.1);
}

.scan-history h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-time {
    font-size: 12px;
    color: #95a5a6;
}

.history-code {
    font-weight: 600;
    font-family: monospace;
}

.history-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}

.history-status.valid {
    background: #2ecc71;
}

.history-status.invalid {
    background: #e74c3c;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .scanner-app-container {
        padding: 15px;
    }
    
    .scanner-frame {
        width: 150px;
        height: 150px;
    }
}