:root {
    --f2f-orange: #ff6b35;
    --f2f-orange-light: #ff8c42;
    --f2f-orange-dark: #e55a2b;
    --f2f-dark: #1a1a1a;
    --f2f-dark-light: #2d2d2d;
    --f2f-text: #ffffff;
    --f2f-success: #28a745;
    --f2f-warning: #ffc107;
    --f2f-danger: #dc3545;
    --f2f-info: #2196f3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--f2f-dark) 0%, var(--f2f-dark-light) 100%);
    color: var(--f2f-text);
    min-height: 100vh;
}

.container { 
    max-width: 1600px; 
    margin: 0 auto; 
}

.top-header {
    background: #000000;
    border-bottom: 3px solid var(--f2f-orange);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 60px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--f2f-orange);
    font-weight: 800;
    font-size: 16px;
    overflow: visible;
    padding: 8px 12px;
}

.header-logo-image {
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.header-logo-fallback {
    display: none;
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.location-indicator {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
    margin-left: 10px;
    color: #ffed4e;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.header-btn {
    background: var(--f2f-orange);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-btn:hover {
    background: var(--f2f-orange-light);
    transform: translateY(-1px);
}

.header-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.currency-display {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--f2f-orange);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-section {
    background: var(--f2f-dark-light);
    border-bottom: 2px solid var(--f2f-orange);
    padding: 0;
}

.tab-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0;
}

.tab-btn {
    flex: 1;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-bottom: 4px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
    background: var(--f2f-orange);
    color: white;
    border-bottom: 4px solid var(--f2f-orange-dark);
}

.search-section {
    background: linear-gradient(135deg, var(--f2f-orange) 0%, var(--f2f-orange-light) 100%);
    border-bottom: 3px solid var(--f2f-orange-dark);
    padding: 30px 20px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box { 
    width: 100%; 
    padding: 18px 24px 18px 56px;
    font-size: 16px; 
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
    color: var(--f2f-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-box:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.search-box::placeholder {
    color: #666;
    font-weight: 400;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--f2f-orange);
    font-size: 20px;
}

.main-content {
    padding: 20px;
}

.card-table { 
    background: rgba(255,255,255,0.98);
    border: 3px solid var(--f2f-orange);
    width: 100%; 
    border-collapse: collapse;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.card-table th { 
    background: linear-gradient(135deg, var(--f2f-dark) 0%, var(--f2f-dark-light) 100%);
    color: var(--f2f-orange);
    font-weight: 700;
    border: 2px solid #333;
    padding: 20px 15px; 
    text-align: left; 
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.card-table td { 
    border: 1px solid #e0e0e0;
    padding: 18px 15px; 
    vertical-align: middle;
    color: var(--f2f-dark);
    font-weight: 500;
}

.card-row:nth-child(even) { 
    background: rgba(255, 107, 53, 0.03);
}

.card-row:hover { 
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 140, 66, 0.1)) !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

.price-cell { 
    font-weight: 700;
    text-align: right;
    font-family: 'Inter', monospace;
    font-size: 15px;
}

.nm-price { 
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #155724;
    border-left: 4px solid var(--f2f-success);
}

.pl-price { 
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-left: 4px solid var(--f2f-warning);
}

.hp-price { 
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid var(--f2f-danger);
}

.trade-price {
    background: linear-gradient(135deg, #d4edff, #b3d9ff);
    color: #004085;
    border-left: 4px solid var(--f2f-info);
    font-weight: 700;
}

.subheader-row th {
    background: rgba(26, 26, 26, 0.6) !important;
    color: var(--f2f-orange);
    font-weight: 600;
    font-size: 11px;
    padding: 10px 8px;
    border: 1px solid #444;
}

.card-name { 
    font-weight: 700;
    color: var(--f2f-dark);
    font-size: 15px;
}

.foil-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: var(--f2f-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading, .no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--f2f-orange-light);
    font-size: 18px;
    font-weight: 500;
}

.error-container {
    text-align: center; 
    padding: 60px 20px; 
    color: var(--f2f-orange); 
    background: rgba(255,107,53,0.1); 
    border: 2px solid rgba(255,107,53,0.3); 
    border-radius: 16px; 
    margin: 20px 0;
}

.error-title {
    margin-bottom: 20px; 
    color: var(--f2f-orange);
    font-size: 24px;
    font-weight: 700;
}

.error-message {
    font-size: 18px; 
    margin-bottom: 20px;
}

.error-details {
    color: var(--f2f-orange-light);
}

.card-name-with-image {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.card-name-with-image:hover {
    text-decoration: underline;
    color: var(--f2f-orange);
}

.image-hover-preview {
    display: none;
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--f2f-orange);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.image-hover-preview img {
    width: 300px;
    height: auto;
    display: block;
}

.image-hover-preview img:not(:last-child) {
    border-right: 2px solid var(--f2f-orange);
}

.image-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--f2f-orange);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    animation: fadeIn 0.2s ease;
    max-width: 95vw;
    max-height: 90vh;
}

.image-overlay.active {
    display: block;
}

.image-overlay img {
    width: 300px;
    height: auto;
    display: block;
}

.image-overlay img:not(:last-child) {
    border-right: 2px solid var(--f2f-orange);
}

.image-overlay-close {
    position: absolute;
    top: 5px;
    right: 5px;
    color: white;
    background: var(--f2f-orange);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s ease;
}

.image-overlay-close:hover {
    background: var(--f2f-orange-light);
    transform: scale(1.1);
}

.image-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.image-backdrop.active {
    display: block;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .header-left {
        justify-content: center;
    }

    .header-title {
        font-size: 20px;
    }

    .header-buttons {
        justify-content: center;
        width: 100%;
    }

    .header-btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }

    .currency-display {
        width: 100%;
        justify-content: center;
    }

    .tab-btn {
        max-width: none;
        font-size: 14px;
        padding: 15px 20px;
    }

    .search-section {
        padding: 20px 15px;
    }
    
    .search-box { 
        font-size: 16px; 
        padding: 16px 20px 16px 50px;
    }

    .search-icon {
        left: 18px;
    }
    
    .card-table { 
        font-size: 13px; 
        display: block; 
    }

    .card-table thead, .card-table tbody, .card-table tr { 
        display: block; 
    }

    .card-table thead { 
        display: none; 
    }
    
    .card-table tr {
        display: block;
        background: white;
        border-bottom: 2px solid var(--f2f-orange);
        margin: 0;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-table tr:last-child { 
        border-bottom: none; 
    }
    
    .card-table td {
        border: none;
        padding: 0;
        display: block;
    }
    
    .card-table td[data-label="Card"],
    .card-table td[data-label="Product"] {
        font-size: 16px;
        font-weight: 700;
        color: var(--f2f-dark);
        margin-bottom: 12px;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
    }
    
    .card-table td[data-label="Finish"],
    .card-table td[data-label="Finish / Edition"],
    .card-table td[data-label="NM Cash"],
    .card-table td[data-label="NM Trade"],
    .card-table td[data-label="PL Cash"],
    .card-table td[data-label="PL Trade"],
    .card-table td[data-label="HP Cash"],
    .card-table td[data-label="HP Trade"],
    .card-table td[data-label="Cash"],
    .card-table td[data-label="Trade"],
    .card-table td[data-label="NM"],
    .card-table td[data-label="PL"],
    .card-table td[data-label="HP"],
    .card-table td[data-label="Buy Price"] {
        display: none !important;
    }
    
    .mobile-price-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 10px;
    }
    
    .mobile-price-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 6px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 600;
        min-height: 40px;
        justify-content: center;
    }
    
    .mobile-price-label {
        font-size: 10px;
        font-weight: 700;
        margin-bottom: 2px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .foil-badge {
        font-size: 9px;
        padding: 2px 6px;
        margin-left: 6px;
    }

    .image-hover-preview {
        display: none !important;
    }
    
    .image-overlay {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
    }
    
    .image-overlay.single-image img {
        width: 85vw;
        max-width: 350px;
    }
    
    .image-overlay.double-image img {
        width: 42vw;
        max-width: 200px;
    }

    .image-overlay-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

@media (max-width: 500px) {
    .header-title {
        font-size: 18px;
    }

    .header-logo {
        height: 45px;
        font-size: 14px;
    }

    .image-overlay.double-image {
        overflow-y: auto;
    }
    
    .image-overlay.double-image img {
        width: 85vw;
        max-width: 280px;
    }
}

@media (min-width: 769px) {
    .mobile-price-grid { 
        display: none !important; 
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-table {
    animation: fadeIn 0.5s ease-out;
}
/* ========== HOTLIST STYLES ========== */

.hotlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
    padding: 30px;
}

.hotlist-card {
    background: #2d2d2d;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hotlist-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(255, 107, 53, 0.5);
}

.hotlist-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 140%; /* 1:1.4 aspect ratio for card images */
    overflow: hidden;
}

.hotlist-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hotlist-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 0) 100%);
    padding: 20px 16px 16px;
    color: white;
}

.hotlist-card-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hotlist-card-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hotlist-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    flex-wrap: nowrap;
}

.hotlist-price-amount {
    color: #ffffff;
    font-weight: 800;
    font-size: 22px;
    min-width: 70px;
}

.hotlist-price-type {
    color: #ff8c42;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotlist-price-divider {
    color: #666;
    font-weight: 400;
    font-size: 20px;
    margin: 0 4px;
}

.hotlist-price-label {
    color: #ff8c42;
    font-weight: 700;
    font-size: 22px;
}

.hotlist-price-value {
    color: #ffffff;
    font-weight: 800;
    font-size: 24px;
}

.hotlist-price-sublabel {
    font-size: 11px;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #ff8c42;
    font-weight: 600;
}

/* Responsive adjustments for hotlist */
@media (max-width: 768px) {
    .hotlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
        padding: 12px;
    }
    
    .hotlist-card-name {
        font-size: 12px;
    }
    
    .hotlist-price-row {
        font-size: 11px;
    }
    
    .hotlist-price-value {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hotlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}