/* Comic Valuator - Main Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #16a34a;
    --success-light: #22c55e;
    --danger: #dc2626;
    --danger-light: #ef4444;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.logo span {
    background: linear-gradient(135deg, var(--gray-600), var(--gray-800));
    -webkit-background-clip: text;
    background-clip: text;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary);
}

/* Hamburger Menu - Always visible */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 200;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation menu - slide-out panel */
.nav-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    z-index: 150;
}

.nav-menu.active {
    right: 0;
}

.nav-menu a,
.nav-menu span {
    font-size: 1.125rem;
    padding: 0.5rem 0;
    width: 100%;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu .btn {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

/* Overlay for closing menu */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
}

.nav-overlay.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #15803d);
    color: white;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Main Content */
main {
    padding: 2rem 0 0 0;
}

/* Hero Section */
.hero-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    text-align: center;
    padding: 2.5rem 2rem;
}

.hero-card h1 {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gray-800), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.75rem;
}

.search-box input {
    flex: 1;
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
}

.search-box .btn {
    padding: 0.875rem 1.5rem;
}

/* Quick Search Links (Popular Titles / Recent Searches) */
.quick-search-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--gray-700);
    color: var(--gray-300);
    text-decoration: none;
    border-radius: 1rem;
    font-size: 0.8125rem;
    transition: all 0.2s;
    border: 1px solid var(--gray-600);
}

.quick-search-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Search Results Table */
.search-results {
    margin-top: 1.5rem;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.results-table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-table tbody tr {
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.results-table tbody tr:hover {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    transform: scale(1.01);
}

.results-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.results-table .cover-cell {
    width: 60px;
    padding: 0.5rem;
}

.results-table .cover-cell img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-sm);
}

.results-table .title-cell {
    font-weight: 600;
    color: var(--gray-800);
}

.results-table .title-cell strong {
    display: block;
    margin-bottom: 0.25rem;
}

.results-table .title-cell .comic-desc {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
}

.results-table .issue-cell {
    font-weight: 700;
    color: var(--primary);
}

.results-table .year-cell {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.results-table .publisher-cell {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Analysis Section */
.analysis-section {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.comic-header {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50), white);
    border-bottom: 2px solid var(--gray-100);
}

.comic-header img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.comic-header-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.comic-header-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analysis-grid > .card {
    margin-bottom: 0;
}

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

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.875rem;
}

.data-table thead {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table th:not(:first-child) {
    text-align: right;
}

.data-table tbody tr {
    background: white;
    transition: background 0.2s;
}

.data-table tbody tr:nth-child(odd) {
    background: var(--gray-50);
}

.data-table tbody tr:hover {
    background: #e0e7ff;
}

.data-table tbody tr.highlight {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    font-weight: 600;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.data-table td:not(:first-child) {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.data-table .positive {
    color: var(--success);
    font-weight: 600;
}

.data-table .negative {
    color: var(--danger);
    font-weight: 600;
}

/* Criteria List */
.criteria-list {
    list-style: none;
}

.criteria-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.criteria-item:nth-child(odd) {
    background: var(--gray-50);
}

.criteria-item:hover {
    background: var(--gray-100);
}

.criteria-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.criteria-icon.pass {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.criteria-icon.fail {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--danger);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.criteria-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.criteria-content p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Recommendation Badge */
.recommendation {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 1rem;
    margin: 1.5rem;
    position: relative;
    overflow: hidden;
}

.recommendation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    z-index: 0;
}

.recommendation.yes {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 3px solid var(--success);
}

.recommendation.yes::before {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5l5 10 10 2-7 7 2 10-10-5-10 5 2-10-7-7 10-2z' fill='%2316a34a' fill-opacity='0.3'/%3E%3C/svg%3E");
}

.recommendation.no {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 3px solid var(--danger);
}

.recommendation h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.recommendation.yes h2 {
    color: var(--success);
}

.recommendation.no h2 {
    color: var(--danger);
}

.recommendation p {
    color: var(--gray-700);
    font-size: 1.125rem;
    position: relative;
    z-index: 1;
}

.recommendation .criteria-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.8);
    border-radius: 2rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Financials */
.financials-section {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.financials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.financial-item {
    text-align: center;
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, var(--gray-50), white);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
}

.financial-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.financial-item .label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.financial-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.financial-item .value.positive {
    color: var(--success);
}

.financial-item .value.negative {
    color: var(--danger);
}

/* Collection Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.comic-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.comic-card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--gray-200), var(--gray-100));
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.comic-card-content {
    padding: 1.25rem;
}

.comic-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.comic-card-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.comic-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comic-card-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comic-card-badge.yes {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
    border: 1px dashed var(--success);
}

.comic-card-badge.no {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--danger);
    border: 1px dashed var(--danger);
}

.comic-card-badge.graded {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

.comic-card-badge.needs-details {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px dashed #f59e0b;
}

.comic-card-badge.pending {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4338ca;
    border: 1px dashed #6366f1;
}

/* Raw estimate badge subtitle */
.comic-card-badge.yes::after,
.comic-card-badge.no::after {
    content: ' (est)';
    font-size: 0.6em;
    opacity: 0.7;
}

.comic-card-value {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
}

/* Summary Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab {
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
    border-radius: 0.5rem 0.5rem 0 0;
}

.tab:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

/* Options Box */
.options-box {
    background: linear-gradient(135deg, var(--gray-50), white);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    margin: 1.5rem 0;
}

.options-box .options-title {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

/* Footer */
footer {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

footer a {
    color: white;
}

/* Consistent Section Widths */
.section-card {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* Scrollable Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
    min-width: 100%;
}

/* Consistent vertical spacing */
main .card,
main .section-card,
.analysis-section,
.financials-section {
    margin-bottom: 1.5rem;
}

main .card:last-child,
main .section-card:last-child {
    margin-bottom: 0;
}

/* Full-width analysis grid columns on larger screens */
@media (min-width: 769px) {
    .analysis-grid {
        gap: 2rem;
    }
}

/* Analysis results container */
#analysis-results {
    display: block;
}

#analysis-results > .card {
    width: 100%;
}

/* Responsive */
@media (max-width: 640px) {
    .financials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-box {
        flex-direction: column;
    }

    .hero-card h1 {
        font-size: 1.75rem;
    }

    .results-table th:nth-child(4),
    .results-table td:nth-child(4) {
        display: none;
    }
}

/* No Cover Placeholder */
.no-cover {
    width: 50px;
    height: 75px;
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: var(--gray-500);
    text-align: center;
}

/* Search Breadcrumb */
.search-breadcrumb {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gray-50), white);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.search-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.search-breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.search-breadcrumb .breadcrumb-active {
    font-weight: 600;
    color: var(--gray-800);
}

/* Issue number cell */
.results-table .issue-cell {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* Read-only input styling */
input[readonly] {
    background: var(--gray-100);
    cursor: default;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 2.5rem;
    padding: 0.5rem 0.75rem;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--gray-500);
}

.pagination-info {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Issue Filter */
.issue-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gray-50), white);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.issue-filter label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.issue-filter input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Filter Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Results count badge */
.results-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .pagination {
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .issue-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .issue-filter span[style*="margin-left: auto"] {
        margin-left: 0 !important;
        width: 100%;
        text-align: left;
    }
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.pricing-table thead {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
}

.pricing-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.pricing-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.pricing-table tbody tr:hover {
    background: var(--gray-50);
}

.pricing-table tbody tr.highlight {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    font-weight: 500;
}

.pricing-table tbody tr.highlight:hover {
    background: linear-gradient(135deg, #bfdbfe, #c7d2fe);
}

.pricing-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.pricing-table td:first-child {
    color: var(--gray-800);
}

.pricing-table td.positive {
    color: var(--success);
    font-weight: 500;
}

.pricing-table td.negative {
    color: var(--danger);
    font-weight: 500;
}

/* Badge for estimated grade */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary);
    color: white;
    border-radius: 1rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.badge-variant {
    background: var(--warning);
    margin-left: 0;
}

.badge-standard {
    background: var(--success);
    margin-left: 0;
}

/* Price cell styling */
.price-cell {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-weight: 600;
    color: var(--success);
}

/* Base edition row highlighting */
.results-table tr.base-edition {
    background: rgba(22, 163, 74, 0.08);
}

.results-table tr.base-edition:hover {
    background: rgba(22, 163, 74, 0.15);
}

/* Variant header styling */
.variant-header {
    border: 1px solid var(--gray-200);
}

.variant-header img {
    box-shadow: var(--shadow);
}

/* Filter checkbox styling */
.filter-checkbox {
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.filter-checkbox input {
    margin-right: 0.375rem;
    cursor: pointer;
}

/* Pricing Summary Box */
.pricing-summary {
    background: var(--gray-100);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .pricing-table th,
    .pricing-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .pricing-table th:nth-child(5),
    .pricing-table td:nth-child(5) {
        display: none; /* Hide Premium % on mobile */
    }

    .pricing-summary > div {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Comic Detail Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.modal-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.modal-header img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

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

.modal-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.modal-stat {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.modal-stat-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.modal-stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.option-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.option-tag.selected {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
    border-color: var(--success);
}

.option-tag.unselected {
    background: var(--gray-50);
    color: var(--gray-400);
    border-color: var(--gray-200);
    opacity: 0.7;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-100);
}

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

@media (max-width: 640px) {
    .modal-content {
        padding: 1.5rem;
    }

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

    .modal-info {
        align-items: center;
    }

    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--gray-700);
    background: var(--gray-200);
}

.view-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Price Filter */
.price-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-filter input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Collection List View */
.collection-list {
    display: block !important;
}

.collection-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
}

.collection-table thead {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
}

.collection-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collection-table tbody tr {
    background: white;
    transition: all 0.2s;
}

.collection-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.collection-table tbody tr:hover {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.collection-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.collection-table .cover-cell {
    width: 50px;
    padding: 0.5rem;
}

.collection-table .cover-cell img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.collection-table .title-cell {
    max-width: 250px;
}

.collection-table .price-cell {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-weight: 600;
}

.collection-table .positive {
    color: var(--success);
}

.collection-table .negative {
    color: var(--danger);
}

@media (max-width: 768px) {
    .view-toggle {
        order: -1;
    }

    .price-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .collection-table th:nth-child(3),
    .collection-table td:nth-child(3),
    .collection-table th:nth-child(6),
    .collection-table td:nth-child(6) {
        display: none;
    }
}

/* Grouped View Styles */
.collection-grid.collection-grouped {
    display: block;
}

.grouped-collection {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.group-publisher {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    width: 100%;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.group-header:hover {
    background: var(--gray-50);
}

.publisher-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
}

.publisher-header:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
}

.series-header {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
}

.series-header:hover {
    background: var(--gray-200);
}

.group-toggle {
    font-size: 0.75rem;
    width: 1rem;
    flex-shrink: 0;
}

.group-name {
    font-weight: 600;
    flex-grow: 1;
}

.publisher-header .group-name {
    font-size: 1.125rem;
}

.series-header .group-name {
    font-size: 0.9375rem;
}

.group-stats {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
}

.group-content {
    padding: 0.5rem;
    background: var(--gray-50);
}

.group-series {
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.group-series:last-child {
    margin-bottom: 0;
}

.group-comics-table {
    width: 100%;
    overflow-x: auto;
}

.group-comics-table .collection-table {
    margin: 0;
    border-radius: 0;
}

.group-comics-table .collection-table th {
    background: var(--gray-50);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.group-comics-table .collection-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.group-comics-table .collection-table .cover-cell {
    width: 40px;
    padding: 0.375rem;
}

.group-comics-table .collection-table .cover-cell img {
    width: 35px;
    height: 52px;
}

.group-comics-table .collection-table .title-cell {
    max-width: 200px;
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .group-header {
        padding: 0.875rem 1rem;
    }

    .publisher-header .group-name {
        font-size: 1rem;
    }

    .group-stats {
        font-size: 0.6875rem;
    }

    .group-comics-table .collection-table th:nth-child(5),
    .group-comics-table .collection-table td:nth-child(5),
    .group-comics-table .collection-table th:nth-child(6),
    .group-comics-table .collection-table td:nth-child(6),
    .group-comics-table .collection-table th:nth-child(7),
    .group-comics-table .collection-table td:nth-child(7) {
        display: none;
    }
}

@media (max-width: 480px) {
    .group-comics-table .collection-table th:nth-child(1),
    .group-comics-table .collection-table td:nth-child(1) {
        display: none;
    }

    .group-comics-table .collection-table .title-cell {
        max-width: 120px;
    }
}

/* ==========================================
   MULTI-SELECT / BULK MODE STYLES
   ========================================== */

/* Selection Summary Bar */
.selection-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
    color: white;
    position: sticky;
    top: 70px;
    z-index: 50;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.selection-info .checkmark-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 0.75rem;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selection-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.selection-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.selection-actions .btn-primary {
    background: white;
    color: var(--primary);
    border: none;
    font-weight: 600;
}

.selection-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Issue Controls Container */
.issue-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gray-50), white);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.issue-controls .issue-filter {
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

/* Range Selector */
.range-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--gray-300);
}

.range-selector label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.range-selector input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    width: 60px;
    text-align: center;
}

.range-selector span {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Checkbox Cell in Table */
.results-table .checkbox-cell,
.issues-table .checkbox-cell {
    width: 40px;
    padding: 0.5rem !important;
    text-align: center;
}

.results-table .checkbox-cell input[type="checkbox"],
.issues-table .checkbox-cell input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Selected Row Styling */
.issue-row.selected {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff) !important;
}

.issue-row.selected:hover {
    background: linear-gradient(135deg, #bfdbfe, #c7d2fe) !important;
}

/* Bulk Warning Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.bulk-modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.bulk-modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bulk-modal-header .warning-icon {
    font-size: 1.5rem;
}

.bulk-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.bulk-modal-body {
    padding: 1.5rem;
}

.bulk-modal-body p {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
    line-height: 1.6;
}

.bulk-modal-body ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--gray-600);
}

.bulk-modal-body ul li {
    margin-bottom: 0.375rem;
}

.bulk-modal-body .note {
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--warning);
}

.bulk-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.bulk-modal-footer .btn {
    flex: 1;
}

/* Bulk Added Badge */
.badge-bulk {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .selection-summary-bar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .selection-info {
        width: 100%;
        justify-content: center;
    }

    .selection-actions {
        width: 100%;
        justify-content: center;
    }

    .issue-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .issue-controls .issue-filter {
        width: 100%;
        justify-content: space-between;
    }

    .range-selector {
        padding-left: 0;
        border-left: none;
        padding-top: 0.75rem;
        border-top: 1px solid var(--gray-200);
        width: 100%;
        justify-content: flex-start;
    }

    .bulk-modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .selection-actions .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .range-selector {
        flex-wrap: wrap;
    }

    .range-selector input {
        width: 50px;
    }
}
