/* Reset et variables */
:root {
    --primary-red: #E31E24;
    --primary-dark: #b9161b;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-light: #ffffff;
    --text-gray: #b8b8b8;
    --success: #4CAF50;
    --error: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background animé */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(227, 30, 36, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    z-index: -1;
}

.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/stadium-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    filter: blur(2px);
}

/* Auth pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: rgba(22, 33, 62, 0.95);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-red);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-33 {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-logo h1 {
    color: var(--primary-red);
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.auth-logo p {
    color: var(--gold);
    font-size: 1em;
}

/* Formulaires */
.auth-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-gray);
    font-size: 0.9em;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-red);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #2a2a4a;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 10px rgba(227, 30, 36, 0.5);
}

/* Boutons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(227, 30, 36, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(227, 30, 36, 0.6);
}

.btn-block {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #FFA500 100%);
    color: #000;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.alert-error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--error);
    color: #ffcdd2;
}

.alert-success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--success);
    color: #c8e6c9;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-gray);
}

.auth-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Mobile */
.mobile-app {
    max-width: 480px;
    margin: 0 auto;
    background: var(--dark-bg);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-dark) 100%);
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
}

.ndoss-id-badge {
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-family: monospace;
    color: var(--gold);
}

.stats-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--gold);
}

.stat-label {
    font-size: 0.75em;
    color: var(--text-gray);
}

.xp-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), #FFA500);
    transition: width 0.5s ease;
}

/* Navigation bottom */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(22, 33, 62, 0.98);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 2px solid var(--primary-red);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-gray);
    padding: 5px 15px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary-red);
}

.nav-item i {
    font-size: 1.5em;
    margin-bottom: 3px;
}

.nav-item span {
    font-size: 0.75em;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.card-slot {
    aspect-ratio: 2/3;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid #2a2a4a;
    transition: all 0.3s;
}

.card-slot.unlocked {
    border-color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(227, 30, 36, 0.3);
}

.card-slot.unlocked:hover {
    transform: translateY(-5px);
}

.card-slot.locked {
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-slot.locked i {
    font-size: 2em;
    color: var(--text-gray);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 8px;
    text-align: center;
}

.card-name {
    font-size: 0.7em;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-surnom {
    font-size: 0.65em;
    color: var(--text-gray);
}

/* Rareté */
.rare-standard { border-color: var(--primary-red) !important; }
.rare-rare { 
    border-color: var(--silver) !important; 
    box-shadow: 0 0 15px var(--silver);
}
.rare-tres_rare { 
    border-color: var(--gold) !important; 
    box-shadow: 0 0 20px var(--gold);
    animation: goldenGlow 2s infinite;
}

@keyframes goldenGlow {
    0%, 100% { box-shadow: 0 0 20px var(--gold); }
    50% { box-shadow: 0 0 30px var(--gold), 0 0 40px var(--gold); }
}

/* Pack Surprise Animation */
.pack-reveal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pack-opening {
    text-align: center;
}

.pack-opening h2 {
    color: var(--gold);
    font-size: 2em;
    margin-bottom: 30px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pack-image {
    width: 250px;
    height: 350px;
    background: linear-gradient(135deg, var(--primary-red), var(--gold));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    cursor: pointer;
    animation: packShake 0.5s infinite;
    box-shadow: 0 10px 40px rgba(227, 30, 36, 0.5);
}

@keyframes packShake {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.card-reveal {
    display: none;
    animation: cardFlip 1s;
}

@keyframes cardFlip {
    0% { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0); opacity: 1; }
}

.revealed-card {
    width: 280px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.revealed-card img {
    width: 100%;
    display: block;
}

.card-stats {
    background: rgba(0,0,0,0.9);
    padding: 15px;
    color: white;
}

.card-stats h3 {
    color: var(--gold);
    margin-bottom: 5px;
}

.card-stats .surnom {
    color: var(--text-gray);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    font-size: 0.8em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

/* Matchs */
.match-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 15px;
    margin: 15px;
    border: 2px solid #2a2a4a;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a4a;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    font-weight: bold;
    font-size: 0.9em;
}

.vs {
    color: var(--primary-red);
    font-weight: bold;
    padding: 0 15px;
}

.pronostic-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.score-input {
    width: 60px;
    padding: 10px;
    text-align: center;
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 1.2em;
    font-weight: bold;
}

.score-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(227, 30, 36, 0.5);
}

/* Progress bar */
.progress-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin: 15px;
}

.progress-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-bar {
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--gold));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 480px) {
    .mobile-app {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

/* Loader */
.loader {
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--gold);
    position: absolute;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}