/* ============================================
   KORT.CSS - GLOSEMESTER v0.5 "HOLO EDITION"
   Style: Physical Trading Cards with CSS Shine
   ============================================ */

/* --- SAMLING GRID --- */
.samling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 25px;
    padding-bottom: 40px;
}

/* --- MAIN CARD DESIGN --- */
.poke-card {
    background: white;
    border-radius: var(--radius-lg); /* Bruker variabel fra main.css */
    padding: 8px;
    text-align: center;
    position: relative;
    
    /* Physical Card Look */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08), 0 1px 0 rgba(0,0,0,0.05);
    border: 4px solid white; /* Tykk hvit ramme rundt selve kortet */
    
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    z-index: 1;
}

/* Hover / Touch Effect - Løfter kortet */
.poke-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    z-index: 10;
}

/* --- IMAGE & PLACEHOLDERS --- */

/* Wrapper for å holde bildet på plass */
.card-image-wrapper {
    background: #F3F4F6;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

/* Selve bildet */
.poke-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
}

.poke-card:hover img {
    transform: scale(1.15) rotate(5deg);
}

/* Placeholder (Før bildet er generert) */
.kort-bilde-placeholder {
    width: 100px;
    height: 100px;
    font-size: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 12px;
    background: white;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

/* Kategori-farger for placeholders */
.kort-bilde-placeholder[data-kategori="biler"] { color: #EF4444; background: #FEF2F2; }
.kort-bilde-placeholder[data-kategori="guder"] { color: #3B82F6; background: #EFF6FF; }
.kort-bilde-placeholder[data-kategori="dinosaurer"] { color: #10B981; background: #ECFDF5; }
.kort-bilde-placeholder[data-kategori="dyr"] { color: #F59E0B; background: #FFFBEB; }

/* --- TEXT INFO --- */
.poke-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    text-transform: capitalize;
    margin: 5px 0 2px 0;
}

.poke-id {
    font-size: 10px;
    font-weight: 700;
    color: #9CA3AF;
    background: #F3F4F6;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* --- RARITY SYSTEM (The Shiny Part) --- */

.rarity-badge {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    margin-top: auto;
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
}

/* 1. VANLIG (Common) */
.rarity-vanlig { border-bottom: 4px solid #9CA3AF; }
.rarity-vanlig .rarity-badge { color: #6B7280; background: #F3F4F6; }

/* 2. SJELDEN (Rare) - Sølv/Blå Glans */
.rarity-sjelden { border-bottom: 4px solid #3B82F6; }
.rarity-sjelden .rarity-badge { 
    color: #1E40AF; 
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%); 
}

/* 3. EPISK (Epic) - Lilla Glød */
.rarity-episk { border-bottom: 4px solid #8B5CF6; }
.rarity-episk .rarity-badge {
    color: #5B21B6;
    background: linear-gradient(135deg, #E9D5FF 0%, #D8B4FE 100%);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* 4. LEGENDARISK (Legendary) - Gullfolie */
.rarity-legendarisk, .rarity-legendary { 
    border: 4px solid #F59E0B; 
    background: linear-gradient(to bottom, #FFF 80%, #FFFBEB 100%);
}
.rarity-legendarisk .rarity-badge, .rarity-legendary .rarity-badge {
    color: #92400E;
    background: linear-gradient(90deg, #FCD34D, #F59E0B, #FCD34D);
    background-size: 200% auto;
    animation: shine 3s linear infinite;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

@keyframes shine { to { background-position: 200% center; } }

/* --- HOLOGRAPHIC OVERLAY EFFECT --- */
/* Dette lager "gjenskinn" over kortet når du beveger musen */
.poke-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        105deg, 
        transparent 20%, 
        rgba(255,255,255,0.4) 25%, 
        transparent 30%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
    z-index: 5;
    pointer-events: none;
}
.poke-card:hover::after {
    transform: translateX(100%);
    transition: transform 0.6s;
}

/* Legendaries får ekstra sparkles */
.rarity-legendarisk:hover {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

/* --- BADGES & UI --- */

/* Duplikat-teller (Rød sirkel i hjørnet) */
.antall-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger, #EF4444);
    color: white;
    border: 2px solid white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 20;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Trade Button (Ser ut som et klistremerke) */
.trade-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    color: #C2410C;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    z-index: 15;
}

/* --- KATEGORI FILTER (SCROLL) --- */
.kategori-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px; /* Litt padding for skygger */
    scrollbar-width: none; /* Skjul scrollbar FF */
}
.kategori-scroll::-webkit-scrollbar { display: none; } /* Skjul scrollbar Chrome */

.kategori-btn {
    background: white;
    border: none;
    padding: 10px 16px;
    border-radius: 50px; /* Pilleform */
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    min-width: max-content;
}

.kategori-btn:hover { transform: translateY(-2px); }

.kategori-btn.active {
    background: var(--text-main, #1F2937);
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.kategori-btn .emoji { font-size: 18px; }
.kategori-btn .tekst { font-weight: 700; font-size: 14px; }
.kategori-btn .count { 
    background: rgba(0,0,0,0.1); 
    padding: 2px 6px; 
    border-radius: 10px; 
    font-size: 11px; 
}
.kategori-btn.active .count { background: rgba(255,255,255,0.2); }

/* --- TOM SAMLING STATE --- */
.tom-samling {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.tom-samling-icon { font-size: 60px; margin-bottom: 20px; display: block; opacity: 0.5; }

/* --- RESPONSIV --- */
@media (max-width: 480px) {
    .samling-grid {
        grid-template-columns: repeat(2, 1fr); /* Alltid 2 på mobil */
        gap: 12px;
    }
    .poke-card { min-height: 180px; padding: 6px; }
    .poke-card img, .kort-bilde-placeholder { width: 70px; height: 70px; font-size: 32px; }
    .poke-name { font-size: 14px; }
}