/**
 * Card Explorer Styles
 * Axie Infinity themed - Clean floating cards
 * FINAL VERSION - Natural card proportions + energy circle compensation
 */

/* ====================================
   CSS Variables - Axie Theme
   ==================================== */
:root {
    --axie-bg-dark: #2a1810;
    --axie-bg-medium: #3d2518;
    --axie-bg-light: #5a3a28;
    --axie-accent-gold: #f4d03f;
    --axie-accent-orange: #e67e22;
    --axie-text-light: #f5e6d3;
    --axie-text-muted: #c4a882;
    --axie-border: rgba(244, 208, 63, 0.3);
    --axie-shadow: rgba(0, 0, 0, 0.4);
}

/* ====================================
   Hero Section
   ==================================== */
.card-explorer-page {
    min-height: 100vh;
    background-color: var(--axie-bg-dark);
}

.card-explorer-hero {
    position: relative;
    height: 280px;
    background-image: url('../images/card-explorer/Axie Background4.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(42, 24, 16, 0.4) 0%,
        rgba(42, 24, 16, 0.7) 70%,
        rgba(42, 24, 16, 1) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.explorer-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    color: var(--axie-accent-gold);
    text-shadow: 
        3px 3px 0 var(--axie-bg-dark),
        -1px -1px 0 var(--axie-accent-orange);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.explorer-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--axie-text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ====================================
   Filters Section
   ==================================== */
.filters-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, var(--axie-bg-medium) 0%, var(--axie-bg-dark) 100%);
    border-bottom: 3px solid var(--axie-accent-gold);
    padding: 20px 0;
    box-shadow: 0 4px 20px var(--axie-shadow);
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--axie-accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-select,
.filter-input {
    background: var(--axie-bg-light);
    border: 2px solid var(--axie-border);
    border-radius: 8px;
    padding: 10px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--axie-text-light);
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--axie-accent-gold);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--axie-accent-gold);
    box-shadow: 0 0 10px rgba(244, 208, 63, 0.3);
}

.filter-select option {
    background: var(--axie-bg-medium);
    color: var(--axie-text-light);
}

/* Tier Toggle Buttons */
.tier-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--axie-border);
}

.tier-btn {
    background: var(--axie-bg-light);
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--axie-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tier-btn:first-child {
    border-right: 1px solid var(--axie-border);
}

.tier-btn:hover {
    background: var(--axie-bg-medium);
    color: var(--axie-text-light);
}

.tier-btn.active {
    background: var(--axie-accent-gold);
    color: var(--axie-bg-dark);
}

/* Search Input */
.filter-search {
    flex-grow: 1;
    min-width: 200px;
}

.search-wrapper {
    position: relative;
}

.search-wrapper .filter-input {
    width: 100%;
    padding-right: 40px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--axie-text-muted);
    pointer-events: none;
}

/* Clear Filters Button */
.clear-filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid var(--axie-accent-orange);
    border-radius: 8px;
    padding: 10px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--axie-accent-orange);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn svg {
    width: 16px;
    height: 16px;
}

.clear-filters-btn:hover {
    background: var(--axie-accent-orange);
    color: var(--axie-bg-dark);
}

/* ====================================
   Decorative Separator
   ==================================== */
.axie-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 25px 20px;
    background: var(--axie-bg-dark);
}

.separator-line {
    flex: 1;
    max-width: 200px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--axie-accent-gold) 50%,
        transparent 100%
    );
}

.separator-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px var(--axie-accent-gold));
}

/* ====================================
   Cards Counter
   ==================================== */
.cards-counter {
    text-align: center;
    padding: 0 20px 20px;
    background: var(--axie-bg-dark);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--axie-text-muted);
}

.cards-counter #cards-count {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--axie-accent-gold);
}

/* ====================================
   Cards Section & Grid 
   ==================================== */
.cards-section {
    background: var(--axie-bg-dark);
    padding: 0 20px 60px;
    min-height: 500px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ====================================
   Card Component
   Energy circle compensation: ~8% shift to align with card rectangle
   ==================================== */
.axie-card {
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.axie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.axie-card:hover .card-image {
    filter: brightness(1.1);
}

/* Card Type Header - shifted right to compensate for energy circle */
.card-type-header {
    margin-bottom: 4px;
    padding-left: 8%;
}

.card-attack-type {
    display: inline;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-attack-type.melee {
    color: #ff6b6b;
}

.card-attack-type.ranged {
    color: #4ecdc4;
}

.card-attack-type.skill {
    color: #a78bfa;
}

.card-part-icon {
    margin-left: 6px;
    font-size: 1.1rem;
}

/* Card Name - shifted right to compensate for energy circle */
.card-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--axie-text-light);
    margin-bottom: 6px;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding-left: 8%;
}

/* Card Image Container */
.card-image-container {
    position: relative;
}

/* Image - NATURAL PROPORTIONS
   width: 100% lets image scale to container
   height: auto preserves aspect ratio
*/
.card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: filter 0.3s ease;
}

/* Description Overlay 
   - Positioned relative to card rectangle (compensating for energy circle)
   - Moved up closer to Attack button
   - More space for longer text
*/
.card-description-overlay {
    position: absolute;
    bottom: 10%;
    left: 16%;
    right: 8%;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 
        1px 1px 1px rgba(0, 0, 0, 0.95),
        0 0 4px rgba(0, 0, 0, 0.8);
    max-height: 5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Tier Badge */
.tier-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    background: linear-gradient(145deg, var(--axie-accent-gold), var(--axie-accent-orange));
    color: var(--axie-bg-dark);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    font-weight: bold;
    z-index: 5;
}

/* ====================================
   Loading State
   ==================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--axie-text-muted);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--axie-bg-light);
    border-top-color: var(--axie-accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-state p {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

/* ====================================
   Empty State
   ==================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--axie-text-light);
    margin-bottom: 10px;
}

.empty-state p {
    font-family: 'Inter', sans-serif;
    color: var(--axie-text-muted);
}

/* ====================================
   Error State
   ==================================== */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-state h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: #ef4444;
    margin-bottom: 10px;
}

.error-state p {
    font-family: 'Inter', sans-serif;
    color: var(--axie-text-muted);
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--axie-accent-gold);
    color: var(--axie-bg-dark);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--axie-accent-orange);
    transform: translateY(-2px);
}

/* ====================================
   Responsive Design
   ==================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
    
    .card-description-overlay {
        font-size: 0.7rem;
        bottom: 11%;
    }
    
    .card-name {
        font-size: 0.65rem;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
    
    .card-description-overlay {
        font-size: 0.65rem;
    }
}

/* Tablet Landscape (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 22px;
    }
    
    .explorer-title {
        font-size: 2rem;
    }
    
    .card-description-overlay {
        font-size: 0.62rem;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .explorer-title {
        font-size: 1.8rem;
    }
    
    .filters-container {
        gap: 12px;
    }
    
    .filter-select,
    .filter-input {
        min-width: 130px;
        padding: 8px 12px;
    }
    
    .card-name {
        font-size: 0.58rem;
    }
    
    .card-attack-type {
        font-size: 0.7rem;
    }
    
    .card-description-overlay {
        font-size: 0.6rem;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .card-explorer-hero {
        height: 220px;
    }
    
    .explorer-title {
        font-size: 1.5rem;
    }
    
    .explorer-description {
        font-size: 0.95rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
        min-width: auto;
    }
    
    .tier-toggle {
        width: 100%;
    }
    
    .tier-btn {
        flex: 1;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-name {
        font-size: 0.55rem;
    }
    
    .card-description-overlay {
        font-size: 0.56rem;
    }
}

/* Mobile Portrait (< 576px) */
@media (max-width: 575px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .card-explorer-hero {
        height: 200px;
        background-attachment: scroll;
    }
    
    .explorer-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .explorer-description {
        font-size: 0.85rem;
    }
    
    .filters-section {
        padding: 15px 0;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group label {
        font-size: 0.55rem;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
        min-width: auto;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .tier-toggle {
        width: 100%;
    }
    
    .tier-btn {
        flex: 1;
        padding: 10px 15px;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .card-name {
        font-size: 0.52rem;
    }
    
    .card-attack-type {
        font-size: 0.6rem;
    }
    
    .card-part-icon {
        font-size: 0.9rem;
    }
    
    .card-description-overlay {
        font-size: 0.5rem;
        left: 14%;
        right: 6%;
        bottom: 9%;
    }
    
    .card-type-header,
    .card-name {
        padding-left: 6%;
    }
    
    .axie-separator {
        padding: 20px 15px;
        gap: 15px;
    }
    
    .separator-line {
        max-width: 100px;
    }
    
    .separator-icon {
        font-size: 1.2rem;
    }
    
    .cards-counter {
        font-size: 0.8rem;
        padding-bottom: 15px;
    }
    
    .cards-counter #cards-count {
        font-size: 0.9rem;
    }
    
    .cards-section {
        padding: 0 15px 40px;
    }
}

/* Very Small Screens (< 360px) */
@media (max-width: 359px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .explorer-title {
        font-size: 1rem;
    }
    
    .card-description-overlay {
        font-size: 0.46rem;
    }
    
    .card-name {
        font-size: 0.48rem;
    }
}

/* ====================================
   CLASSIC CARDS - Simple overlay design
   Image already contains energy, attack, defense
   We add name and description as overlays
   ==================================== */

/* Classic Card Container */
.classic-card {
    position: relative;
    padding: 0;
}

/* Part Header (above card) */
.classic-part-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 5px;
}

.classic-class-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Class background colors for icon - adjusted for contrast */
.classic-class-icon.beast { background: linear-gradient(135deg, #ffb347, #e8a030); }
.classic-class-icon.aquatic { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.classic-class-icon.plant { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.classic-class-icon.bird { background: linear-gradient(135deg, #c2185b, #880e4f); }
.classic-class-icon.bug { background: linear-gradient(135deg, #e64a19, #bf360c); }
.classic-class-icon.reptile { background: linear-gradient(135deg, #7b1fa2, #4a148c); }
.classic-class-icon.mech { background: linear-gradient(135deg, #546e7a, #37474f); }
.classic-class-icon.dawn { background: linear-gradient(135deg, #f9a825, #f57f17); }
.classic-class-icon.dusk { background: linear-gradient(135deg, #5c6bc0, #3949ab); }

.classic-part-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--axie-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Container with overlays */
.classic-image-container {
    position: relative;
}

.classic-card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.classic-card .card-image-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* Energy badge - top center */
.classic-energy-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.classic-energy-icon {
    width: 36px;
    height: 36px;
}

.classic-energy-value {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Name overlay - positioned on the light colored banner */
.classic-name-overlay {
    position: absolute;
    bottom: 31%;
    left: 8%;
    right: 8%;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #000000;
    line-height: 1.2;
}

/* Description overlay - positioned on the dark area at bottom */
.classic-desc-overlay {
    position: absolute;
    bottom: 8%;
    left: 6%;
    right: 6%;
    height: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    overflow: hidden;
}

/* Image container */
.classic-image-container {
    position: relative;
}

/* Stats container - left side */
.classic-stats-container {
    position: absolute;
    left: 2%;
    top: 28%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.classic-stat-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.classic-stat-attack {
    background: linear-gradient(135deg, #e53935, #c62828);
}

.classic-stat-defense {
    background: linear-gradient(135deg, #43a047, #2e7d32);
}

/* Classic Card Hover */
.classic-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.classic-card:hover .classic-card-image {
    filter: brightness(1.05);
}

/* ====================================
   Classic Cards Responsive
   ==================================== */
@media (max-width: 991px) {
    .classic-name-overlay {
        font-size: 0.9rem;
        bottom: 25%;
    }
    
    .classic-desc-overlay {
        font-size: 0.65rem;
        height: 18%;
        bottom: 3%;
    }
    
    .classic-part-name {
        font-size: 0.65rem;
    }
    
    .classic-energy-icon {
        width: 30px;
        height: 30px;
    }
    
    .classic-energy-value {
        font-size: 0.85rem;
    }
}

@media (max-width: 575px) {
    .classic-name-overlay {
        font-size: 0.75rem;
        bottom: 25%;
    }
    
    .classic-desc-overlay {
        font-size: 0.55rem;
        height: 18%;
        bottom: 3%;
    }
    
    .classic-part-name {
        font-size: 0.55rem;
    }
    
    .classic-class-icon {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
    
    .classic-energy-badge {
        top: -6px;
    }
    
    .classic-energy-icon {
        width: 24px;
        height: 24px;
    }
    
    .classic-energy-value {
        font-size: 0.7rem;
    }
}