/* =============================================================================
   Game Deal Tracker - Main Stylesheet
   ============================================================================= */

/* =============================================================================
   CSS Variables & Theme
   ============================================================================= */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f0f1a;
    --text-primary: #eee;
    --text-secondary: #888;
    --accent: #00d4ff;
    --accent-secondary: #ff6b6b;
    --green: #4ade80;
    --red: #ff6b6b;
    --yellow: #f59e0b;
    --purple: #e879f9;
    --border: #333;
    
    /* Aliases for JS compatibility */
    --card-bg: var(--bg-secondary);
    --bg-color: var(--bg-tertiary);
    --text-color: var(--text-primary);
    --text-muted: var(--text-secondary);
    --accent-color: var(--accent);
    --border-color: var(--border);
}

[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --accent: #0088cc;
    --accent-secondary: #dc2626;
    --green: #16a34a;
    --red: #dc2626;
    --yellow: #d97706;
    --purple: #c026d3;
    --border: #ddd;
    
    --card-bg: var(--bg-secondary);
    --bg-color: var(--bg-tertiary);
    --text-color: var(--text-primary);
    --text-muted: var(--text-secondary);
    --accent-color: var(--accent);
    --border-color: var(--border);
}

/* =============================================================================
   Base Styles
   ============================================================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}

h1 {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin: 0;
}

h2 {
    color: var(--accent-secondary);
    margin-top: 30px;
}

.hidden {
    display: none !important;
}

/* =============================================================================
   Header
   ============================================================================= */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
    gap: 15px;
}

.header-row h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-link, .theme-toggle {
    font-size: 24px;
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.admin-link:hover, .theme-toggle:hover {
    opacity: 1;
}

.layout-toggle {
    font-size: 20px;
    color: var(--text-color);
    opacity: 0.5;
    cursor: pointer;
    background: none;
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.layout-toggle:hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
}

.layout-toggle.active {
    opacity: 1;
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    text-shadow: 0 0 1px rgba(0,0,0,0.3);
}

[data-theme="light"] .layout-toggle {
    opacity: 0.6;
}

[data-theme="light"] .layout-toggle:hover {
    background: rgba(0,0,0,0.1);
}

[data-theme="light"] .layout-toggle.active {
    opacity: 1;
    color: #000;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* =============================================================================
   Status Bar
   ============================================================================= */
.status-bar {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-item {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.status-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
}

/* =============================================================================
   Tabs
   ============================================================================= */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    background: #16213e;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
}

.tab.active {
    background: #0f3460;
    color: #00d4ff;
}

.tab .count {
    background: #333;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 5px;
}

.tab.active .count {
    background: #00d4ff;
    color: #1a1a2e;
}

.tab-content {
    display: none;
}

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

/* =============================================================================
   Filter Bar
   ============================================================================= */
.filter-bar {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f0f1a;
    color: #eee;
    font-size: 14px;
    min-width: 150px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #00d4ff;
}

.discount-slider {
    width: 120px;
}

.discount-value {
    color: #00d4ff;
    font-weight: bold;
    min-width: 45px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.clear-filters {
    background: var(--border);
    color: var(--text-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.clear-filters:hover {
    background: var(--text-secondary);
}

.export-btn {
    background: linear-gradient(135deg, var(--green) 0%, #16a34a 100%);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    font-weight: bold;
}

.export-btn:hover {
    opacity: 0.9;
}

/* =============================================================================
   Products Grid & Cards
   ============================================================================= */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.search-sort-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #16213e;
    color: #eee;
    font-size: 16px;
}

.search-box:focus {
    outline: none;
    border-color: #00d4ff;
}

.sort-select {
    padding: 12px 15px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #16213e;
    color: #eee;
    font-size: 14px;
    cursor: pointer;
    min-width: 180px;
}

.sort-select:focus {
    outline: none;
    border-color: #00d4ff;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.product-card {
    background: var(--card-bg, #16213e);
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s;
    position: relative;
    display: flex;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

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

.product-card.is-new {
    border: 1px solid #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.product-card.is-new::before {
    content: "NEW";
    position: absolute;
    top: -8px;
    right: 10px;
    background: #4ade80;
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
}

.product-card.is-wishlisted {
    border: 1px solid #e879f9;
    box-shadow: 0 0 15px rgba(232, 121, 249, 0.2);
}

/* Compact card mode */
.product-card.compact {
    padding: 10px;
    gap: 10px;
}

.product-card.compact::before {
    display: none;
}

.product-card.compact .product-thumbnail {
    width: 44px;
    height: 44px;
}

.product-card.compact .product-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card.compact .product-name a {
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card.compact .price-row {
    font-size: 12px;
}

.product-card.compact .product-badges {
    display: none;
}

.product-card.compact .product-meta {
    display: none;
}

/* Wishlist button - positioned absolutely on card */
.product-card .wishlist-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.product-card .wishlist-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.product-card .wishlist-btn.active {
    opacity: 1;
}

.product-card.compact .wishlist-btn {
    font-size: 14px;
    padding: 3px 5px;
    top: 4px;
    right: 4px;
}

.product-card.compact .compact-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-card:not(.compact) .compact-meta {
    display: none;
}

/* Product Thumbnail */
.product-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #0f0f1a;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 24px;
}

/* Product Info */
.product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-name {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.product-name a {
    color: #00d4ff;
    text-decoration: none;
    flex: 1;
}

.product-name a:hover {
    text-decoration: underline;
}

/* Buttons - base styles for wishlist buttons outside product cards */
.wishlist-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.wishlist-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.wishlist-btn.active {
    opacity: 1;
}

.info-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.info-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Price Row */
.price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.product-price {
    color: #4ade80;
    font-size: 20px;
    font-weight: bold;
}

.product-original {
    color: #888;
    text-decoration: line-through;
    font-size: 14px;
}

.product-meta {
    font-size: 12px;
    color: #888;
}

/* Badges */
.discount-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.discount-badge.big {
    background: #e11d48;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.savings {
    color: #4ade80;
    font-size: 12px;
    font-weight: 500;
}

.product-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Stock Badges */
.stock-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.stock-badge.low {
    background: #f59e0b;
    color: #1a1a2e;
}

.stock-badge.out {
    background: #ff6b6b;
    color: white;
}

.stock-badge.medium {
    background: #60a5fa;
    color: #1a1a2e;
}

.stock-badge.good {
    background: #4ade80;
    color: #1a1a2e;
}

/* Store Badges */
.store-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.store-badge.gamenerdz {
    background: #00d4ff;
    color: #1a1a2e;
}

.store-badge.miniaturemarket {
    background: #ff6b6b;
    color: white;
}

/* BGG Rating */
.bgg-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #3d5a80;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.bgg-rating.high {
    background: #2e7d32;
}

.bgg-rating.medium {
    background: #f57c00;
}

.bgg-rating.low {
    background: #c62828;
}

.bgg-rating a {
    color: inherit;
    text-decoration: none;
}

.bgg-rating a:hover {
    text-decoration: underline;
}

/* Compact mode meta */
.bgg-compact {
    font-size: 11px;
    color: #f59e0b;
}

.stock-compact {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.stock-compact.out {
    color: #fff;
    background: #dc2626;
}

.stock-compact.low {
    color: #fff;
    background: #ef4444;
}

.stock-compact.medium {
    color: #1a1a2e;
    background: #f59e0b;
}

/* Complexity Badges */
.complexity-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
}

.complexity-badge.light {
    background: #4ade80;
    color: #1a1a2e;
}

.complexity-badge.medium-light {
    background: #a3e635;
    color: #1a1a2e;
}

.complexity-badge.medium {
    background: #f59e0b;
    color: #1a1a2e;
}

.complexity-badge.heavy {
    background: #ef4444;
    color: white;
}

/* =============================================================================
   Section Headers
   ============================================================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.section-header h2 {
    margin: 0;
}

.section-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-filters .filter-select {
    padding: 6px 12px;
    font-size: 13px;
}

/* =============================================================================
   Special Sections (New, Price Changes, Removed, etc.)
   ============================================================================= */
.new-items-section {
    background: linear-gradient(135deg, #1e3a1e 0%, #16213e 100%);
    border: 2px solid #4ade80;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.new-items-section h2 {
    color: #4ade80;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.new-item-card {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid #4ade80;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    display: flex;
    gap: 12px;
}

.new-item-card .product-thumbnail {
    width: 70px;
    height: 70px;
}

.new-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.new-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: #4ade80;
    color: #1a1a2e;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

/* Price Changes Section */
.price-changes-section {
    background: linear-gradient(135deg, #3a2a1e 0%, #16213e 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.price-changes-section h2 {
    color: #f59e0b;
    margin-top: 0;
}

.price-change-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
}

.price-change-name {
    flex: 1;
    margin-right: 15px;
}

.price-change-values {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.price-old {
    color: #888;
    text-decoration: line-through;
}

.price-arrow {
    color: #f59e0b;
}

.price-new {
    color: #4ade80;
}

.price-new.up {
    color: #ff6b6b;
}

/* Removed Section */
.removed-section {
    background: linear-gradient(135deg, #3a1e1e 0%, #16213e 100%);
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.removed-section h2 {
    color: #ff6b6b;
    margin-top: 0;
}

.removed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.removed-item {
    background: rgba(255, 107, 107, 0.15);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    color: #ff9999;
}

/* Recently Added Section */
.recent-items-section {
    background: linear-gradient(135deg, #1e2a3a 0%, #16213e 100%);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.recent-items-section h2 {
    color: #00d4ff;
    margin-top: 0;
}

.new-item-card.recent {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

/* Wishlist Section */
.wishlist-section {
    background: linear-gradient(135deg, #3a1e3a 0%, #16213e 100%);
    border: 2px solid #e879f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.wishlist-section h2 {
    color: #e879f9;
    margin-top: 0;
}

.new-item-card.wishlist {
    border-color: #e879f9;
    background: rgba(232, 121, 249, 0.1);
}

/* =============================================================================
   Stats Row
   ============================================================================= */
.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: #16213e;
    border-radius: 8px;
    padding: 15px 25px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #00d4ff;
}

.stat-number.green { color: #4ade80; }
.stat-number.red { color: #ff6b6b; }
.stat-number.yellow { color: #f59e0b; }
.stat-number.purple { color: #e879f9; }

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-top: 5px;
}

/* =============================================================================
   Pagination
   ============================================================================= */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-size: 14px;
    min-width: 100px;
    text-align: center;
}

.product-count {
    color: #888;
    font-size: 14px;
}

/* =============================================================================
   Empty States
   ============================================================================= */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-section {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-style: italic;
}

/* =============================================================================
   Changelog
   ============================================================================= */
.changelog {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* =============================================================================
   Modal
   ============================================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

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

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

.modal-content {
    background: linear-gradient(145deg, #1e1e32, #16162a);
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 
                0 0 0 1px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease-out;
}

[data-theme="light"] .modal-content {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
}

[data-theme="light"] .modal-header h3 {
    color: #1a1a2e;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    padding: 8px 12px;
    line-height: 1;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

.modal-body {
    padding: 24px;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 500px) {
    .modal-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.modal-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .modal-stat {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #00d4ff;
    white-space: nowrap;
}

[data-theme="light"] .modal-stat-value {
    color: #0088cc;
}

.modal-stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.modal-section-title {
    font-size: 11px;
    color: #00d4ff;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

[data-theme="light"] .modal-section-title {
    color: #0088cc;
}

.modal-description {
    color: #bbb;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 10px;
    border-left: 3px solid #00d4ff;
}

[data-theme="light"] .modal-description {
    color: #555;
    background: rgba(0, 0, 0, 0.03);
    border-left-color: #0088cc;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.modal-tag {
    background: rgba(0, 212, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.2s;
}

.modal-tag:hover {
    background: rgba(0, 212, 255, 0.25);
}

[data-theme="light"] .modal-tag {
    background: rgba(0, 136, 204, 0.1);
    color: #0088cc;
    border-color: rgba(0, 136, 204, 0.3);
}

.modal-categories, .modal-mechanics {
    margin-bottom: 16px;
}

.modal-links {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .modal-links {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.modal-link {
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    flex: 1;
}

.modal-link.primary {
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.modal-link.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.modal-link.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-link.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .modal-link.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   Bento Grid Layout
   ============================================================================= */
.bento-layout { display: none; }
.bento-layout.active { display: block; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.bento-stat {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid;
}

.bento-stat.cyan {
    background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,212,255,0.05));
    border-color: rgba(0,212,255,0.3);
}

.bento-stat.green {
    background: linear-gradient(135deg, rgba(74,222,128,0.2), rgba(74,222,128,0.05));
    border-color: rgba(74,222,128,0.3);
}

.bento-stat.purple {
    background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(168,85,247,0.05));
    border-color: rgba(168,85,247,0.3);
}

.bento-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.bento-stat.cyan .bento-stat-value { color: #00d4ff; }
.bento-stat.green .bento-stat-value { color: #4ade80; }
.bento-stat.purple .bento-stat-value { color: #a855f7; }

.bento-stat-label {
    color: #888;
    font-size: 10px;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bento-section {
    background: rgba(30,30,50,0.5);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .bento-section {
    background: rgba(0,0,0,0.03);
}

.bento-section.col-span-2 { grid-column: span 2; }
.bento-section.col-span-3 { grid-column: span 3; }

@media (max-width: 900px) {
    .bento-section.col-span-2, .bento-section.col-span-3 { grid-column: span 2; }
}

@media (max-width: 500px) {
    .bento-section.col-span-2, .bento-section.col-span-3 { grid-column: span 1; }
}

.bento-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.bento-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.bento-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 700px) {
    .bento-cards { grid-template-columns: 1fr; }
}

.bento-cards.grid-3 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 700px) {
    .bento-cards.grid-3 { grid-template-columns: 1fr; }
}

.bento-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-page-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
}

.bento-page-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
}

.bento-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bento-page-info {
    font-size: 12px;
    color: #888;
}

/* =============================================================================
   Magazine Layout
   ============================================================================= */
.magazine-layout { display: none; }
.magazine-layout.active { display: block; }

.magazine-hero {
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(30,30,50,1), rgba(168,85,247,0.15));
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    position: relative;
}

[data-theme="light"] .magazine-hero {
    background: linear-gradient(135deg, rgba(0,136,204,0.1), #fff, rgba(168,85,247,0.1));
}

/* Magazine hero buttons */
.magazine-hero-wishlist {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.magazine-hero-wishlist:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

.magazine-hero-wishlist.active {
    background: rgba(232, 121, 249, 0.3);
}

.magazine-hero-info-btn {
    position: absolute;
    top: 15px;
    right: 65px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.magazine-hero-info-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: scale(1.1);
}

[data-theme="light"] .magazine-hero-wishlist,
[data-theme="light"] .magazine-hero-info-btn {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="light"] .magazine-hero-wishlist:hover {
    background: rgba(255, 255, 255, 1);
}

[data-theme="light"] .magazine-hero-info-btn:hover {
    background: rgba(0, 136, 204, 0.2);
}

/* Magazine hero title link */
.magazine-hero-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.magazine-hero-title-link:hover .magazine-hero-title {
    color: var(--accent);
    text-decoration: underline;
}

.magazine-hero-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

@media (max-width: 600px) {
    .magazine-hero-content { flex-direction: column; text-align: center; }
}

.magazine-hero-image {
    width: 140px;
    height: 140px;
    background: var(--card-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.magazine-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.magazine-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
    color: #1a1a2e;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.magazine-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 12px 0;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .magazine-hero-title { font-size: 22px; }
}

.magazine-hero-desc {
    color: #888;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    max-height: 4.5em;
}

.magazine-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 600px) {
    .magazine-hero-stats { justify-content: center; }
}

.magazine-hero-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-color);
}

.magazine-hero-original {
    font-size: 18px;
    color: #888;
    text-decoration: line-through;
}

.magazine-hero-discount {
    background: #4ade80;
    color: #1a1a2e;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
}

.magazine-hero-rating {
    background: rgba(245,158,11,0.2);
    color: #f59e0b;
    padding: 6px 14px;
    border-radius: 20px;
}

.magazine-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

.magazine-column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.magazine-column-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.magazine-column-icon.green { background: rgba(74,222,128,0.2); }
.magazine-column-icon.red { background: rgba(239,68,68,0.2); }
.magazine-column-icon.yellow { background: rgba(245,158,11,0.2); }

.magazine-column-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.magazine-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mini Card (shared by Magazine & Bento) */
.mini-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.mini-card-thumb {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.mini-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mini-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mini-card-name a {
    color: inherit;
    text-decoration: none;
}

.mini-card-name a:hover {
    color: var(--accent-color);
}

.mini-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mini-card-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 13px;
}

.mini-card-discount {
    background: #4ade80;
    color: #1a1a2e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
}

.mini-card-stock {
    font-size: 10px;
    color: #f59e0b;
}

.mini-card-stock.low {
    color: #ef4444;
    font-weight: 600;
}

.mini-card-rating {
    font-size: 11px;
    color: #f59e0b;
}

/* =============================================================================
   Compact List Layout
   ============================================================================= */
.compact-layout { display: none; }
.compact-layout.active { display: block; }

.compact-stats-bar {
    display: flex;
    gap: 0;
    background: rgba(30,30,50,0.5);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
}

[data-theme="light"] .compact-stats-bar {
    background: rgba(0,0,0,0.03);
}

.compact-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-right: 1px solid var(--border-color);
}

.compact-stat:last-child {
    border-right: none;
}

.compact-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.compact-stat-value.white { color: var(--text-color); }
.compact-stat-value.green { color: #4ade80; }
.compact-stat-value.cyan { color: #00d4ff; }
.compact-stat-value.yellow { color: #f59e0b; }

.compact-stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.compact-section {
    background: rgba(30,30,50,0.5);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 16px;
}

[data-theme="light"] .compact-section {
    background: rgba(0,0,0,0.03);
}

.compact-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .compact-section-header {
    background: rgba(0,0,0,0.05);
}

.compact-section-title {
    font-weight: 700;
    color: var(--text-color);
}

.compact-section-meta {
    font-size: 13px;
    color: #888;
}

.compact-list {
    display: flex;
    flex-direction: column;
}

.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.compact-row:last-child {
    border-bottom: none;
}

.compact-row:hover {
    background: rgba(255,255,255,0.03);
}

[data-theme="light"] .compact-row:hover {
    background: rgba(0,0,0,0.02);
}

.compact-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.compact-row-thumb {
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.compact-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-row-info {
    min-width: 0;
}

.compact-row-name {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-row-name a {
    color: inherit;
    text-decoration: none;
}

.compact-row-name a:hover {
    color: var(--accent-color);
}

.compact-row-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.compact-row-right {
    text-align: right;
    flex-shrink: 0;
}

.compact-row-price {
    font-weight: 700;
    color: var(--accent-color);
}

.compact-row-price-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 2px;
}

.compact-row-original {
    color: #888;
    text-decoration: line-through;
    font-size: 13px;
}

.compact-row-discount {
    color: #4ade80;
    font-size: 13px;
}

.compact-row-discount.badge {
    background: #4ade80;
    color: #1a1a2e;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
}

/* User Authentication Links */
.user-link {
    font-size: 14px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.user-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.user-link.logout {
    color: var(--red);
    opacity: 0.7;
}

.user-link.logout:hover {
    opacity: 1;
    background: rgba(255, 107, 107, 0.1);
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

/* Flash messages for main page */
.flash-container {
    max-width: 1400px;
    margin: 0 auto 20px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-message.error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid var(--red);
    color: var(--red);
}

.flash-message.success {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid var(--green);
    color: var(--green);
}

.flash-message.info {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.flash-message .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
}

.flash-message .close-btn:hover {
    opacity: 1;
}

/* Compact Row Wishlist Button */
.wishlist-btn.compact {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    margin-right: 8px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.wishlist-btn.compact:hover {
    opacity: 1;
    transform: scale(1.1);
}

.wishlist-btn.compact.active {
    opacity: 1;
}

.compact-row-left {
    display: flex;
    align-items: center;
}

/* Ensure compact rows can be wishlisted */
.compact-row.is-wishlisted {
    background: rgba(147, 51, 234, 0.1);
    border-left: 3px solid var(--purple, #9333ea);
}

/* Watchlist Section Styles */
.watchlist-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.watchlist-section h2 {
    color: var(--yellow, #f59e0b);
}

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.watchlist-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.watchlist-card:hover {
    border-color: var(--yellow, #f59e0b);
    transform: translateY(-2px);
}

.watchlist-card-icon {
    font-size: 24px;
    opacity: 0.6;
}

.watchlist-card-info {
    flex: 1;
    min-width: 0;
}

.watchlist-card-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-card-name a {
    color: inherit;
    text-decoration: none;
}

.watchlist-card-name a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.watchlist-card-year {
    font-size: 12px;
    color: var(--text-secondary);
}

.watchlist-card-status {
    font-size: 11px;
    color: var(--yellow, #f59e0b);
    background: rgba(245, 158, 11, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
}

.watchlist-card-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.watchlist-card-remove:hover {
    opacity: 1;
    color: var(--red);
}

/* =============================================================================
   Mobile Responsive Styles
   ============================================================================= */

/* Tablet and below */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    /* Header stacks on tablet */
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-row h1 {
        font-size: 1.5rem;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    /* Tabs scroll horizontally */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 5px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Filter bar becomes vertical */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select, .filter-input {
        width: 100%;
    }
    
    /* Grid adapts */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    /* Search/sort stacks */
    .search-sort-container {
        flex-direction: column;
        width: 100%;
    }
    
    .search-box, .sort-select {
        width: 100%;
        min-width: unset;
    }
    
    /* Bento grid simplifies */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .bento-featured {
        grid-column: span 1;
    }
    
    /* Magazine columns stack */
    .magazine-columns {
        grid-template-columns: 1fr;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .header-row h1 {
        font-size: 1.25rem;
    }
    
    /* Smaller product grid for phones */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Product cards adjust */
    .product-card {
        flex-direction: column;
        padding: 12px;
    }
    
    .product-thumbnail {
        width: 100%;
        height: 150px;
        margin-bottom: 10px;
    }
    
    .product-info {
        width: 100%;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    /* Prices side by side */
    .price-container {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    /* Touch-friendly buttons */
    .tab {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .layout-toggle {
        padding: 10px 12px;
        font-size: 18px;
    }
    
    .wishlist-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* Filter checkboxes bigger */
    .filter-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    /* Modal fullscreen on mobile */
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-game-title {
        font-size: 20px;
    }
    
    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* Stats panel */
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Bento cards */
    .bento-card {
        padding: 14px;
    }
    
    .bento-card-title {
        font-size: 13px;
    }
    
    /* Magazine hero */
    .magazine-hero {
        padding: 16px;
    }
    
    .magazine-hero-image {
        width: 100px;
        height: 100px;
    }
    
    .magazine-hero-price {
        font-size: 24px;
    }
    
    /* User controls */
    .user-link {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Export button */
    .export-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    body {
        padding: 6px;
    }
    
    .header-row h1 {
        font-size: 1.1rem;
    }
    
    .tab {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
}

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work on touch */
    .product-card:hover {
        transform: none;
    }
    
    /* Make clickable elements more obvious */
    .product-card {
        cursor: pointer;
    }
    
    /* Larger tap targets */
    .tab, .layout-toggle, .wishlist-btn, .filter-checkbox label {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Active states instead of hover */
    .product-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .tab:active, .layout-toggle:active {
        opacity: 0.7;
    }
}
