:root {
    --bg-slate: #060918;
    --card-slate: rgba(30, 41, 59, 0.7);
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --brand-orange: #FF6735;
    --brand-blue: #004E89;
    --success-green: #2ECC71;
    --warning-amber: #F1C40F;
    --border-glass: rgba(255, 255, 255, 0.1);
    --frame-white: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background-color: var(--bg-slate);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(255, 103, 53, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 78, 137, 0.1) 0%, transparent 40%);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.app-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-slate);
}

.mini-logo {
    height: 32px;
    width: auto;
}

.header-text h1 {
    font-size: 1rem;
    font-weight: 700;
}

.header-text p {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--card-slate);
    text-transform: uppercase;
}

/* Scanner Zone (70%) */
.scanner-zone {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.scanner-viewport {
    width: 100%;
    height: 100%;
    position: relative;
}

.qr-reader-view {
    width: 100%;
    height: 100%;
}

/* Video element within reader */
.qr-reader-view video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

/* Main Scanner Frame Container */
.scan-frame {
    width: 280px;
    height: 280px;
    position: relative;
    border-radius: 40px;
    /* Full border removed as per user request */
    border: none;
    background: transparent;
}

/* Floating L-Shaped Corners */
.scan-frame::before,
.scan-frame::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: #FFFFFF;
    border-style: solid;
    z-index: 10;
}

/* Custom divs for bottom corners */
.scan-corner-bottom-left,
.scan-corner-bottom-right {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: #FFFFFF;
    border-style: solid;
    z-index: 10;
}

/* Top Left */
.scan-frame::before {
    top: 0;
    left: 0;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 12px;
}

/* Top Right */
.scan-frame::after {
    top: 0;
    right: 0;
    border-width: 4px 4px 0 0;
    border-top-right-radius: 12px;
}

/* Bottom Left */
.scan-corner-bottom-left {
    bottom: 0;
    left: 0;
    border-width: 0 0 4px 4px;
    border-bottom-left-radius: 12px;
}

/* Bottom Right */
.scan-corner-bottom-right {
    bottom: 0;
    right: 0;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 12px;
}

/* Hidden elements from library - Very aggressive to remove those L-shapes */
#qr-reader__scan_region, 
#qr-reader__scan_region div,
[id^="qr-reader__scan_region"] div {
    border: none !important;
    box-shadow: none !important;
}

#qr-reader__dashboard {
    display: none !important;
}

/* Scanning Laser Animation - Refined */
.scan-laser {
    position: absolute;
    top: 50%;
    left: 15px;
    right: 15px;
    height: 4px;
    background: linear-gradient(to right, 
        transparent 0%, 
        white 20%, 
        var(--brand-orange) 50%, 
        white 80%, 
        transparent 100%
    );
    box-shadow: 
        0 0 15px var(--brand-orange),
        0 0 25px rgba(255, 103, 53, 0.4);
    border-radius: 50%;
    animation: laser-sweep 2.2s linear infinite;
    z-index: 5;
}

/* Add a moving glow "field" behind the laser */
.scan-laser::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, 
        rgba(255, 103, 53, 0.15) 0%, 
        transparent 100%
    );
    pointer-events: none;
}

@keyframes laser-sweep {
    0% { top: 0%; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.frame-hint {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,1);
}

/* Status Zone */
.feedback-zone {
    padding: 1.5rem 1rem;
    background: var(--bg-slate);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--border-slate);
    z-index: 10;
}

.status-indicator {
    width: 100%;
    max-width: 320px;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
}

.status-indicator i {
    display: none;
}

.status-indicator.idle { background: var(--card-slate); color: var(--text-secondary); }
.status-indicator.scanning { background: rgba(255, 103, 53, 0.2); color: var(--brand-orange); border-color: var(--brand-orange); }
.status-indicator.success { background: rgba(46, 204, 113, 0.2); color: var(--success-green); border-color: var(--success-green); box-shadow: 0 0 20px rgba(46, 204, 113, 0.15); }
.status-indicator.error { background: rgba(255, 77, 77, 0.2); color: #FF4D4D; border-color: #FF4D4D; }
.status-indicator.warning { background: rgba(241, 196, 15, 0.2); color: var(--warning-amber); border-color: var(--warning-amber); }

.status-indicator.scanning .icon-scanning { display: block; }
.status-indicator.success .icon-success { display: block; }
.status-indicator.error .icon-error { display: block; }

/* Participant Card */
.participant-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 2rem;
    z-index: 100;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.participant-card.active {
    transform: translateY(0);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 60%, var(--brand-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    background: var(--success-green);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.detail-item span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
}

.btn-secondary:hover {
    opacity: 1;
    color: var(--brand-orange);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-orange), #FF8552);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(255, 103, 53, 0.3);
}

.btn-sm { padding: 0.5rem 1rem; }

/* Footer */
.app-footer {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-secondary);
    background: var(--bg-slate);
}

.version { opacity: 0.5; margin-left: 4px; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: var(--card-slate);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.modal-content h3 { margin-bottom: 0.5rem; }
.modal-content p { color: var(--text-secondary); margin-bottom: 1.5rem; }

.modal-content input {
    width: 100%;
    background: #000;
    border: 2px solid var(--border-slate);
    border-radius: 8px;
    color: white;
    padding: 1rem;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 2px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hidden { display: none !important; }

/* Camera Permission Warning */
.camera-warning {
    position: absolute;
    inset: 0;
    background: var(--bg-slate);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 5;
}

.camera-warning i {
    font-size: 3rem;
    color: var(--brand-red);
    margin-bottom: 1rem;
}
#qr-shaded-region > div{
    display: none;
}

