/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --dark: #0f172a;
    --light: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.9);
    --accent: #f59e0b;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

html, body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 30%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--light);
}

/* Floating background elements */
.floating-bg {
    position: fixed;
    z-index: -1;
    animation: float 20s infinite linear;
}

.floating-bg:nth-child(1) {
    top: 10%;
    left: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation-duration: 25s;
}

.floating-bg:nth-child(2) {
    bottom: 10%;
    right: 5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    animation-duration: 30s;
    animation-direction: reverse;
}

/* Main container - FULL SCREEN */
.container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
    position: relative;
}

/* Header with logo */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
    margin-top: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 12px;
}

.header h1 {
    font-size: 2.8rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 8px;
    animation: gradientShift 3s infinite alternate;
    position: relative;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: var(--gradient);
    border-radius: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
}

/* Tab Navigation */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.tab-button {
    padding: 16px 32px;
    border: none;
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    min-width: 200px;
    justify-content: center;
}

.tab-button:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
    transform: translateY(-2px);
}

.tab-button.active {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

/* Generate QR Section */
.main-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    width: 100%;
    flex: 1;
    margin-bottom: 40px;
}

/* Controls Panel */
.controls-panel {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideInLeft 0.7s ease-out;
    transition: transform 0.3s ease;
}

.controls-panel:hover {
    transform: translateY(-5px);
}

/* Preview Panel */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideInRight 0.7s ease-out;
    transition: transform 0.3s ease;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-panel:hover {
    transform: translateY(-5px);
}

/* Input groups */
.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: var(--primary);
}

.input-group input, .input-group select {
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.7);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom dropdown arrow */
.input-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 16px;
    padding-right: 50px;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group input[type="color"] {
    height: 60px;
    padding: 8px;
    cursor: pointer;
}

/* Row for side-by-side inputs */
.row {
    display: flex;
    gap: 15px;
}

.row .input-group {
    flex: 1;
}

/* File upload */
.file-upload {
    position: relative;
    margin-bottom: 25px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.7);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.file-upload-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload input {
    display: none;
}

/* Buttons */
.btn {
    padding: 18px 30px;
    border-radius: 14px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.btn-generate {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.btn-download {
    background: var(--secondary);
    color: white;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    margin-top: 30px;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.4);
}

.btn i {
    font-size: 1.2rem;
}

/* QR Preview Container */
.qr-container {
    width: 100%;
    max-width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.qr-container.has-qr {
    background: white;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite alternate;
    border: none;
}

.qr-container.has-qr:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#qrBox {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* QR Logo Border - NEW STYLE WITH TRANSPARENT BACKGROUND */
.qr-logo-with-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; /* Increased size */
    height: 80px; /* Increased size */
    border-radius: 12px; /* Larger radius */
    border: 4px solid white; /* Thicker border */
    background: white;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.qr-logo-with-border img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 6px;
}

/* Empty state for QR box */
.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.1);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #94a3b8;
}

.empty-state p {
    font-size: 1rem;
    color: #64748b;
}

/* Preview text */
.preview-text {
    text-align: center;
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 20px;
}

.preview-text strong {
    color: var(--accent);
}

/* Footer */
.footer-main {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 20px 0;
    margin-top: 40px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-main a {
    color: #60a5fa !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.footer-main a:hover {
    color: #93c5fd !important;
    text-decoration: underline;
}

.footer-main i {
    font-size: 0.9rem;
}

/* ====== SCANNER SECTION ====== */

/* Camera Scanner Fullscreen */
.camera-scanner-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.camera-scanner-fullscreen.active {
    display: flex;
}

.camera-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-header h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 100px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-text {
    display: inline-block;
}

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

.btn-switch-camera, .btn-flash {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-switch-camera:hover, .btn-flash:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-flash.active {
    background: var(--warning);
    color: #000;
}

/* Camera View Container - FIXED FOR MOBILE/WEB */
.camera-view-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#scannerVideo {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Changed from contain to cover for full screen */
    background: #000;
}

/* For web/desktop, we want to show the full video without cropping */
@media (min-width: 769px) {
    #scannerVideo {
        object-fit: contain; /* On desktop, show full video without cropping */
    }
}

/* Scanner Overlay */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 280px;
    height: 280px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    animation: pulseFrame 2s infinite alternate;
    border-radius: 20px;
}

@keyframes pulseFrame {
    0% { 
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    100% { 
        border-color: rgba(16, 185, 129, 0.9);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    }
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--secondary);
}

.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary);
    animation: scanLine 2s infinite linear;
    box-shadow: 0 0 10px var(--secondary);
    border-radius: 3px;
}

@keyframes scanLine {
    0% { 
        top: 0;
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% { 
        top: 100%;
        opacity: 1;
    }
}

.scan-instruction {
    color: white;
    margin-top: 30px;
    font-size: 1.2rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 24px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    font-weight: 500;
}

/* Camera Bottom Controls */
.camera-bottom-controls {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-upload-in-camera {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.btn-upload-in-camera:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-upload-in-camera i {
    font-size: 1.3rem;
}

/* Results Page Fullscreen - FIXED: Web View on RIGHT SIDE */
.results-page-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--dark);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.results-page-fullscreen.active {
    display: flex;
}

.results-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
}

.results-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.results-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Result Summary */
.result-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(16, 185, 129, 0.1);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: 100%;
}

.result-icon {
    width: 70px;
    height: 70px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.result-meta h4 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

#scanTimeDisplay {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Result Data Container - LEFT SIDE */
.result-data-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    flex: 1;
    min-width: 300px;
}

.data-type {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.type-badge {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
}

.data-content-wrapper {
    margin-bottom: 30px;
}

.data-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.data-label i {
    color: var(--primary);
    font-size: 1.2rem;
}

.data-label span {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Data Display with EMOJI SUPPORT - FIXED */
.data-display {
    background: rgba(15, 23, 42, 0.7);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', system-ui, sans-serif;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
    color: #e2e8f0;
    line-height: 1.6;
    font-size: 1.1rem;
    min-height: 100px;
}

.data-display::-webkit-scrollbar {
    width: 8px;
}

.data-display::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.data-display::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Data Actions - FIXED: 2 buttons in one line */
.data-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.data-actions button {
    padding: 14px 25px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 160px;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.btn-open-url {
    background: var(--primary);
    color: white;
}

.btn-open-url:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-copy-share {
    background: var(--accent);
    color: white;
}

.btn-copy-share:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.btn-new-scan {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-new-scan:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Web View Section - FIXED: RIGHT SIDE, No zoom issue */
.web-view-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: none;
    position: relative;
    width: 100%;
    flex: 1;
    min-width: 300px;
    flex-direction: column;
}

.web-view-section.active {
    display: flex;
}

.web-view-header {
    background: var(--dark);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#webViewTitle {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
    text-align: center;
}

.btn-close-webview {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-close-webview:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

#webViewFrame {
    width: 100%;
    height: 500px;
    border: none;
    background: white;
    flex-grow: 1;
}

/* QR Preview Image in Results - NEW */
.qr-preview-image-container {
    margin-bottom: 25px;
    text-align: center;
}

.qr-preview-image-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-preview-image {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: white;
    padding: 15px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .row {
        flex-direction: column;
        gap: 0;
    }
    
    .qr-container {
        max-width: 250px;
        height: 250px;
    }
    
    .floating-bg {
        display: none;
    }
    
    .footer-main {
        font-size: 0.85rem;
        padding: 15px 0;
        margin-top: 30px;
    }
    
    .scanner-frame {
        width: 240px;
        height: 240px;
    }
    
    .btn-upload-in-camera {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    .result-summary {
        padding: 20px;
    }
    
    .result-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .result-meta h4 {
        font-size: 1.3rem;
    }
    
    .results-content {
        flex-direction: column;
    }
    
    .web-view-section {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 30px;
        margin-top: 10px;
    }
    
    .tab-container {
        gap: 10px;
    }
    
    .tab-button {
        padding: 14px 20px;
        font-size: 1rem;
        min-width: 160px;
    }
    
    .scanner-frame {
        width: 220px;
        height: 220px;
    }
    
    .scan-instruction {
        font-size: 1rem;
        padding: 10px 20px;
        margin-top: 25px;
    }
    
    .camera-header {
        padding: 15px;
    }
    
    .btn-switch-camera, .btn-flash {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .results-content {
        padding: 15px;
    }
    
    .data-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .data-actions button {
        flex: 1 1 calc(50% - 15px);
        min-width: 0;
    }
    
    .results-header h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: 140px;
    }
    
    .controls-panel, .preview-panel {
        padding: 20px;
    }
    
    .btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .scanner-frame {
        width: 200px;
        height: 200px;
    }
    
    .corner {
        width: 20px;
        height: 20px;
    }
    
    .scan-instruction {
        font-size: 0.9rem;
        padding: 8px 16px;
        margin-top: 20px;
    }
    
    .camera-bottom-controls {
        padding: 15px;
    }
    
    .btn-upload-in-camera {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .results-header {
        padding: 15px;
    }
    
    .results-header h3 {
        font-size: 1.2rem;
    }
    
    .result-summary {
        padding: 15px;
    }
    
    .result-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .result-meta h4 {
        font-size: 1.1rem;
    }
    
    .result-data-container {
        padding: 20px;
    }
    
    .data-label span {
        font-size: 1.1rem;
    }
    
    .data-display {
        padding: 20px;
        font-size: 1rem;
    }
    
    .data-actions button {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }
    
    .btn-back .btn-text {
        display: none;
    }
    
    .btn-back {
        min-width: 50px;
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
    }
    
    .qr-preview-image {
        width: 150px;
        height: 150px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

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

@keyframes pulse {
    0% { box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); }
    100% { box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3); }
}

@keyframes qrGenerate {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    font-weight: 600;
    max-width: 350px;
}

.notification.error {
    background: var(--danger);
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Download QR Code Styles - Only QR Code (No Card) */
.qr-download-only {
    width: 400px;
    height: 400px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 10px solid #f8fafc;
}

.qr-download-only img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dot Style Dropdown Enhancement */
.dot-style-dropdown-container {
    position: relative;
}

.dot-style-select {
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.7);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 50px;
}

.dropdown-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
}

/* Scan card styles */
.scan-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 40px auto;
}

.scan-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scan-card:hover {
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.scan-card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.scan-card-content {
    flex: 1;
}

.scan-card-content h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.scan-card-content p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.scan-card-arrow {
    color: #94a3b8;
    font-size: 1.2rem;
}

/* Permission Modal */
.permission-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.permission-modal.active {
    display: flex;
}

.permission-modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
}

.permission-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 20px;
}

.permission-modal-content h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.permission-modal-content p {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.permission-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-permission-allow, .btn-permission-cancel {
    padding: 16px 30px;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.btn-permission-allow {
    background: var(--secondary);
    color: white;
}

.btn-permission-allow:hover {
    background: #0da271;
    transform: translateY(-2px);
}

.btn-permission-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-permission-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Camera Auto Close Timer */
.camera-timer {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.camera-timer i {
    color: var(--warning);
}

/* Upload fallback styles */
.upload-fallback {
    text-align: center;
    padding: 40px 20px;
}

.upload-fallback i {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.upload-fallback h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-fallback p {
    color: #94a3b8;
    margin-bottom: 30px;
    line-height: 1.5;
}

.fallback-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.btn-upload-in-camera-fallback {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-upload-in-camera-fallback:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-retry-camera-fallback {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-retry-camera-fallback:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Copy Share Button Group */
.copy-share-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.copy-share-group button {
    flex: 1;
}