/* 
 * NFT Gallery Stylesheet for Captain Ethereum Pre-Series
 * Based on provided regenerates.css and viewer.css
 */

 @font-face {
    font-family: 'Avengeance';
    src: url('../assets/fonts/avengeance_mightiest_avenger/AVENGEANCE_MIGHTIEST_AVENGER.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

 :root {
    --primary-pink: #ff6699;
    --primary-blue: #00ccff;
    --dark-blue: #3366ff;
    --accent: #FFD700;
    --dark: #1a1a2e;
    --light: #f7f7f7;
    --ethereum: #627eea;
    
    /* Enhanced glass effects */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-opaque: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.15);
    
    /* Glow effects */
    --glow-pink: rgba(255, 102, 153, 0.7);
    --glow-blue: rgba(0, 204, 255, 0.7);
    
    /* Keep existing accessibility colors */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-accent: #FFD700;
    --focus-outline: #FFD700;
    --focus-outline-offset: 3px;
    
    /* Animation durations */
    --transition-fast: 0.2s;
    --transition-medium: 0.3s;
    --transition-slow: 0.5s;
}

/* Base styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Avengeance', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #0f0f1e, #1a1a2e);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--light);
    text-decoration: none;
    transition: color var(--transition-medium) ease;
}

a:hover, a:focus {
    color: var(--accent);
}

button {
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hero Section */
.hero {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 3rem 5%;
    background: linear-gradient(to bottom, rgba(10, 10, 30, 0.9), rgba(26, 26, 46, 0.7)), 
                url('assets/ethereum-bg.jpg') center/cover no-repeat;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    animation: fadeIn var(--transition-slow) ease;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    animation: glow 2s ease-in-out infinite alternate;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--light);
}

/* Section Styles */
.section {
    padding: 3rem 10%;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--accent);
    position: relative;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 3px;
    background-color: var(--accent);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Character Cards */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.character-card {
    background: linear-gradient(135deg, 
        rgba(40, 40, 70, 0.7), 
        rgba(20, 20, 40, 0.9)
    );
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
}

.character-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 204, 255, 0.4);
    border-color: rgba(255, 102, 153, 0.5);
}

.character-card:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.character-image {
    height: 300px;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.character-image svg {
    max-width: 90%;
    max-height: 90%;
}

.character-content {
    padding: 1.5rem;
}

.character-name {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.character-role {
    font-size: 1rem;
    color: var(--glow-pink);
    margin-bottom: 1rem;
    font-style: italic;
}

.character-description {
    font-size: 0.9rem;
    color: var(--light);
}

.character-metadata {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.metadata-label {
    color: var(--glow-pink);
}

.metadata-value {
    color: var(--light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--transition-fast) ease;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(40, 40, 70, 0.9), 
        rgba(20, 20, 40, 0.95)
    );
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 50px rgba(0, 204, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: 5% auto;
    padding: 2rem;
    width: 80%;
    max-width: 800px;
    border-radius: 15px;
    position: relative;
    animation: slideIn var(--transition-medium) ease;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 15px var(--glow-pink);
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
}

.close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--primary-pink);
    box-shadow: 0 0 20px var(--glow-blue);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-image {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    margin-right: 2rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.modal-image svg {
    max-width: 90%;
    max-height: 90%;
}

.modal-title h2 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.modal-title p {
    font-size: 1.1rem;
    color: var(--glow-pink);
    font-style: italic;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.bio-section {
    line-height: 1.8;
}

.stats-section h3,
.powers-section h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.powers-list {
    list-style-type: none;
    margin-bottom: 2rem;
}

.powers-list li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.powers-list li::before {
    content: '⚡';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Status Messages */
.status-message {
    padding: 1rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(40, 40, 70, 0.7), rgba(20, 20, 40, 0.9));
    border-radius: 10px;
    margin-bottom: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(40, 40, 70, 0.7), rgba(20, 20, 40, 0.9));
    border-radius: 15px;
    margin-bottom: 2rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--light);
    margin-bottom: 2rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity var(--transition-medium) ease,
                visibility var(--transition-medium) ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 102, 153, 0.3);
    border-top: 5px solid var(--primary-blue);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--glow-blue);
    animation: spin 1s linear infinite;
}

/* Ethereum symbols background */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.eth-symbol {
    position: absolute;
    opacity: 0.1;
    animation: float-animation infinite linear both;
}

/* Animations */
@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes float-animation {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-1000px) rotate(360deg);
        opacity: 0;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.pagination-button {
    padding: 0.5rem 1.5rem;
    background-color: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--ethereum);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(98, 126, 234, 0.4);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Refresh button */
.refresh-button {
    display: block;
    margin: 1rem auto;
    padding: 0.5rem 1.5rem;
    background-color: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
}

.refresh-button:hover {
    background-color: var(--ethereum);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(98, 126, 234, 0.4);
}

/* Loading state for cards */
.character-card.loading {
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.character-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(40, 40, 70, 0.1) 25%, 
        rgba(40, 40, 70, 0.5) 50%, 
        rgba(40, 40, 70, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

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

/* Responsive styles */
@media (max-width: 992px) {
    .section {
        padding: 4rem 5%;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 5%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section {
        padding: 3rem 5%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 10% auto;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-image {
        width: 120px;
        height: 120px;
        margin: 0 auto 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .character-image {
        height: 250px;
    }
    
    .character-name {
        font-size: 1.3rem;
    }
    
    /* Add touch-friendly sizing */
    .character-card {
        min-height: 100px;
    }
    
    /* Increase touch target size */
    .close {
        padding: 0.5rem 0.8rem;
        font-size: 1.8rem;
    }
    
    /* Improve modal usability on small screens */
    .modal-content {
        margin: 0;
        height: 100vh;
        width: 100%;
        border-radius: 0;
    }
}

/* Add focus styles for interactive elements */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

/* Add reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --dark: #0a0a1a;
        --light: #e0e0e0;
        --glass-bg: rgba(98, 126, 234, 0.05);
    }
}