:root {
    --bg-color: #0a0c10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent-color: #00f2fe;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Background gradient blobs */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(50px);
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(50px);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 2px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 300;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

#reader-container {
    width: 100%;
    aspect-ratio: 1;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

#reader {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Hide html5-qrcode's default UI elements */
#reader__scan_region, 
#reader__dashboard,
#reader img,
#reader span {
    display: none !important;
}

#reader video {
    object-fit: cover !important;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.top-left { top: 20px; left: 20px; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.top-right { top: 20px; right: 20px; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.bottom-left { bottom: 20px; left: 20px; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.bottom-right { bottom: 20px; right: 20px; border-left: none; border-top: none; border-radius: 0 0 12px 0; }

.scan-line {
    position: absolute;
    top: 50px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: scan 2.5s ease-in-out infinite;
    box-shadow: 0 0 15px var(--accent-color);
}

@keyframes scan {
    0%, 100% { top: 50px; opacity: 0.2; }
    50% { top: calc(100% - 50px); opacity: 1; }
}

.status-panel {
    text-align: center;
    width: 100%;
}

#status-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.result-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.url-text {
    font-size: 0.8rem;
    color: var(--success-color);
    word-break: break-all;
    max-width: 100%;
    font-family: monospace;
}

.copy-badge {
    font-size: 0.7rem;
    background: var(--success-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

#restart-btn, .secondary-btn {
    width: 100%;
    border: none;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#restart-btn {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    color: #0a0c10;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.secondary-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.secondary-btn:active, #restart-btn:active {
    transform: scale(0.98);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.hidden {
    display: none !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(255, 255, 255, 0.9);
    color: #0a0c10;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Mobile specific styling adjustments */
@media (max-width: 400px) {
    .app-container {
        padding: 1.5rem 1rem;
    }
    
    #reader-container {
        border-radius: 20px;
    }
}
