/* ==========================================================================
   YUHU PHOTOBOOTH - GLOBAL SCAN (scan.yuhu.co.id)
   Professional & Elegant Boutique Theme
   ========================================================================== */

:root {
    --bg-page: #0b0f19;
    --surface-card: #121826;
    --surface-card-subtle: #182032;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-gold: #e2b774;
    --accent-emerald: #10b981;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.7);
}

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

html, body {
    touch-action: pan-y manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior-y: contain;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 24px 16px 40px;
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 100%, rgba(226, 183, 116, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    letter-spacing: -0.01em;
}

button, a, input, .viewfinder-box, .session-tab-btn, .candidate-card {
    touch-action: manipulation;
}

.scan-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.scan-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
}

.scan-logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin: 0 auto 12px auto;
    width: 100%;
}

.scan-logo {
    height: 38px;
    max-width: 170px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.scan-logo:hover, .scan-logo:active {
    transform: scale(1.02);
    opacity: 0.95;
}

.scan-logo.filter-white {
    filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.scan-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.scan-pill-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
}

.scan-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.25;
}

.scan-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 0 14px;
}

/* Card */
.scan-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    padding: 24px 20px;
    box-shadow: var(--shadow-card);
    position: relative;
}

/* Viewfinder Area (Photography Studio Focus Style) */
.viewfinder-box {
    width: 100%;
    height: 290px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    background: rgba(18, 24, 38, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    overflow: hidden;
}

.viewfinder-box:hover, .viewfinder-box:active {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.04);
}

/* Camera Frame Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(255, 255, 255, 0.4);
    border-style: solid;
    pointer-events: none;
    transition: border-color 0.25s ease;
}

.viewfinder-box:hover .corner-bracket {
    border-color: var(--accent-gold);
}

.corner-tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.corner-tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.corner-br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }

.viewfinder-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #e2e8f0;
    transition: all 0.25s ease;
}

.viewfinder-box:hover .viewfinder-icon {
    transform: scale(1.05);
    color: var(--accent-gold);
    border-color: rgba(226, 183, 116, 0.4);
    background: rgba(226, 183, 116, 0.08);
}

.viewfinder-text {
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.viewfinder-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Minimal Photography Tips */
.tips-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 22px;
}

.tip-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tip-item svg {
    display: block;
    margin: 0 auto 5px;
    color: var(--text-tertiary);
}

/* Action Buttons */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-scan {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #ffffff;
    color: #0b0f19;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover, .btn-primary:active {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: #cbd5e1;
}

.btn-secondary:hover, .btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-link {
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    padding: 8px;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.btn-link:hover {
    color: #ffffff;
}

/* Step 2: Refined Scanning Loading (Clean Photography Loader) */
.scanning-box {
    position: relative;
    width: 100%;
    height: 310px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000000;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.scanning-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.75);
}

/* Subtle, Elegant Shimmer Focus (Not Cheesy Neon Laser) */
.scan-focus-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        transparent 100%);
    background-size: 100% 200%;
    animation: elegantShimmer 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes elegantShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

.scan-pulse-ring {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: focusPulse 1.8s ease-out infinite;
}

@keyframes focusPulse {
    0% { transform: scale(0.85); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 0.4; }
    100% { transform: scale(0.85); opacity: 0.9; }
}

.scanning-status {
    text-align: center;
    padding: 6px 0;
}

.scanning-title {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 5px;
}

.scanning-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Step 3: Match Success Result */
.result-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back-nav:hover, .btn-back-nav:active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.auto-reset-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    padding: 5px 10px;
    border-radius: 9999px;
    font-weight: 500;
}

.auto-reset-badge strong {
    color: var(--accent-gold);
    font-weight: 700;
}

.btn-scan.btn-loading {
    opacity: 0.85;
    pointer-events: none;
}

.btn-scan.btn-success-state {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

.result-header {
    text-align: center;
    margin-bottom: 18px;
}

.badge-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.badge-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.event-info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    text-align: left;
}

.event-info-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
}

.event-info-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
}

.event-info-meta {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-image-box {
    width: 100%;
    max-height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    margin-bottom: 18px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-image-box img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

/* Media Switch Tabs (Jika 1 sesi memiliki Foto Cetak, Video, & Foto Satuan) */
.session-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.session-tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.session-tab-btn.active {
    background: #ffffff;
    color: #0b0f19;
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.result-video {
    width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    background: #000000;
    outline: none;
    display: block;
}

.privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 14px;
    text-align: center;
}

/* Candidate Alternatives */
.candidates-wrap {
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    width: 100%;
}

.candidates-heading {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}

.candidate-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    padding-bottom: 6px;
}

.candidate-card:hover, .candidate-card:active {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.candidate-card img {
    width: 100%;
    height: 105px;
    object-fit: cover;
    display: block;
}

.candidate-card-score {
    font-size: 10px;
    font-weight: 700;
    color: #34d399;
    padding-top: 4px;
    display: block;
}

.candidate-card-event {
    font-size: 9.5px;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Step 4: Fail / Not Found */
.badge-fail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 12px;
}

.fail-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

/* Footer */
.scan-footer {
    text-align: center;
    margin-top: 26px;
    font-size: 11.5px;
    color: var(--text-tertiary);
}

.scan-footer a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
}

.scan-footer a:hover {
    text-decoration: underline;
}
