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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.camera-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    background: #000000;
}

#camera {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: env(safe-area-inset-top, 20px) 20px 20px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.header-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
}

.info-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: -0.2px;
}

.value {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.controls {
    background: #ffffff;
    padding: 20px 20px calc(env(safe-area-inset-bottom, 20px) + 20px) 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

button {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:active {
    background: #1c1c1e;
    transform: scale(0.98);
}

.btn-secondary {
    background: #f2f2f7;
    color: #000000;
}

.btn-secondary:active {
    background: #e5e5ea;
    transform: scale(0.98);
}

button svg {
    width: 20px;
    height: 20px;
}

.permission-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.message-content {
    text-align: center;
    max-width: 320px;
}

.message-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    color: #000000;
}

.message-content p {
    font-size: 16px;
    line-height: 1.5;
    color: #8e8e93;
    margin-bottom: 24px;
}

.message-content .btn-primary {
    width: 100%;
}

/* Landscape mode adjustments */
@media (orientation: landscape) {
    .overlay {
        top: auto;
        bottom: 0;
        left: auto;
        right: 0;
        width: auto;
        max-width: 380px;
        padding: 16px;
        background: linear-gradient(to left, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
        align-items: flex-end;
    }
    
    .header-text {
        font-size: 16px;
        margin-bottom: 10px;
        text-align: right;
    }
    
    .info-container {
        padding: 10px 12px;
        border-radius: 12px;
        max-width: 100%;
    }
    
    .info-row {
        padding: 5px 0;
    }
    
    .label, .value {
        font-size: 11px;
    }
    
    .controls {
        padding: 12px;
        flex-direction: column;
        width: auto;
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        border-top: none;
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 0 12px 12px 0;
    }
    
    button {
        padding: 12px;
        font-size: 0;
        min-width: 48px;
        min-height: 48px;
    }
    
    button span {
        display: none;
    }
    
    button svg {
        width: 24px;
        height: 24px;
    }
}

/* Animation for loading state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.value.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
