/* Modern Cyberpunk-inspired Pokemon Scanner UI Stylesheet */

:root {
    --bg-dark: #09090e;
    --bg-panel: rgba(22, 22, 33, 0.7);
    --bg-panel-solid: #151522;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(0, 242, 254, 0.3);
    --text-primary: #f1f3f9;
    --text-secondary: #9aa0b9;
    --accent-blue: #00f2fe;
    --accent-purple: #4facfe;
    --accent-green: #00ff87;
    --accent-red: #ff3838;
    --accent-yellow: #fcd835;

    --card-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
    --font-code: 'Space Grotesk', monospace;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 10% 20%, rgba(79, 172, 254, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(0, 242, 254, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-glow);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-area h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.accent-text {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Pokeball Loader/Icon */
.pokeball-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    overflow: hidden;
    animation: rotateBall 6s linear infinite;
}

.pokeball-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    background-color: var(--accent-red);
    border-bottom: 2px solid var(--text-primary);
}

.pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--text-primary);
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
    z-index: 5;
}

.pokeball-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background-color: white;
}

@keyframes rotateBall {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 10px;
    min-width: 90px;
}

.stat-badge.highlight {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.2);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-code);
}

.stat-badge.highlight .stat-value {
    color: var(--accent-blue);
}

/* User Profile Widget */
.user-profile-widget {
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border-color);
    padding-left: 15px;
}

.user-logged-in {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    font-weight: 700;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.username-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: color var(--transition-speed);
    padding-left: 4px;
}

.btn-logout:hover {
    color: var(--accent-red);
}

.settings-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-speed);
}

.settings-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-secondary);
    transform: rotate(45deg);
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-glow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: slideDown var(--transition-speed) ease-out;
}

.settings-panel.hidden {
    display: none !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.settings-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

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

.settings-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-main);
    transition: all var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.form-group small {
    font-size: 11px;
    color: var(--text-secondary);
}

.form-group small a {
    color: var(--accent-blue);
    text-decoration: none;
}

/* Main Layout */
.app-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.panel-card {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--card-glow);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.control-panel {
    position: relative;
    z-index: 15;
}

.control-panel .panel-card {
    min-height: auto;
}

/* Horizontal Search Flex Layout */
.search-card-flex {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 30px;
    padding: 25px 30px;
}

.search-card-flex .manual-search-group {
    flex: 1.2;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

@media (max-width: 900px) {
    .search-card-flex {
        flex-direction: column;
        gap: 15px;
    }

    .search-card-flex .manual-search-group {
        width: 100%;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 100%);
    }
}

/* Tabs */
.tabs-header {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 15px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

.tab-content.hidden {
    display: none !important;
}

/* Live Camera View */
.scanner-view-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scanning Bounding Box */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.scanning-box {
    position: relative;
    width: 65%;
    height: 80%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 20px;
}

/* Bounding box corners */
.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-blue);
    border-style: solid;
    border-width: 0;
}

.top-left {
    top: -2px;
    left: -2px;
    border-top-width: 4px;
    border-left-width: 4px;
    border-top-left-radius: 8px;
}

.top-right {
    top: -2px;
    right: -2px;
    border-top-width: 4px;
    border-right-width: 4px;
    border-top-right-radius: 8px;
}

.bottom-left {
    bottom: -2px;
    left: -2px;
    border-bottom-width: 4px;
    border-left-width: 4px;
    border-bottom-left-radius: 8px;
}

.bottom-right {
    bottom: -2px;
    right: -2px;
    border-bottom-width: 4px;
    border-right-width: 4px;
    border-bottom-right-radius: 8px;
}

/* Animated Scanline */
.scan-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    box-shadow: 0 0 10px var(--accent-green);
    animation: scanAnimation 2s linear infinite;
}

@keyframes scanAnimation {
    0% {
        top: 0%;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0%;
    }
}

.alignment-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    pointer-events: auto;
}

.device-select-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text-secondary);
}

.device-select-wrapper select {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    padding: 10px 4px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 12px;
}

/* Status Indicator */
.scanner-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

.status-indicator.processing {
    background-color: var(--accent-yellow);
    box-shadow: 0 0 8px var(--accent-yellow);
    animation: pulse 1s infinite alternate;
}

.status-indicator.success {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

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

@keyframes pulse {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    font-family: var(--font-main);
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.btn-success {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 0 15px rgba(150, 201, 61, 0.4);
    transform: translateY(-2px);
}

.btn-icon {
    min-width: 44px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
}

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

/* Search and Upload Layouts */
.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
}

.search-input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 15px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-speed);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.clear-input-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

/* Autocomplete suggestions */
.autocomplete-suggestions {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--card-glow);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
}

.autocomplete-suggestions.hidden {
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background var(--transition-speed);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.suggestion-thumb {
    width: 32px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.suggestion-details {
    display: flex;
    flex-direction: column;
}

.suggestion-name {
    font-size: 13px;
    font-weight: 600;
}

.suggestion-set {
    font-size: 11px;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

/* Empty State Results */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    gap: 20px;
}

.empty-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-secondary);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 700;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.5;
}

/* Loader State */
.loader-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Disambiguation Matches Grid */
.disambiguation-header {
    margin-bottom: 20px;
}

.disambiguation-header h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.disambiguation-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.disambiguation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    overflow-y: auto;
    flex: 1;
}

.disambiguation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.disambiguation-card:hover {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.disambiguation-img {
    width: 100%;
    aspect-ratio: 2.5/3.5;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.disambiguation-name {
    font-size: 11px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.disambiguation-set {
    font-size: 9px;
    color: var(--text-secondary);
}

/* Main Detail View */
.results-view {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .results-view {
        grid-template-columns: 1fr;
    }
}

.card-visual-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 2.5/3.5;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Holographic dynamic card glare */
.glow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0) 100%);
    background-size: 250% 250%;
    background-position: 0% 0%;
    pointer-events: none;
    mix-blend-mode: color-dodge;
    transition: background-position 0.1s ease;
}

.card-image-wrapper:hover .glow-overlay {
    background-position: 100% 100%;
}

.card-details-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-meta-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.set-icon-wrapper {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.set-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.name-set-wrapper h2 {
    font-size: 24px;
    font-weight: 800;
}

.name-set-wrapper span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.spec-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.spec-val {
    font-size: 13px;
    font-weight: 700;
}

/* Price summary cards */
.price-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.price-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.price-card.selected {
    border-color: var(--accent-blue);
    background: rgba(0, 132, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 132, 255, 0.15);
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.price-card.normal::before {
    background-color: var(--text-secondary);
}

.price-card.holofoil::before {
    background-color: var(--accent-yellow);
}

.price-card.reverseHolofoil::before {
    background-color: var(--accent-purple);
}

.price-card-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.price-card-val {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-code);
}

.price-card-range {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Charts */
.chart-section h3,
.sales-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    position: relative;
    height: 180px;
    width: 100%;
}

/* Sales Section */
.sales-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sale-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
}

.sale-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sale-date {
    color: var(--text-secondary);
    font-size: 11px;
    min-width: 80px;
}

.sale-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.sale-badge.raw {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.sale-badge.psa9 {
    background: rgba(79, 172, 254, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(79, 172, 254, 0.3);
}

.sale-badge.psa10 {
    background: rgba(0, 255, 135, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 135, 0.3);
}

.sale-details {
    font-weight: 500;
}

.sale-price {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--accent-green);
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.result-actions .btn {
    flex: 1;
}

/* History Footer Panel */
.app-footer {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: var(--card-glow);
}

.footer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.footer-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-table-container {
    overflow-x: auto;
    max-height: 250px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.history-table th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.history-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-card-thumb {
    width: 24px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.table-card-name {
    font-weight: 600;
}

.table-set-symbol {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
}

.table-rarity-badge {
    font-size: 11px;
    color: var(--text-secondary);
}

.table-value {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--accent-blue);
}

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

.btn-delete-row {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: color var(--transition-speed);
}

.btn-delete-row:hover {
    color: var(--accent-red);
}

.empty-table-row {
    text-align: center;
    color: var(--text-secondary);
}

.empty-table-row td {
    padding: 40px 0;
}

/* User Account Modal Overlay Styling */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-overlay.hidden {
    display: none !important;
}

.auth-modal {
    background: var(--bg-panel-solid);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 35px 30px;
    box-shadow: 0 15px 50px rgba(0, 242, 254, 0.15);
    position: relative;
    animation: zoomIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
    gap: 15px;
}

.auth-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 5px;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-speed);
}

.auth-tab.active {
    color: var(--accent-blue);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 3px 3px 0 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form.hidden {
    display: none !important;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-top: 10px;
}

.auth-message {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.auth-message.error {
    background: rgba(255, 56, 56, 0.15);
    border: 1px solid rgba(255, 56, 56, 0.3);
    color: #ff8080;
}

.auth-message.success {
    background: rgba(0, 255, 135, 0.15);
    border: 1px solid rgba(0, 255, 135, 0.3);
    color: #80ffbf;
}

/* Cloud Sync Modal Styling */
.sync-modal-wide {
    max-width: 650px !important;
}

.sync-modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.sync-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-modal-header h3 i {
    color: var(--accent-blue);
}

.sync-modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Accordion Setup Guide */
.instructions-accordion {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.instructions-accordion summary {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    padding: 12px 15px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    outline: none;
}

.instructions-accordion summary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.instructions-content {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.instructions-content ol {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.instructions-content li strong {
    color: var(--text-primary);
}

/* Apps Script Code Box */
.code-container {
    background: #0f111a;
    border: 1px solid #1f2233;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.code-header {
    background: #181b28;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2233;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.btn-copy-code {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.code-container pre {
    margin: 0;
    padding: 15px;
    max-height: 180px;
    overflow-y: auto;
}

.code-container code {
    font-family: var(--font-code);
    font-size: 12px;
    color: #e5c07b;
    line-height: 1.5;
    white-space: pre;
    display: block;
}

/* Modal action buttons */
.sync-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.sync-modal-actions .btn {
    padding: 12px 25px;
}

/* Master Set Progress Styles */
.master-progress-container {
    margin-top: 0;
    background: rgba(30, 32, 50, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    backdrop-filter: blur(10px);
}

.master-progress-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.progress-empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 15px 0;
}

.set-progress-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 14px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.25s;
}

.set-progress-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.05);
}

.set-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.set-progress-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.set-progress-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.set-name-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.set-progress-ratio {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.set-progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.set-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.set-progress-percentage {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 600;
}

/* Checklist Modal Custom Styles */
.checklist-modal-wide {
    max-width: 950px !important;
    width: 95%;
}

.checklist-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.checklist-filters .btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    transition: all 0.25s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.checklist-filters .btn.active {
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.checklist-grid-container {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar styling for checklist */
.checklist-grid-container::-webkit-scrollbar {
    width: 6px;
}

.checklist-grid-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.checklist-grid-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px 5px;
}

.checklist-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checklist-card:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.15);
}

.checklist-card.owned {
    border-color: rgba(0, 255, 135, 0.3);
    background: rgba(0, 255, 135, 0.01);
}

.checklist-card.owned:hover {
    border-color: rgba(0, 255, 135, 0.6);
    box-shadow: 0 5px 15px rgba(0, 255, 135, 0.15);
}

.checklist-card.missing {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
}

.checklist-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2.5 / 3.5;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.checklist-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.25s;
}

.checklist-card.missing .checklist-card-img {
    filter: grayscale(100%) brightness(50%);
}

.checklist-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.checklist-card-badge.owned {
    background: #00ff87;
    color: #0c0e17;
}

.checklist-card-badge.missing {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.checklist-card-info {
    width: 100%;
    text-align: center;
}

.checklist-card-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 700;
}

.checklist-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Clickable progress cards */
.clickable-progress-card {
    cursor: pointer;
}

/* Responsive Collection Table & Header Actions */
@media (max-width: 767px) {
    /* Stack footer header items and align stretch */
    .footer-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .history-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
        width: 100%;
    }
    
    .history-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.8rem;
    }

    /* Transform history table into visual cards */
    .history-table thead {
        display: none;
    }
    
    .history-table, 
    .history-table tbody, 
    .history-table tr, 
    .history-table td {
        display: block;
        width: 100%;
    }
    
    .history-table tr {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        position: relative;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s;
    }
    
    .history-table tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 8px 0;
        font-size: 0.9rem;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    }
    
    .history-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
        justify-content: flex-end;
    }
    
    /* Display the data-label value as a table key */
    .history-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Make first cell (Card Name) stand out as a card header */
    .history-table td:first-child {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 10px;
        margin-bottom: 5px;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
    }
    
    .history-table td:first-child::before {
        display: none;
    }
    
    .table-card-info {
        width: 100%;
    }
    
    /* Make delete row action full width and prominent */
    .btn-delete-row {
        width: 100%;
        padding: 10px;
        background: rgba(255, 79, 79, 0.08);
        border: 1px solid rgba(255, 79, 79, 0.2);
        color: #ff5e5e;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        transition: all 0.2s;
    }
    
    .btn-delete-row:hover {
        background: rgba(255, 79, 79, 0.15);
        color: #ff4f4f;
    }
    
    .btn-delete-row::after {
        content: 'Remove Card';
    }
}

/* Print Variation Selector Styling */
.variation-select-group {
    margin: 20px 0;
}

.variation-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.variation-pill {
    font-family: var(--font-main);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.variation-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.variation-pill.active {
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.35);
}
