/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Light Theme (Default fallback, overridden by dataset) */
    --bg-primary: hsl(145, 20%, 98%);
    --bg-secondary: hsl(0, 0%, 100%);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(16, 185, 129, 0.1);
    
    --text-primary: hsl(160, 40%, 10%);
    --text-secondary: hsl(160, 10%, 42%);
    --text-muted: hsl(160, 10%, 62%);
    
    --ui-yellow: hsl(145, 75%, 36%); /* Official FKG Green Accent */
    --ui-yellow-hover: hsl(145, 75%, 28%);
    --ui-yellow-glow: rgba(16, 185, 129, 0.25);
    
    --accent-color: hsl(145, 80%, 25%);
    --accent-hover: hsl(145, 80%, 20%);
    
    --success: hsl(142, 71%, 45%);
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(0, 84%, 60%);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
    --bg-primary: hsl(145, 45%, 4%); /* Deep luxurious dark emerald green */
    --bg-secondary: hsl(145, 45%, 7%);
    --bg-glass: rgba(8, 16, 12, 0.75);
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --text-primary: hsl(145, 20%, 98%);
    --text-secondary: hsl(145, 15%, 80%);
    --text-muted: hsl(145, 10%, 55%);
    
    --ui-yellow: hsl(145, 75%, 45%);
    --ui-yellow-hover: hsl(145, 75%, 50%);
    --ui-yellow-glow: rgba(16, 185, 129, 0.3);
    
    --accent-color: hsl(145, 75%, 45%);
    --accent-hover: hsl(145, 75%, 50%);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    position: relative;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* Background Glowing Blobs */
.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: var(--radius-full);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

[data-theme="dark"] .blob {
    opacity: 0.12;
}

.blob-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--ui-yellow) 0%, transparent 70%);
}

.blob-2 {
    top: 30%;
    right: -200px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
}

.blob-3 {
    bottom: 50px;
    left: 10%;
    background: radial-gradient(circle, var(--ui-yellow) 0%, transparent 70%);
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .grid-2 {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
    
    .grid-2.align-center {
        align-items: center;
    }
}

.text-center {
    text-align: center;
}

.section {
    padding: 80px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background-color: var(--ui-yellow-glow);
    color: var(--ui-yellow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-yellow {
    background-color: var(--ui-yellow-glow);
    color: var(--ui-yellow);
    border-color: rgba(16, 185, 129, 0.3);
}

.highlight {
    color: var(--ui-yellow);
    text-shadow: 0 0 20px var(--ui-yellow-glow);
}

/* ==========================================================================
   GLASS COMPONENTS
   ========================================================================== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 215, 0, 0.2);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background-color: var(--ui-yellow);
    color: #111827;
}

.btn-primary:hover {
    background-color: var(--ui-yellow-hover);
    box-shadow: 0 0 20px var(--ui-yellow-glow);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-accent {
    background-color: #111827;
    color: #ffffff;
    border: 1px solid #374151;
}

[data-theme="dark"] .btn-accent {
    background-color: #ffffff;
    color: #111827;
}

.btn-accent:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--ui-yellow);
    color: var(--ui-yellow);
}

.icon-inline {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    transition: background-color var(--transition-normal);
}

[data-theme="light"] .app-header {
    background: rgba(248, 250, 252, 0.8);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    filter: drop-shadow(0 0 6px var(--ui-yellow-glow));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--ui-yellow);
    font-weight: 500;
}

@media (max-width: 767px) {
    .nav-menu {
        display: none;
    }
    .nav-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-glass);
        padding: 24px;
        gap: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
        gap: 32px;
    }
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--ui-yellow);
    transition: width var(--transition-fast);
    border-radius: var(--radius-full);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
}

.btn-menu .icon-menu-open { display: block; }
.btn-menu .icon-menu-close { display: none; }

.btn-menu.open .icon-menu-open { display: none; }
.btn-menu.open .icon-menu-close { display: block; }

@media (min-width: 768px) {
    .btn-menu {
        display: none;
    }
}

/* Theme Icon Visibility */
#themeToggle .sun-icon { display: none; }
#themeToggle .moon-icon { display: block; }

[data-theme="light"] #themeToggle .sun-icon { display: block; }
[data-theme="light"] #themeToggle .moon-icon { display: none; }

/* MOBILE MENU (JS toggled) - Handled in max-width media query above */

/* ==========================================================================
   HERO / SCANNER SECTION
   ========================================================================== */
.hero-section {
    padding-top: 40px;
    position: relative;
}

.hero-left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.hero-info-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.features-checklist {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.checklist-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.checklist-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--ui-yellow-glow);
    border-radius: var(--radius-full);
    color: var(--ui-yellow);
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-icon i {
    width: 16px;
    height: 16px;
}

.checklist-item h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.checklist-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* ==========================================================================
   SCANNER CORE UI
   ========================================================================== */
.scanner-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-header {
    margin-bottom: 20px;
}

.scanner-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-indicator.idle {
    background-color: var(--text-muted);
}

.status-indicator.active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}

.status-indicator.error {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.scanner-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-glass);
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 4px);
    transition: all var(--transition-fast);
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: var(--bg-secondary);
    color: var(--ui-yellow);
    box-shadow: var(--shadow-sm);
}

.scanner-content {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex-direction: column;
    height: 100%;
}

.tab-pane.active {
    display: flex;
}

/* Camera Viewport Wrapper */
.camera-viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-glass);
}

.camera-viewport {
    width: 100% !important;
    height: 100% !important;
}

.camera-viewport video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Scanner Laser Overlay */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    display: none;
}

.tab-pane.active.scanning .scanner-overlay {
    display: block;
}

.scanner-laser {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--ui-yellow), transparent);
    box-shadow: 0 0 12px var(--ui-yellow);
    animation: scan 2s linear infinite;
    top: 0;
}

/* Scanner Corners design */
.scanner-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 4px solid var(--ui-yellow);
    pointer-events: none;
}

.scanner-corner.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.scanner-corner.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
}

.scanner-corner.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.scanner-corner.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

/* Camera Placeholder when disabled */
.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0b0f19;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    z-index: 2;
    transition: opacity var(--transition-normal);
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.camera-placeholder p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 260px;
}

.camera-controls {
    display: flex;
    gap: 12px;
}

.camera-controls .btn-primary {
    flex-grow: 1;
}

/* File Upload Zone */
.upload-zone {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--ui-yellow);
    background-color: var(--ui-yellow-glow);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--ui-yellow);
    margin-bottom: 16px;
    transition: transform var(--transition-fast);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}

.upload-zone h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 500;
}

/* ==========================================================================
   ABOUT / INFO SECTION
   ========================================================================== */
.about-section {
    background-color: var(--bg-secondary);
    transition: background-color var(--transition-normal);
}

.section-header {
    max-width: 680px;
    margin: 0 auto 60px auto;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 576px) and (max-width: 991px) {
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .about-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.about-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    text-align: left;
}

.about-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.about-card-icon i {
    width: 22px;
    height: 22px;
}

.about-card-content h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.about-card-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Color variations for icon wrappers */
.icon-wrapper-red {
    background-color: rgba(239, 68, 68, 0.12);
    color: rgb(239, 68, 68);
}
.icon-wrapper-blue {
    background-color: rgba(59, 130, 246, 0.12);
    color: rgb(59, 130, 246);
}
.icon-wrapper-slate {
    background-color: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}
[data-theme="dark"] .icon-wrapper-slate {
    background-color: rgba(148, 163, 184, 0.15);
    color: rgb(148, 163, 184);
}
.icon-wrapper-green {
    background-color: rgba(16, 185, 129, 0.12);
    color: rgb(16, 185, 129);
}
.icon-wrapper-orange {
    background-color: rgba(245, 158, 11, 0.12);
    color: rgb(245, 158, 11);
}
.icon-wrapper-purple {
    background-color: rgba(139, 92, 246, 0.12);
    color: rgb(139, 92, 246);
}

/* ==========================================================================
   FEATURES / TIMELINE SECTION
   ========================================================================== */
.steps-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.steps-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 2px;
    height: 100%;
    background: var(--border-glass);
    z-index: 1;
}

@media (min-width: 768px) {
    .steps-timeline::before {
        left: 50%;
    }
}

.timeline-step {
    position: relative;
    display: flex;
    gap: 24px;
    z-index: 2;
}

@media (min-width: 768px) {
    .timeline-step {
        width: 50%;
    }
    
    .timeline-step:nth-child(odd) {
        align-self: flex-start;
        flex-direction: row-reverse;
        padding-right: 40px;
        text-align: right;
    }
    
    .timeline-step:nth-child(even) {
        align-self: flex-end;
        padding-left: 40px;
        text-align: left;
    }
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background-color: var(--ui-yellow);
    color: #111827;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px var(--ui-yellow-glow);
}

@media (min-width: 768px) {
    .step-number {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .timeline-step:nth-child(odd) .step-number {
        left: calc(100% + 40px);
    }
    
    .timeline-step:nth-child(even) .step-number {
        left: -40px;
    }
}

.step-content {
    padding: 24px;
    border-radius: var(--radius-md);
    flex-grow: 1;
}

.step-content h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   GENERATOR SECTION
   ========================================================================== */
.generator-card {
    padding: 40px;
}

@media (min-width: 992px) {
    .generator-card {
        padding: 60px;
    }
}

.generator-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.generator-info h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.generator-info p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.link-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    margin-bottom: 30px;
}

.link-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.link-url {
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ui-yellow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.link-url:hover {
    text-decoration: underline;
}

.qr-code-display-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-canvas-container {
    padding: 20px;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.qr-canvas-container canvas {
    max-width: 180px;
    height: auto;
}

.qr-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
    background-color: hsl(222, 47%, 4%);
    border-top: 1px solid var(--border-glass);
    padding: 60px 0 20px 0;
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.footer-logo svg {
    filter: drop-shadow(0 0 4px var(--ui-yellow-glow));
}

.footer-brand p {
    font-size: 0.9rem;
    max-width: 320px;
}

.footer-links h4 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--ui-yellow);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MODAL DIALOG (SCAN RESULT POPUP)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    padding: 24px;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 480px;
    padding: 32px;
    position: relative;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.modal-backdrop.open .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.modal-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.modal-icon-wrapper.success {
    background-color: var(--success-glow);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.modal-icon-wrapper.warning {
    background-color: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.modal-icon {
    width: 32px;
    height: 32px;
}

.modal-icon.text-success { color: var(--success); }
.modal-icon.text-warning { color: var(--warning); }

.modal-header-content {
    margin-bottom: 24px;
}

.modal-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ui-yellow);
    margin-bottom: 6px;
    display: inline-block;
}

.modal-title {
    font-size: 1.4rem;
}

.result-box {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-glass);
    margin-bottom: 28px;
    text-align: left;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-content-container {
    overflow-x: auto;
    padding-bottom: 4px;
}

.result-text {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
    white-space: pre-wrap;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
    width: 100%;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes scan {
    0% {
        top: 0;
        opacity: 0.2;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0.2;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 var(--success-glow);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* ==========================================================================
   QR SHOWCASE CARD & FUTURISTIC ANIMATIONS
   ========================================================================== */
.qr-showcase-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.qr-interactive-wrapper {
    margin: 32px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Futuristic Scanning Frame */
.qr-scanner-frame {
    position: relative;
    width: 240px;
    height: 240px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.qr-scanner-frame:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.15), inset 0 0 25px rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Glowing Corner Accents */
.frame-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--ui-yellow);
    transition: all var(--transition-normal);
}

.frame-corner.top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-radius: var(--radius-sm) 0 0 0;
}

.frame-corner.top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 var(--radius-sm) 0 0;
}

.frame-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 var(--radius-sm);
}

.frame-corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) 0;
}

.qr-scanner-frame:hover .frame-corner {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 8px var(--ui-yellow));
}

/* Scanning Laser Sweep */
.frame-laser {
    position: absolute;
    width: calc(100% - 4px);
    height: 3px;
    left: 2px;
    background: linear-gradient(to right, transparent, var(--ui-yellow), transparent);
    box-shadow: 0 0 12px var(--ui-yellow);
    animation: scanSweep 3s ease-in-out infinite;
    z-index: 4;
}

@keyframes scanSweep {
    0%, 100% {
        top: 2px;
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    50% {
        top: calc(100% - 5px);
    }
}

/* Rotating Tech Rings */
.tech-ring-outer {
    position: absolute;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border: 1px dashed rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    animation: rotateRing 20s linear infinite;
    pointer-events: none;
}

.tech-ring-inner {
    position: absolute;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    border: 1px dotted rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: rotateRingBack 35s linear infinite;
    pointer-events: none;
}

@keyframes rotateRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotateRingBack {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* QR Wrapper */
.qr-wrapper {
    position: relative;
    padding: 12px;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2;
    transition: transform var(--transition-normal);
}

.qr-scanner-frame:hover .qr-wrapper {
    transform: scale(1.03);
}

.qr-wrapper canvas {
    display: block;
    width: 176px;
    height: 176px;
}

/* Center Logo Overlay */
.qr-logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Narrative section */
.qr-narrative {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.narrative-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ui-yellow);
    font-size: 0.85rem;
    font-weight: 600;
}

.narrative-badge i {
    width: 14px;
    height: 14px;
    animation: pulseIcon 1.5s infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}

.narrative-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
}

.showcase-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   OFFICIAL FKG UI BRANDING HEADER
   ========================================================================== */
.fkg-ui-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.ui-logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-logo-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.univ-name {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    line-height: 1.1;
}

.univ-motto {
    font-size: 0.45rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.1;
    margin-top: 1px;
}

.dental-probe-separator {
    display: flex;
    align-items: center;
    opacity: 0.8;
    color: var(--text-secondary);
}

.faculty-name-container {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.fac-label {
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    line-height: 1;
}

.fac-title {
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.fac-title-gigi {
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: 0.05em;
}

.simple-line-separator {
    width: 1px;
    height: 28px;
    background-color: var(--border-glass);
}

.service-portal-container {
    display: flex;
    align-items: center;
}

.portal-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ui-yellow); /* Bright emerald green in our theme! */
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Make it responsive - collapse/hide parts on smaller screens */
@media (max-width: 767px) {
    .fkg-ui-branding {
        gap: 10px;
    }
    
    .fac-label {
        font-size: 0.5rem;
    }
    
    .fac-title {
        font-size: 0.75rem;
    }
    
    .fac-title-gigi {
        font-size: 0.8rem;
    }
    
    .portal-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 540px) {
    .fkg-ui-branding {
        gap: 6px;
    }
    
    .fac-label {
        display: none; /* Hide the FAKULTAS label to save horizontal space on mobile */
    }
    
    .fac-title {
        font-size: 0.7rem;
    }
    
    .fac-title-gigi {
        font-size: 0.75rem;
    }
    
    .portal-title {
        font-size: 0.78rem;
    }
    
    .dental-probe-separator {
        transform: scale(0.85); /* Slightly scale down separator to save space */
    }
}


