@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&family=Outfit:wght@600;700&display=swap');

:root {
    --bg: #ffffff;
    --surface: #f0fafc;
    --card: #ffffff;
    --brand: #00d1b2;
    --brand-glow: rgba(0, 209, 178, 0.2);
    --brand-dim: rgba(0, 209, 178, 0.05);
    --accent: #0077ff;
    --text: #1a2b3c;
    --muted: #8096b0;
    --border: rgba(0, 209, 178, 0.1);
}

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

body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 100% 0%, #e0fff9 0%, transparent 40%),
        radial-gradient(circle at 0% 100%, #e0f2ff 0%, transparent 40%);
    color: var(--text);
    font-family: 'Montserrat', system-ui, sans-serif;
    min-height: 100vh;
    padding-bottom: 40px;
}

.header {
    padding: 32px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a2b3c;
}

.logo span {
    color: var(--brand);
}

.btn-install {
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

.app-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 20px;
}

.pharma-hero {
    margin-bottom: 24px;
    text-align: center;
}

.pharma-hero h2 {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--brand);
}

.pharma-hero p {
    color: var(--muted);
    font-size: 13px;
}

.scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 209, 178, 0.1);
    margin-bottom: 32px;
}

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

.pharma-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 100px;
    border: 2px solid var(--brand);
    border-radius: 12px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4);
}

.scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 270px;
    height: 2px;
    background: var(--brand);
    box-shadow: 0 0 15px var(--brand);
    display: none;
}

.scan-line.active {
    display: block;
    animation: scanPharma 2s infinite ease-in-out;
}

@keyframes scanPharma {
    0% {
        transform: translate(-50%, -150%);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 150%);
        opacity: 0;
    }
}

.btn-scan {
    width: 100%;
    padding: 22px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--brand-glow);
}

.hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 16px;
    text-align: center;
}

.pharma-history {
    margin-top: 40px;
}

.pharma-history h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 85vh;
    background: #fff;
    border-top: 5px solid var(--brand);
    border-radius: 32px 32px 0 0;
    z-index: 1000;
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
}

.result-panel.visible {
    bottom: 0;
}

.panel-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nu-chip {
    padding: 6px 14px;
    background: var(--brand-dim);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    border-radius: 30px;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.panel-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.btn-main {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--brand);
    background: var(--brand-dim);
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text);
}

.res-text h3 {
    color: var(--brand);
    margin-bottom: 15px;
}

.res-text p {
    margin-bottom: 12px;
    font-size: 14px;
    color: #444;
}