/* Basic styles */
* {
    box-sizing: border-box;
}
html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

#app {
    width: 100%;
    margin: 0;
    padding: 0;
}

#app > div {
    width: 100%;
    margin: 0;
    padding: 0;
}

h1 {
    color: #333;
    text-align: center;
}
h2 {
    color: #666;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-controls {
    text-align: center;
    margin-bottom: 0;
    width: 100%;
    padding: 0 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.sort-controls label {
    margin-right: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.sort-controls select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    flex-grow: 1;
    min-width: 150px;
    max-width: 250px;
}

@media (max-width: 600px) {
    .sort-controls {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 5px;
    }
    .sort-controls label {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: auto;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0px;
    }
    .sort-controls select {
        width: 100%;
        margin-bottom: 10px;
    }
    .sort-controls label input[type="checkbox"] {
        margin-left: 5px;
        order: 1;
    }
}

.card-section {
    margin: 15px 0;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
ul {
    list-style: none;
    padding: 0;
}
li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}
.card-name {
    font-weight: bold;
    color: #333;
    position: relative;
    font-size: 0.9em;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-basis: 70%;
    max-width: 100%;
}

.card-name a:link,
.card-name a:visited,
.card-name a:hover,
.card-name a:active {
    color: #333333;
    text-decoration: none;
}

.card-price {
    color: #666;
    font-size: 0.9em;
    flex-basis: 30%;
    text-align: right;
}
li:last-child {
    border-bottom: none;
}
.hover-image {
    position: absolute;
    left: 100%;
    top: 0;
    z-index: 10;
    max-width: 300px;
    min-width: 150px;
    min-height: 150px;
}
.hover-image.show-hover-image {
    display: block;
}
.hover-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}
.hover-image-text {
    padding: 10px;
    text-align: center;
    color: #fff;
    margin-top: 15px;
    display: block;
    background-color: #000;
    border-radius: 5px;
}
.foil-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    display: inline-block;
    padding: 0;
    margin: 0;
    line-height: 0;
    position: relative;
    z-index: 0;
}

/* Animated shimmer effect using pseudo-element */
.foil-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -200%;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    pointer-events: none; /* Don't interfere with interactions */
    z-index: 1; /* Above the image */
    
    /* Create a bright, narrow, golden streak gradient */
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, /* A subtle inner white glow */
        rgba(255, 221, 0, 0.5) 60%, /* The bright gold core of the sheen */
        transparent 100%
    );
    
    animation: shimmer 2s infinite linear;
}

/* Keyframe animation for the shimmer effect */
@keyframes shimmer {
    to {
        left: 200%; /* Move the shimmer streak far off the right edge */
    }
}

.foil-image-wrapper img {
    display: block;
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}
.card-columns {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.card-column {
    position: absolute;
    width: 350px;
}


.rarity-subheader {
    text-align: center;
    color: #444;
    margin: 20px 0 10px 0;
    font-size: 1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.condition-subheader {
    text-align: center;
    color: #666;
    margin: 10px 0 5px 10px;
    font-size: 0.9em;
    font-weight: bold;
}

@media (max-width: 600px) {
    .card-columns {
        column-count: 1;
        column-width: auto;
        padding: 0 10px;
    }
    .card-columns {
        position: static;
        height: auto !important;
    }
    .card-column {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        top: auto !important;
        margin-bottom: 10px;
    }
    .card-section {
        margin: 10px 0;
        padding: 10px;
    }
}

.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close-button {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 10; /* Ensure close button is above the foil wrapper */
}

.modal-close-button img {
    width: 24px;
    height: 24px;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
}

.modal-no-image-text {
    padding: 10px;
    text-align: center;
    color: #fff;
    margin-top: 15px;
    display: block;
    background-color: #000;
    border-radius: 5px;
}

.set-icon {
    font-size: 1.2em;
    line-height: 1;
}

nav {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.nav-toggle {
    display: none;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

nav a {
    margin: 0 10px;
    text-decoration: none;
    font-weight: normal;
    color: #007bff;
    padding: 5px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

nav a.active {
    font-weight: bold;
    background-color: rgba(0, 123, 255, 0.1);
    text-decoration: none;
}

nav a:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.contact-email {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
    transition: color 0.2s ease;
}

.contact-email:hover {
    color: #007bff;
}

/* Mobile navbar collapse */
@media (max-width: 768px) {
    nav {
        position: relative;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 0 !important;
        margin: 0 0 20px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .nav-header {
        display: block;
        padding: 10px 0 10px 15px;
        position: relative;
        z-index: 1001;
        margin: 0 !important;
        width: auto;
        flex-shrink: 0;
        align-self: flex-start;
    }
    
    .nav-hamburger {
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        gap: 4px;
        z-index: 1002;
        margin: 0;
    }
    
    .hamburger-line {
        width: 100%;
        height: 3px;
        background-color: #007bff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .nav-hamburger-active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .nav-hamburger-active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .nav-hamburger-active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .nav-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        flex-direction: column;
        width: 70%;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        padding: 10px 0;
        margin-top: 5px;
        z-index: 1000;
        gap: 0;
    }
    
    .nav-links-visible {
        display: flex;
    }
    
    .nav-links a {
        margin: 0;
        width: 100%;
        text-align: left;
        padding: 16px 20px;
        border-radius: 0;
        display: block;
        font-size: 18px;
        -webkit-text-size-adjust: 100%;
    }
    
    .nav-links a:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    .nav-links a.active {
        background-color: rgba(0, 123, 255, 0.15);
    }
}

/* Mobile checkbox and form controls */
@media (max-width: 768px) {
    .sort-controls label input[type="checkbox"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        margin: 0 8px 0 0;
        -webkit-appearance: none;
        appearance: none;
        border: 2px solid #007bff;
        border-radius: 4px;
        cursor: pointer;
        position: relative;
    }
    
    .sort-controls label input[type="checkbox"]:checked {
        background-color: #007bff;
    }
    
    .sort-controls label input[type="checkbox"]:checked::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 16px;
        font-weight: bold;
    }
    
    .sort-controls label {
        font-size: 16px;
        padding: 8px 0;
    }
    
    .sort-controls select {
        font-size: 16px;
        padding: 12px;
        min-height: 44px; /* iOS recommended touch target size */
    }
}


/* Price Fluctuation Indicators */
.card-name .price-fluctuation-price-up {
    color: green;
}

.card-name .price-fluctuation-price-down {
    color: red;
}

/* Buy Options Modal (Desktop) */
.buy-options-modal {
    z-index: 200; /* Higher than hover image */
    justify-content: flex-start;
    align-items: flex-start;
}

.buy-options-content {
    min-width: 300px;
    max-width: 400px;
    padding: 20px;
    text-align: center;
    position: absolute;
    transform: none;
    margin: 0;
}

.buy-options-header {
    margin-bottom: 20px;
}

.buy-options-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #333;
}

.buy-options-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.buy-options-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.buy-option-button {
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.2s ease;
    text-align: center;
}

.buy-tcgplayer {
    background-color: #007bff;
    color: white;
}

.buy-tcgplayer:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.buy-ebay {
    background-color: #0064d2;
    color: white;
}

.buy-ebay:hover {
    background-color: #004a9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 100, 210, 0.3);
}

/* Mobile buy buttons in modal */
.mobile-buy-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 10px 10px 10px;
}

.mobile-buy-buttons .buy-option-button {
    width: 100%;
    box-sizing: border-box;
}

/* Disclaimer Footer */
.disclaimer-footer {
    margin-top: 60px;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-top: 2px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.disclaimer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #555;
    line-height: 1.6;
}

.disclaimer-content h3 {
    color: #333;
    font-size: 1em;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.disclaimer-content h3:first-child {
    margin-top: 0;
}

.disclaimer-content p {
    margin-bottom: 15px;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .disclaimer-footer {
        padding: 30px 15px;
        margin-top: 40px;
    }
    
    .disclaimer-content h3 {
        font-size: 0.95em;
    }
    
    .disclaimer-content p {
        font-size: 0.8em;
    }
}

/* Disclaimer Link */
.disclaimer-link {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
    transition: color 0.2s ease;
}

.disclaimer-link:hover {
    color: #007bff;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.scroll-to-top:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}