/* assets/css/main.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

body::before {
    top: -10%; left: -10%;
    width: 500px; height: 500px;
    background: rgba(139, 92, 246, 0.4);
}

body::after {
    bottom: -10%; right: -10%;
    width: 600px; height: 600px;
    background: rgba(6, 182, 212, 0.4);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Typography */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Forms */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 14px 16px;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
}

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

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.card-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.card-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.3);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.card-item p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}

.badge.mint { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.near-mint { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge.played { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Grading Canvas */
.canvas-container {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    margin: 20px 0;
}

/* Chat */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 500px;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--accent-gradient);
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    gap: 10px;
}

.chat-input input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: 20px;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        font-size: 14px;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .glass-panel {
        padding: 15px;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .card-item img {
        height: 200px;
    }
    
    #view-grading > div {
        flex-direction: column;
    }
    
    #scan-result .glass-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    #scan-img {
        width: 100% !important;
        max-width: 300px;
    }
    
    .chat-window {
        height: 80vh;
    }
    
    .chat-window > div {
        flex-direction: column !important;
    }
    
    .chat-window > div > div:first-child {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border);
        height: 150px;
    }
    
    .canvas-container {
        width: 100%;
        max-width: 100%;
    }
    
    .canvas-container img, .canvas-container canvas {
        width: 100% !important;
        height: auto !important;
    }
}

/* Market UI V2 */
.market-top-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.market-filter-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 30px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.8);
}

.filter-col h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.filter-col h3 i {
    color: var(--accent-secondary);
}

/* Custom Checkboxes */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
    user-select: none;
}

.custom-checkbox:hover {
    color: var(--text-primary);
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--accent-gradient);
    border-color: transparent;
}

.custom-checkbox input:checked ~ .checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Neon Price Slider */
.price-slider-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-display {
    display: flex;
    justify-content: space-between;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

/* Dual Range Slider */
.multi-range-container {
    position: relative;
    width: 100%;
    height: 30px;
}

.multi-range-container::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.neon-slider-multi {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    pointer-events: none;
    outline: none;
}

.neon-slider-multi::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-primary);
    pointer-events: auto;
    transition: transform 0.2s;
}

.neon-slider-multi::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.neon-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    padding: 0;
    margin: 10px 0;
}

.neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-primary);
    transition: transform 0.2s;
}

.neon-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Search Button */
.search-btn-container {
    display: flex;
    justify-content: center;
}

.btn-large-glow {
    font-size: 1.2rem;
    padding: 15px 40px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-large-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

/* Responsive */
@media (max-width: 900px) {
    .market-filter-panel {
        grid-template-columns: 1fr;
    }
}

/* Currency Selector */
.currency-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.currency-btn {
    cursor: pointer;
}

.currency-btn input {
    display: none;
}

.currency-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.currency-btn input:checked + .currency-badge {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.currency-btn:hover .currency-badge {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}
.currency-btn input:checked:hover + .currency-badge {
    background: var(--accent-gradient);
}

/* AI Scan Scanner UI */
#scanner-ui {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 75vh;
    min-height: 600px;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.scanner-video-container {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.step-indicator-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    width: 80%;
}

.scanner-frame {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 364px; /* Exact card ratio 1:1.4 */
    border: 3px dashed rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.6);
}

.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: #fff;
    border-style: solid;
    border-width: 0;
}

.corner-tl {
    top: 0; left: 0;
    border-top-width: 6px;
    border-left-width: 6px;
    border-top-left-radius: 20px;
}
.corner-tr {
    top: 0; right: 0;
    border-top-width: 6px;
    border-right-width: 6px;
    border-top-right-radius: 20px;
}
.corner-bl {
    bottom: 0; left: 0;
    border-bottom-width: 6px;
    border-left-width: 6px;
    border-bottom-left-radius: 20px;
}
.corner-br {
    bottom: 0; right: 0;
    border-bottom-width: 6px;
    border-right-width: 6px;
    border-bottom-right-radius: 20px;
}

.scan-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6; /* Blue laser */
    box-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6;
    animation: scan 2s infinite ease-in-out alternate;
    display: none;
}

.scan-laser.active {
    display: block;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.scanner-bottom-panel {
    background: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.scanner-thumbnails {
    display: flex;
    gap: 15px;
    margin-top: -40px;
    z-index: 10;
}

.thumb-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    background-size: cover;
    background-position: center;
}

.scanner-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
}

.gallery-btn {
    color: #6b7280;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: background 0.3s;
}
.gallery-btn:hover { background: #f3f4f6; }

.shutter-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #1d4ed8;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px #1d4ed8;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}
.shutter-btn:active { transform: scale(0.95); }
.shutter-btn.loading {
    background: #9ca3af;
    box-shadow: 0 0 0 3px #9ca3af;
    pointer-events: none;
}

.done-btn {
    background: #e5e7eb;
    color: #9ca3af;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: not-allowed;
    transition: all 0.3s;
}
.done-btn.active {
    background: #10b981;
    color: #fff;
    cursor: pointer;
}

