/* ==========================================
   CREATURE CARDS STYLES - GAME STYLE
   ========================================== */

/* Base Card */
.creature-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 6px 15px rgba(0, 0, 0, 0.3);
}

.creature-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.2), 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Card Rarity Borders */
.creature-card.rarity-comum {
    border-color: #9e9e9e;
    background: linear-gradient(180deg, rgba(158, 158, 158, 0.3) 0%, rgba(97, 97, 97, 0.3) 100%);
}

.creature-card.rarity-raro {
    border-color: #2196f3;
    background: linear-gradient(180deg, rgba(33, 150, 243, 0.3) 0%, rgba(13, 71, 161, 0.3) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 20px rgba(33, 150, 243, 0.4);
}

.creature-card.rarity-epico {
    border-color: #9c27b0;
    background: linear-gradient(180deg, rgba(156, 39, 176, 0.3) 0%, rgba(74, 20, 140, 0.3) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 25px rgba(156, 39, 176, 0.5);
}

.creature-card.rarity-lendario {
    border-color: #ff9800;
    background: linear-gradient(180deg, rgba(255, 152, 0, 0.3) 0%, rgba(230, 81, 0, 0.3) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 30px rgba(255, 152, 0, 0.6);
    animation: legendaryGlow 2s ease-in-out infinite;
}

.creature-card.rarity-mitico {
    border-color: #e91e63;
    background: linear-gradient(180deg, rgba(233, 30, 99, 0.4) 0%, rgba(136, 14, 79, 0.4) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 35px rgba(233, 30, 99, 0.7);
    animation: mythicGlow 1.8s ease-in-out infinite;
}

.creature-card.rarity-transcendente {
    border-color: #00bcd4;
    background: linear-gradient(180deg, rgba(0, 188, 212, 0.4) 0%, rgba(0, 96, 100, 0.4) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 40px rgba(0, 188, 212, 0.8);
    animation: transcendentGlow 1.5s ease-in-out infinite;
}

.creature-card.rarity-ultra-criatura {
    border-color: #ffd700;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.5) 0%, rgba(255, 140, 0, 0.5) 25%, rgba(255, 215, 0, 0.5) 50%, rgba(255, 140, 0, 0.5) 75%, rgba(255, 215, 0, 0.5) 100%);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 215, 0, 0.5);
    animation: ultraGlow 1s ease-in-out infinite, ultraShine 3s linear infinite;
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 30px rgba(255, 152, 0, 0.6);
    }
    50% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 50px rgba(255, 152, 0, 0.9);
    }
}

@keyframes mythicGlow {
    0%, 100% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 35px rgba(233, 30, 99, 0.7);
    }
    50% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 60px rgba(233, 30, 99, 1);
    }
}

@keyframes transcendentGlow {
    0%, 100% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 40px rgba(0, 188, 212, 0.8);
        filter: hue-rotate(0deg);
    }
    50% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 70px rgba(0, 188, 212, 1);
        filter: hue-rotate(30deg);
    }
}

@keyframes ultraGlow {
    0%, 100% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 0 80px rgba(255, 215, 0, 1), 0 0 150px rgba(255, 215, 0, 0.8);
    }
}

@keyframes ultraShine {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Card Image */
.card-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.card-image .placeholder-icon {
    font-size: 3.5rem;
    opacity: 0.7;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Card Type Badge */
.card-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-type-badge.type-terra {
    background: var(--type-terra);
    color: white;
}

.card-type-badge.type-agua {
    background: var(--type-agua);
    color: white;
}

.card-type-badge.type-floresta {
    background: var(--type-floresta);
    color: white;
}

.card-type-badge.type-voador {
    background: var(--type-voador);
    color: #333;
}

.card-type-badge.type-mistico {
    background: var(--type-mistico);
    color: white;
}

.card-type-badge.type-fogo {
    background: var(--type-fogo);
    color: white;
}

.card-type-badge.type-gelo {
    background: var(--type-gelo);
    color: white;
}

/* Card Rarity Badge */
.card-rarity-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.card-rarity-badge.rarity-comum {
    background: var(--rarity-comum);
}

.card-rarity-badge.rarity-raro {
    background: var(--rarity-raro);
}

.card-rarity-badge.rarity-epico {
    background: var(--rarity-epico);
}

.card-rarity-badge.rarity-lendario {
    background: var(--rarity-lendario);
    animation: starPulse 1s ease-in-out infinite;
}

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

/* Card Info */
.card-info {
    padding: 12px;
}

.card-name {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-stat .stat-icon {
    font-size: 0.9rem;
}

.card-stat.attack .stat-icon {
    color: #e74c3c;
}

.card-stat.defense .stat-icon {
    color: #3498db;
}

.card-stat.magic .stat-icon {
    color: #9b59b6;
}

/* Mini Card (for team slots and grids) */
.creature-card.mini {
    width: 100%;
}

.creature-card.mini .card-image {
    aspect-ratio: 1;
}

.creature-card.mini .card-info {
    padding: 10px;
}

.creature-card.mini .card-name {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.creature-card.mini .card-stats {
    flex-direction: row;
    gap: 8px;
}

.creature-card.mini .card-stat {
    font-size: 0.75rem;
}

/* Card in creatures grid - larger size */
.creatures-grid .creature-card {
    min-width: 140px;
}

.creatures-grid .creature-card .card-image {
    min-height: 100px;
}

.creatures-grid .creature-card .card-name {
    font-size: 0.85rem;
}

.creatures-grid .creature-card .card-rarity-text {
    font-size: 0.75rem;
}

/* Full Card (for details modal) */
.creature-card-full {
    display: flex;
    gap: 30px;
    padding: 20px;
}

.creature-card-full .card-image-large {
    width: 250px;
    height: 250px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.creature-card-full .card-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creature-card-full .card-image-large .placeholder-icon {
    font-size: 6rem;
    opacity: 0.5;
}

.creature-card-full .card-details {
    flex: 1;
}

.creature-card-full .card-name-large {
    font-family: 'Nunito', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.creature-card-full .card-type-rarity {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.creature-card-full .card-type-rarity span {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.creature-card-full .stats-full {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.creature-card-full .stat-full {
    background: var(--bg-input);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.creature-card-full .stat-full .stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.creature-card-full .stat-full .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
}

.creature-card-full .stat-full .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.creature-card-full .card-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
    padding: 15px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
}

/* Card in Team Slot */
.team-slot .slot-content.filled {
    border-style: solid;
    padding: 5px;
}

.team-slot .slot-content.filled .mini-creature {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.team-slot .slot-content.filled .creature-sprite {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.team-slot .slot-content.filled .creature-name {
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Collection Card Wrapper */
.collection-card-wrapper {
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}

.collection-card-wrapper:hover {
    transform: scale(1.02);
}

.collection-card-wrapper:active {
    transform: scale(0.98);
}

.collection-card-wrapper .creature-card {
    pointer-events: none;
}

/* Collection Card (with locked state) */
.collection-card {
    position: relative;
}

.collection-card.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}

.collection-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

.collection-card .owned-count {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(180deg, #4fc3f7 0%, #0288d1 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Collection Grid Fix */
#collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

#collection-grid .creature-card {
    width: 100%;
    height: auto;
}

.empty-collection {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

/* Card Selection State */
.creature-card.selected {
    border-color: var(--success) !important;
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.5) !important;
}

.creature-card.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 101;
}

/* Card Hover Shine Effect */
.creature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 100;
    pointer-events: none;
}

.creature-card:hover::after {
    left: 150%;
}

/* Battle Card Styles */
.battle-card {
    width: 100px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.battle-card.attacking {
    animation: attackPulse 0.5s ease;
}

.battle-card.damaged {
    animation: damagePulse 0.5s ease;
}

.battle-card.defeated {
    opacity: 0.3;
    filter: grayscale(100%);
}

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

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

.battle-card .card-hp-bar {
    height: 4px;
    background: var(--bg-input);
}

.battle-card .card-hp-bar .hp-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.battle-card .card-hp-bar .hp-fill.low {
    background: var(--danger);
}

/* Expedition Result Card */
.expedition-reward-card {
    text-align: center;
    padding: 30px;
}

.expedition-reward-card .new-creature {
    margin: 20px auto;
    width: 200px;
}

.expedition-reward-card .new-creature .creature-card {
    animation: cardReveal 0.8s ease;
}

@keyframes cardReveal {
    0% {
        transform: scale(0) rotateY(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotateY(90deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1) rotateY(0);
        opacity: 1;
    }
}

.expedition-reward-card .reward-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 15px;
}

.expedition-reward-card .reward-text.rare {
    color: var(--rarity-raro);
}

.expedition-reward-card .reward-text.epic {
    color: var(--rarity-epico);
}

.expedition-reward-card .reward-text.legendary {
    color: var(--rarity-lendario);
    animation: legendaryText 1s ease infinite;
}

@keyframes legendaryText {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 152, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 152, 0, 0.8); }
}

/* Team Preview Card */
.team-preview-card {
    width: 80px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.team-preview-card .creature-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border-radius: 8px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

.team-preview-card .creature-icon .creature-sprite-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-preview-card .creature-icon .creature-sprite-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.team-preview-card .creature-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
