/* Base */
body {
    background-color: #1a1a1a;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    color: #ffffff;
}

.card-number {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 12px;
    color: white;
}

.card-number::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 8px);
    height: calc(100% + 4px);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    z-index: -1;
}

/* Auth container et éléments de connexion */
.auth-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #2c1654 0%, #1a1a1a 100%);
}

/* Conteneur pour les cartes décoratives */
.cards-decoration {
    position: absolute;
    width: 100%;
    max-width: 800px;
    height: 300px;
    bottom: -50px;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 20;
}

/* Cartes décoratives améliorées */
.decoration-card {
    width: 150px;
    height: 210px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    transform-origin: bottom center;
    position: relative;
}

/* Position et animation spécifique pour chaque carte */
.decoration-card:nth-child(1) {
    transform: rotate(-15deg);
    animation: floatLeft 6s ease-in-out infinite;
}

.decoration-card:nth-child(2) {
    transform: rotate(5deg);
    animation: floatMiddle 6s ease-in-out infinite 0.3s;
}

.decoration-card:nth-child(3) {
    transform: rotate(15deg);
    animation: floatRight 6s ease-in-out infinite 0.6s;
}

/* Animations pour les cartes flottantes */
@keyframes floatLeft {
    0%, 100% {
        transform: translateY(0) rotate(-15deg);
    }
    50% {
        transform: translateY(-20px) rotate(-10deg);
    }
}

@keyframes floatMiddle {
    0%, 100% {
        transform: translateY(0) rotate(5deg);
    }
    50% {
        transform: translateY(-30px) rotate(0deg);
    }
}

@keyframes floatRight {
    0%, 100% {
        transform: translateY(0) rotate(15deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.auth-card {
    position: relative;
    background: rgba(20, 20, 20, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(145, 70, 255, 0.3);
    border: 1px solid rgba(145, 70, 255, 0.2);
    animation: cardAppear 0.6s ease-out;
    z-index: 10;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h2 {
    color: #fff;
    font-size: 2.2em;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(145, 70, 255, 0.5);
    font-family: 'Cinzel', serif;
}

/* Container principal */
.inventory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header et user info */
.inventory-header {
    margin-bottom: 30px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(145, 70, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.twitch-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.twitch-user-info h1 {
    margin: 0;
    font-size: 24px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(145, 70, 255, 0.5);
}

.twitch-logo {
    width: 32px;
    height: 32px;
}

/* Bouton Twitch amélioré */
.twitch-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #9146ff, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(145, 70, 255, 0.3);
}

.twitch-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.twitch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(145, 70, 255, 0.4);
    background: linear-gradient(45deg, #7c3aed, #9146ff);
}

.twitch-button:hover:before {
    left: 100%;
}

.twitch-icon {
    width: 24px;
    height: 24px;
}

.logout-button {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* Filtres */
.filter-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group h3 {
    color: #9146ff;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab {
    padding: 8px 16px;
    background: rgba(145, 70, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab:hover {
    background: rgba(145, 70, 255, 0.2);
}

.tab.active {
    background: #9146ff;
}

/* Grille de cartes */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 20px;
}

/* Style de base des cartes */
.card {
    position: relative;
    width: 100%;
    padding-bottom: 145%;
    transform-style: preserve-3d;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Infos de carte */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    border-radius: 0 0 15px 15px;
    z-index: 3;
    backdrop-filter: blur(5px);
}

.card-name {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.card-rarity {
    margin-bottom: 5px;
}

.star {
    color: #ffd700;
    font-size: 12px;
}

.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
}

/* Badges */
.badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: white;
}

.badge.class-berserk { background: rgba(255, 0, 0, 0.3); }
.badge.class-mystique { background: rgba(0, 0, 255, 0.3); }
.badge.class-naturel { background: rgba(0, 255, 0, 0.3); }
.badge.class-sacre { background: rgba(255, 255, 255, 0.3); }
.badge.class-corrompu { background: rgba(128, 128, 128, 0.3); }

.badge.type {
    background: rgba(255, 255, 255, 0.2);
}

.badge.effect-normal { background: rgba(255, 255, 255, 0.2); }
.badge.effect-holographic { 
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.3), rgba(255, 0, 255, 0.3));
    animation: holo 3s linear infinite; 
}
.badge.effect-golden { 
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.3), rgba(255, 248, 220, 0.3));
}
.badge.effect-cosmos { 
    background: linear-gradient(45deg, rgba(148, 0, 211, 0.3), rgba(75, 0, 130, 0.3));
}

@keyframes holo {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-stats {
    font-size: 12px;
    color: #ddd;
    margin-bottom: 4px;
}

.card-description {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}

.card-date {
    font-size: 10px;
    color: #666;
}

/* Message pas de cartes */
.no-cards-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    color: #aaa;
}

/* Version mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .inventory-container {
        padding: 10px;
    }

    .cards-decoration {
        max-width: 400px;
        height: 200px;
        gap: 10px;
        bottom: -30px;
    }

    .decoration-card {
        width: 100px;
        height: 140px;
    }

    .auth-card {
        padding: 30px 20px;
    }
    
    .auth-card h2 {
        font-size: 1.8em;
    }
    
    .twitch-button {
        padding: 12px 24px;
        font-size: 1em;
    }

    .filter-buttons {
        justify-content: center;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .card-name {
        font-size: 12px;
    }

    .badge {
        font-size: 10px;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .twitch-user-info {
        flex-direction: column;
    }
}

.card-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
}

/* Ajustement pour les écrans mobiles */
@media (max-width: 768px) {
    .card-count {
        font-size: 12px;
        padding: 2px 6px;
    }
}