@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

:root {
    --app-font: "Be Vietnam Pro", system-ui, sans-serif;
    --ink: #0f172a;
    --muted: #4b5b78;
    --line: rgba(15, 76, 189, 0.12);
    --brand: #0f4cbd;
    --brand-strong: #0a3a92;
    --brand-soft: #eaf3ff;
    --brand-pale: #f6faff;
    --accent: #3b82f6;
    --accent-soft: #dbeafe;
    --card-shadow: 0 20px 45px rgba(15, 76, 189, 0.1);
    --admin-bg:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
    --screen-bg:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.62), transparent 25%),
        radial-gradient(circle at top right, rgba(248, 252, 255, 0.42), transparent 25%),
        radial-gradient(circle at bottom right, rgba(224, 242, 254, 0.3), transparent 32%),
        linear-gradient(135deg, #f7fcff 0%, #e5f6ff 38%, #c9ecff 72%, #9fdcff 100%);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--app-font);
    color: var(--ink);
}

.app-credit {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.86rem;
    color: rgba(75, 91, 120, 0.88);
}

.screen-page .app-credit {
    color: rgba(240, 249, 255, 0.92);
}

.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(15, 76, 189, 0.1);
    color: var(--brand-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vote-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.22), transparent 24%),
        radial-gradient(circle at bottom left, rgba(191, 219, 254, 0.35), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #eff6ff 52%, #f8fbff 100%);
}

.event-brand {
    display: grid;
    grid-template-columns: minmax(90px, 170px) 1fr minmax(90px, 170px);
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid rgba(15, 76, 189, 0.12);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 34px rgba(15, 76, 189, 0.08);
}

.event-brand--screen {
    background: rgba(255, 255, 255, 0.38);
    border-color: rgba(255, 255, 255, 0.44);
    box-shadow: 0 18px 38px rgba(7, 65, 128, 0.12);
    backdrop-filter: blur(14px);
}

.brand-logo-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 88px;
}

.brand-logo-group--left {
    justify-content: flex-start;
}

.brand-logo-group--right {
    justify-content: flex-end;
}

.brand-logo-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    padding: 0.7rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 76, 189, 0.12);
    box-shadow: 0 12px 24px rgba(15, 76, 189, 0.08);
}

.event-brand--screen .brand-logo-shell {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(125, 211, 252, 0.4);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
}

.brand-unit-title {
    color: var(--brand-strong);
    font-size: clamp(1.1rem, 1rem + 0.8vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-event-label {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.98rem;
    font-weight: 600;
}

.event-brand--screen .brand-unit-title,
.event-brand--screen .brand-event-label {
    color: #0b4f7e;
}

.event-brand--screen .brand-event-label {
    color: rgba(11, 79, 126, 0.78);
}

.vote-hero,
.hero-side-card,
.chart-shell,
.screen-summary-card,
.admin-card,
.form-shell {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.vote-hero {
    padding: 2.25rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.98) 100%);
}

.vote-hero .display-5 {
    font-size: clamp(1.85rem, 1.35rem + 2vw, 2.7rem);
    line-height: 1.18;
}

.vote-title-single-line {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    letter-spacing: -0.015em;
    font-size: clamp(1.4rem, 0.95rem + 1.35vw, 2.05rem) !important;
    line-height: 1.14;
}

.vote-hero::before {
    content: "";
    position: absolute;
    inset: auto -60px -70px auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0));
    pointer-events: none;
}

.vote-hero::after {
    content: "";
    position: absolute;
    top: -40px;
    right: 18%;
    width: 120px;
    height: 120px;
    border-radius: 2rem;
    transform: rotate(22deg);
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.42), rgba(59, 130, 246, 0.04));
    pointer-events: none;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-meta span {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 76, 189, 0.08);
    color: var(--brand-strong);
    font-size: 0.92rem;
    font-weight: 600;
}

.hero-side-card {
    padding: 1.25rem 1.35rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(234, 243, 255, 0.96));
}

.share-toolbox {
    margin-top: 1rem;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.share-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 76, 189, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.share-icon-btn:hover,
.share-icon-btn:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 76, 189, 0.18);
}

.share-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-icon-btn--native {
    background: linear-gradient(135deg, #0f4cbd 0%, #3b82f6 100%);
}

.share-icon-btn--facebook {
    background: #1877f2;
}

.share-icon-btn--zalo {
    background: #0068ff;
    width: 58px;
    border-radius: 14px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.share-label {
    line-height: 1;
}

.share-icon-btn--telegram {
    background: #229ed9;
}

.share-icon-btn--copy {
    background: #475569;
}

.share-icon-btn--mail {
    background: #f59e0b;
}

.vote-card {
    overflow: hidden;
    border: 1px solid rgba(15, 76, 189, 0.12);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 34px rgba(15, 76, 189, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.vote-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 42px rgba(15, 76, 189, 0.14);
}

.vote-card.is-selected {
    border-color: rgba(15, 76, 189, 0.4);
    box-shadow: 0 24px 48px rgba(15, 76, 189, 0.18);
}

.product-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
}

.btn-vote {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: #fff;
    font-weight: 800;
    padding: 0.95rem 1.2rem;
    box-shadow: 0 14px 28px rgba(15, 76, 189, 0.2);
}

.btn-vote:hover,
.btn-vote:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
}

.btn-vote:disabled {
    opacity: 0.78;
    box-shadow: none;
}

.admin-page {
    min-height: 100vh;
    background: var(--admin-bg);
}

.admin-navbar {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 76, 189, 0.08);
}

.navbar-brand {
    color: var(--brand-strong) !important;
}

.admin-navbar .nav-link {
    color: var(--muted);
    font-weight: 600;
}

.admin-navbar .nav-link.active,
.admin-navbar .nav-link:hover {
    color: var(--brand-strong);
}

.admin-card,
.form-shell {
    padding: 1.5rem;
}

.table-responsive,
.form-shell {
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(15, 76, 189, 0.06);
}

.thumb-sm {
    width: 68px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.85rem;
    background: #f8fbff;
}

.login-card {
    max-width: 480px;
    margin: 8vh auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96));
}

.login-card::before {
    content: "";
    position: absolute;
    top: -55px;
    right: -55px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.24), rgba(96, 165, 250, 0));
}

.screen-page {
    position: relative;
    background: var(--screen-bg);
    color: #0b4f7e;
    overflow-x: hidden;
}

.screen-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--screen-watermark, none);
    background-repeat: no-repeat;
    background-position: center 58%;
    background-size: min(42vw, 520px);
    opacity: 0.07;
    filter: grayscale(1) brightness(2.35);
    pointer-events: none;
    z-index: 0;
}

.screen-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.24), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 34%);
    pointer-events: none;
    z-index: 0;
}

.screen-page > * {
    position: relative;
    z-index: 1;
}

.screen-page .text-secondary {
    color: rgba(11, 79, 126, 0.78) !important;
}

.chart-shell .text-secondary,
.screen-summary-card .text-secondary,
.screen-result-item .text-secondary {
    color: rgba(240, 249, 255, 0.9) !important;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.screen-summary-card,
.chart-shell {
    background:
        linear-gradient(180deg, rgba(14, 100, 181, 0.46), rgba(10, 81, 151, 0.4));
    border-color: rgba(255, 255, 255, 0.26);
    color: #f8fbff;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 42px rgba(7, 65, 128, 0.14);
}

.screen-summary-card {
    min-width: 180px;
    padding: 1.2rem 1.25rem;
}

.screen-summary-label {
    display: block;
    color: rgba(239, 246, 255, 0.78);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.screen-summary-value {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 0.45rem;
}

.chart-shell {
    padding: 1.5rem;
}

.chart-wrap {
    min-height: 460px;
}

.screen-results-list {
    display: grid;
    gap: 1rem;
}

.screen-result-item {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(219, 234, 254, 0.16);
}

.screen-progress {
    height: 0.72rem;
    background: rgba(255, 255, 255, 0.24);
}

.screen-progress .progress-bar {
    background: linear-gradient(135deg, #fde68a 0%, #fdba74 48%, #fda4af 100%);
}

.screen-gallery-shell {
    padding: 1.35rem 1.5rem;
}

.screen-icon-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #f8fbff;
    box-shadow: 0 12px 24px rgba(7, 65, 128, 0.14);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.screen-icon-toggle:hover,
.screen-icon-toggle:focus {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.42);
}

.screen-icon-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.screen-products-grid {
    align-items: stretch;
}

.screen-product-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.24);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 249, 255, 0.92));
    box-shadow: 0 20px 38px rgba(7, 65, 128, 0.14);
}

.screen-product-card .product-thumb {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.82), rgba(191, 219, 254, 0.9));
}

.screen-product-body .card-title {
    color: #0b4f7e;
}

.screen-product-body .card-text,
.screen-product-votes .text-secondary {
    color: rgba(11, 79, 126, 0.78) !important;
}

.screen-product-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 76, 189, 0.92);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(15, 76, 189, 0.2);
}

.screen-product-votes {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 76, 189, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.screen-product-votes strong {
    font-size: 1.35rem;
    color: #0b4f7e;
}

.screen-ranking-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 28, 61, 0.28);
    backdrop-filter: blur(4px);
    z-index: 20;
}

.screen-ranking-panel {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    width: min(420px, calc(100vw - 2rem));
    padding: 1.35rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(14, 100, 181, 0.78), rgba(10, 81, 151, 0.74));
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 24px 48px rgba(7, 65, 128, 0.24);
    backdrop-filter: blur(18px);
    z-index: 30;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.screen-ranking-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.screen-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.screen-ranking-header h2,
.screen-ranking-header .text-secondary {
    color: #fff !important;
}

.screen-ranking-panel .screen-results-list {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.presentation-actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.presentation-page .chart-shell {
    background:
        linear-gradient(180deg, rgba(14, 100, 181, 0.5), rgba(10, 81, 151, 0.42));
}

.presentation-sidebar,
.presentation-viewer-shell {
    padding: 1.35rem;
}

.presentation-list {
    display: grid;
    gap: 0.85rem;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.presentation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(219, 234, 254, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.09);
    color: #f8fbff;
    text-align: left;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.presentation-item:hover,
.presentation-item:focus {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.34);
}

.presentation-item.is-active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.46);
    box-shadow: 0 14px 28px rgba(7, 65, 128, 0.16);
}

.presentation-item-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 800;
    flex-shrink: 0;
}

.presentation-item-copy {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.presentation-item-copy strong {
    color: #fff;
    font-size: 1rem;
}

.presentation-item-copy span {
    color: rgba(240, 249, 255, 0.84);
    font-size: 0.92rem;
    line-height: 1.45;
}

.presentation-viewer-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.presentation-viewer-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.presentation-viewer-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.presentation-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #f8fbff;
    font-weight: 700;
}

.presentation-viewer-frame {
    flex: 1;
    min-height: 68vh;
    padding: 0.65rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.presentation-frame {
    width: 100%;
    height: 100%;
    min-height: calc(68vh - 1.3rem);
    border: 0;
    border-radius: 1rem;
    background: #fff;
}

.presentation-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.presentation-empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.qr-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid var(--line);
}

.qr-preview img {
    width: 220px;
    max-width: 100%;
    height: auto;
}

.table > :not(caption) > * > * {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.form-control,
.form-select {
    border-color: rgba(15, 76, 189, 0.16);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
}

.btn-dark {
    background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
    border-color: var(--brand-strong);
}

.btn-dark:hover,
.btn-dark:focus {
    background: linear-gradient(135deg, #08327e 0%, var(--brand-strong) 100%);
    border-color: #08327e;
}

.btn-outline-dark {
    color: var(--brand-strong);
    border-color: rgba(15, 76, 189, 0.32);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
}

.btn-outline-primary {
    color: var(--brand);
    border-color: rgba(59, 130, 246, 0.34);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--brand);
    border-color: var(--brand);
}

@media (max-width: 991.98px) {
    .event-brand {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 1rem 1.1rem;
    }

    .brand-logo-group,
    .brand-logo-group--left,
    .brand-logo-group--right {
        justify-content: center;
        min-height: auto;
    }

    .brand-logo-group {
        gap: 0.65rem;
    }

    .brand-logo-group--left {
        order: 1;
    }

    .brand-logo-group--right {
        order: 2;
    }

    .brand-copy {
        order: 3;
        width: 100%;
        margin-top: 0.35rem;
    }

    .brand-logo-shell {
        width: 72px;
        height: 72px;
    }

    .vote-hero {
        padding: 1.5rem;
    }

    .hero-meta {
        gap: 0.6rem;
    }

    .hero-meta span {
        font-size: 0.84rem;
    }

    .screen-summary-card {
        min-width: 150px;
    }

    .chart-wrap {
        min-height: 320px;
    }

    .screen-gallery-shell {
        padding: 1.15rem;
    }

    .screen-ranking-panel {
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: auto;
    }

    .screen-ranking-panel .screen-results-list {
        max-height: calc(100vh - 240px);
    }

    .presentation-actions {
        justify-content: flex-start;
    }

    .presentation-list {
        max-height: none;
    }

    .presentation-viewer-frame {
        min-height: 58vh;
    }

    .presentation-frame {
        min-height: calc(58vh - 1.3rem);
    }
}

@media (max-width: 575.98px) {
    .screen-product-votes {
        flex-direction: column;
        align-items: flex-start;
    }

    .presentation-item {
        padding: 0.9rem;
    }

    .presentation-controls,
    .presentation-viewer-meta {
        width: 100%;
    }

    .presentation-controls .btn,
    .presentation-viewer-meta .btn {
        width: 100%;
    }
}
