/* ==================================== */
/* 1. GLOBÁLIS STÍLUSOK ÉS ANIMÁCIÓK */
/* ==================================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('assets/hatterkep.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: #fff;
    min-height: 100vh;
}

/* Animáció a kártyák BEÚSZÁSÁHOZ */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animáció a modális ablakhoz (érintetlen) */
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8) translateY(-50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==================================== */
/* 2. FŐOLDAL GOMB (FIXÁLT) */
/* ==================================== */

/* A Főoldal gombot tartalmazó div, ami a sarokban fixen áll */
.top-return-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

/* A tényleges vissza gomb stílusa */
.return-button {
    color: #ffd700;
    text-decoration: none;
    padding: 10px; 
    width: 40px; 
    height: 40px; 
    display: flex; 
    justify-content: center;
    align-items: center;
    /* Áttetsző háttér, ha felette van a képnek */
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.3); 
    border-radius: 50%; /* Kör alakú gomb */
    font-weight: bold;
    font-size: 1.2em; 
    transition: color 0.3s, background-color 0.3s, border-color 0.3s, transform 0.2s;
}

.return-button:hover {
    color: #fff;
    background-color: rgba(255, 69, 0, 0.5); 
    border-color: #ff4500;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.6);
}

/* A nyíl ikon megjelenítése */
.return-button::before {
    content: '←'; 
    font-weight: 900;
}


/* ==================================== */
/* 3. SZETT KÁRTYÁK - RÁCSOS ELRENDEZÉS ÉS ANIMÁCIÓ */
/* ==================================== */

.set-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    /* Fontos: A legfelső padding megmarad, hogy a kártyák ne takarják el a fixált vissza gombot */
    padding: 60px 40px 30px 40px; 
    margin: 0 auto;
    max-width: 1400px; 
}

.set-card {
    height: auto; 
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.98), rgba(10, 10, 10, 0.98));
    border: 1px solid #333;
    border-radius: 15px;
    padding: 20px 15px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.set-card.animate {
    opacity: 1;
}

.set-card:hover {
    transform: scale(1.03); 
    box-shadow: 0 10px 30px rgba(255, 69, 0, 0.7);
    border-color: #ff4500;
}

.set-card.purchased {
    border: 3px solid #32cd32;
    box-shadow: 0 0 25px rgba(50, 205, 50, 0.8);
}

.set-card h2 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25em;
    text-align: center;
    min-height: 2.5em; 
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.set-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 3px solid #000;
    transition: transform 0.3s;
}

.set-card:hover img {
    transform: scale(1.02); 
}

.card-status-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-weight: bold;
    padding: 10px 8px;
    font-size: 1em;
    transition: background-color 0.3s, color 0.3s;
    z-index: 5;
}

.status-not-purchased-small {
    background-color: #444;
    color: #ff4500;
}
.status-purchased-small {
    background-color: #32cd32;
    color: #111;
    font-weight: 800;
}


/* ==================================== */
/* 4. MODÁLIS ABLAK (POPUP) STÍLUSOK (RESZPONZÍV) */
/* ==================================== */
.modal {
    display: none;
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 30px;
    border: 3px solid #ff4500;
    border-radius: 15px;
    width: 90%; 
    max-width: 800px; 
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.4);
    position: relative;
    animation: zoomIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
}

.modal-body {
    display: flex;
    gap: 20px;
}

.modal-image-container {
    flex: 1;
    min-width: 250px;
}

#modal-set-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #444;
}

.modal-data-form {
    flex: 1;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: #ff4500;
    text-decoration: none;
    cursor: pointer;
}

.purchase-status {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 1.2em;
}

.status-not-purchased {
    color: #ff4500;
    background-color: rgba(255, 69, 0, 0.15);
}

.status-purchased {
    color: #32cd32;
    background-color: rgba(50, 205, 50, 0.15);
}

.modal-data-form label, 
.modal-data-form input, 
.modal-data-form select, 
.modal-data-form textarea, 
.modal-data-form button {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.modal-data-form input, 
.modal-data-form select, 
.modal-data-form textarea {
    padding: 12px;
    border: 1px solid #666;
    border-radius: 6px;
    background-color: #333;
    color: #fff;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-data-form input:focus, 
.modal-data-form select:focus, 
.modal-data-form textarea:focus {
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    outline: none;
}

.purchase-toggle-btn, .save-btn {
    cursor: pointer;
    background-color: #ff4500;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.save-btn {
    background-color: #007bff;
}

.purchase-toggle-btn:hover {
    background-color: #cc3700;
    transform: translateY(-2px);
}

.save-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* ==================================== */
/* 5. RESZPONZÍV DESIGN */
/* ==================================== */

@media (max-width: 1200px) {
    .set-list-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 20px;
        padding-top: 60px; 
    }
}

@media (max-width: 850px) {
    /* TABLET/NAGYOBB MOBIL */
    
    /* MODÁLIS ABLAK: Két tartalom egymás alá kerül (oszlopba) */
    .modal-body {
        flex-direction: column; 
    }
    .modal-image-container {
        min-width: unset;
    }
    .modal-content {
        margin: 10% auto;
        max-width: 95%;
    }
    
    .set-list-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .top-return-link {
        top: 10px;
        left: 10px;
    }

    .set-list-container {
        padding-top: 50px; 
    }
}

@media (max-width: 600px) {
    /* MOBILTELEFON (600px alatt) - AGRESSZÍV MODAL ÉS 2 OSZLOP */
    
    /* Két oszlopos kártya elrendezés */
    .set-list-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
        padding: 10px;
        padding-top: 50px; 
        gap: 15px;
    }

    .set-card {
        max-width: 100%;
    }

    /* FELUGRÓ ABLAK: TELJES KÉPERNYŐS MOBILON */
    .modal-content {
        width: 100%; 
        max-width: 100%;
        margin: 0; /* Eltávolítja a margókat */
        padding: 15px; /* Csökkenti a belső paddingot */
        height: 100%; /* Kitölti a teljes képernyő magasságot */
        border-radius: 0; /* Nincs lekerekítés full screen módban */
        overflow-y: auto; /* Görgetés engedélyezése, ha szükséges */
    }
    
    .modal-content h2 {
        font-size: 1.2em;
    }
    
    .close-btn {
        top: 5px;
        right: 15px;
        font-size: 30px;
    }
    
    .return-button {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
}