/* DuperHeroes Shared Styles */

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero image styles */
.hero-image {
    font-size: 6rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.hero-image-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.hero-image-emoji {
    font-size: 6rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Battlecard Modal Styles */
.battlecard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.battlecard-popup {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    animation: battlecard-appear 0.3s ease-out forwards;
    position: relative;
}

@keyframes battlecard-appear {
    to {
        transform: scale(1);
    }
}

.battlecard-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
}

.battlecard-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto 16px;
    display: block;
}

.battlecard-emoji {
    font-size: 8rem;
    margin: 16px auto;
    display: block;
    text-align: center;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.battlecard-content {
    padding: 20px;
    color: white;
}

.battlecard-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.battlecard-label {
    font-weight: bold;
    color: #60a5fa;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.feedback-banner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

.feedback-banner.incorrect {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.close-button {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Game specific styles */
.choice-button {
    transition: all 0.2s ease;
    transform: translateY(0);
}

.choice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.choice-button.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: #059669;
}

.choice-button.incorrect {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #dc2626;
}

.choice-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-stats {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Battlecards collection styles */
.battlecard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.battlecard:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.battlecard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
}

.difficulty-easy {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.difficulty-medium {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.difficulty-hard {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.hero-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    object-position: center;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    /* Performance optimizations */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.alphabet-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 50;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.alphabet-nav button:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.search-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.stats-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Progressive Image Loading Styles */
.progressive-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.progressive-image .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(10px);
    transform: scale(1.1); /* Hide blur edges */
    transition: opacity 0.3s ease;
    z-index: 1;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.progressive-image .actual {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progressive-image .actual.loaded {
    opacity: 1;
}

.progressive-image .placeholder.fade-out {
    opacity: 0;
}

/* Enhanced hero image container for responsive images */
.hero-image-container {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
}

.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    /* Performance optimizations */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Battlecard header image sizing */
.battlecard-header .hero-image-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 16px;
    display: block;
}

.battlecard-header .hero-image-container img {
    object-fit: contain;
    object-position: center;
    background: linear-gradient(45deg, #f8fafc, #e2e8f0);
}

/* Emoji fallback styles */
.emoji-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

.emoji-fallback.fallback-active {
    display: flex;
}

.emoji-fallback .emoji {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Loading states */
.hero-image.loading {
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

.hero-image.error {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.4; }
}

/* Responsive image sizes */
.hero-thumbnail {
    width: 120px;
    height: 120px;
}

.hero-medium {
    width: 300px;
    height: 300px;
}

.hero-large {
    width: 600px;
    height: 600px;
}

/* Utility classes for text overflow */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}