/* RegioCartas - Magic: The Gathering Storefront Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-link {
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
}

.btn:hover {
    background: #5568d3;
}

.btn-primary {
    background: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.card-image a {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    text-decoration: none;
}

.card-image a:focus,
.card-image a:active,
.card-image a:hover {
    border: none;
    outline: none;
}

.card-image a img {
    border: none;
    outline: none;
}

.card-info {
    padding: 1rem;
}

.card-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.card-set {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card-details {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.card-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #28a745;
    margin: 1rem 0;
}

/* Sets Grid */
.sets-grid {
    margin: 2rem 0;
}

.format-header {
    color: #667eea;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.sets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.set-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.set-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.set-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.set-code {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.card-count {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Search */
.search-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.search-input {
    width: 70%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-right: 1rem;
}

/* Card Detail */
.card-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.card-detail-image img {
    width: 100%;
    border-radius: 8px;
}

.card-detail-info h1 {
    color: #333;
    margin-bottom: 1rem;
}

.card-detail-info h2 {
    color: #667eea;
    margin: 1.5rem 0 1rem 0;
}

.availability-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.availability-table th,
.availability-table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.availability-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.availability-table tr:hover {
    background: #f8f9fa;
}

/* Cart Table */
.cart-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.cart-table tfoot td {
    font-size: 1.2rem;
    background: #f8f9fa;
}

/* Badges */
.condition {
    color: #856404;
    font-size: 0.85rem;
    font-style: italic;
}

.foil {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}

.language {
    color: #666;
    font-size: 0.85rem;
}

.quantity {
    color: #666;
    margin-right: 1rem;
}

.format-tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.section-header {
    color: #667eea;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Featured Section */
.featured-sets {
    margin: 3rem 0;
}

.featured-sets h2 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .card-detail {
        grid-template-columns: 1fr;
    }

    .search-input {
        width: 100%;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .cart-table {
        font-size: 0.9rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.5rem;
    }
}

/* Alternative Cards Section */
.section-description {
    color: #666;
    font-size: 0.95rem;
    margin: -1rem 0 1.5rem 0;
}

.alternative-card {
    border: 2px solid transparent;
    background: linear-gradient(to bottom, #f8f9ff 0%, white 100%);
}

.alternative-card:hover {
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.alternative-card a {
    display: block;
    text-decoration: none;
    border: none;
    outline: none;
}

.alternative-card a:focus {
    outline: none;
}

.alternative-card a img {
    display: block;
    border: none;
}

.alt-set-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
}

.set-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
}

.format-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #764ba2;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
}

/* Card Image Zoom Modal */
.card-zoom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.card-zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-zoom-content {
    display: flex;
    gap: 20px;
    max-width: 90%;
    max-height: 90%;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.card-zoom-image {
    max-width: 480px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.card-zoom-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.card-zoom-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.card-zoom-loading {
    color: white;
    font-size: 24px;
}

/* Card Image Zoom Modal */
.card-zoom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.card-zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-zoom-content {
    display: flex;
    gap: 20px;
    max-width: 90%;
    max-height: 90%;
    align-items: center;
    justify-content: center;
}

.card-zoom-image {
    max-width: 480px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.card-zoom-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.card-zoom-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.card-zoom-loading {
    color: white;
    font-size: 24px;
}
