/* Zoroark Card Collection - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* Zoroark-inspired dark theme */
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-highlight: #1e1e2a;
    
    /* Accent colors - Zoroark red/black theme */
    --accent-primary: #c62828;
    --accent-secondary: #ff5252;
    --accent-glow: rgba(198, 40, 40, 0.3);
    
    /* Text */
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --text-muted: #666;
    
    /* Rarity colors */
    --rarity-common: #9e9e9e;
    --rarity-uncommon: #4caf50;
    --rarity-holo: #7c4dff;
    --rarity-ultra: #ff9800;
    --rarity-secret: linear-gradient(135deg, #ffd700, #ff6b6b, #a855f7);
    --rarity-illustration: linear-gradient(135deg, #ec4899, #8b5cf6);
    --rarity-promo: #00bcd4;
    
    /* Status */
    --owned: #4caf50;
    --not-owned: #424242;
    
    /* Borders & Shadows */
    --border-color: #2a2a35;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --glow-red: 0 0 20px rgba(198, 40, 40, 0.4);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(198, 40, 40, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(198, 40, 40, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
.site-header {
    background: linear-gradient(180deg, var(--bg-card) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    color: var(--text-primary);
}

.site-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-secondary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-logo .tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-secondary);
    background: rgba(198, 40, 40, 0.1);
}

.nav-link.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.nav-link.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--glow-red);
}

/* Stats Banner */
.stats-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-secondary);
    font-family: 'Space Mono', monospace;
    line-height: 1;
}

.stat-value.owned {
    color: var(--owned);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: var(--spacing-sm);
}

/* Progress Bar */
.progress-container {
    grid-column: 1 / -1;
    margin-top: var(--spacing-md);
}

.progress-bar {
    height: 8px;
    background: var(--bg-highlight);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Era Sections */
.era-section {
    margin-bottom: var(--spacing-xl);
}

.era-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.era-header:hover {
    box-shadow: var(--glow-red);
}

.era-title {
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.era-count {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

/* Card Item */
.card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--accent-primary);
}

.card-item.owned {
    border-color: var(--owned);
}

.card-item.owned::before {
    content: '✓';
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--owned);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

.card-image-container {
    position: relative;
    padding-top: 140%;
    background: var(--bg-highlight);
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card-item:hover .card-image {
    transform: translate(-50%, -50%) scale(1.05);
}

.card-info {
    padding: var(--spacing-md);
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-variant {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--bg-highlight);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.card-set {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.card-number {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-price {
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Rarity badges */
.rarity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rarity-common { background: var(--rarity-common); color: white; }
.rarity-uncommon { background: var(--rarity-uncommon); color: white; }
.rarity-holo { background: var(--rarity-holo); color: white; }
.rarity-ultra { background: var(--rarity-ultra); color: black; }
.rarity-secret { background: var(--rarity-secret); color: white; }
.rarity-illustration { background: var(--rarity-illustration); color: white; }
.rarity-promo { background: var(--rarity-promo); color: white; }

/* Story indicator */
.has-story {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--spacing-xl);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.timeline-item.acquired::before {
    background: var(--owned);
}

.timeline-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.timeline-story {
    color: var(--text-secondary);
    line-height: 1.8;
}

.timeline-trade {
    background: var(--bg-highlight);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.timeline-trade h4 {
    font-size: 0.9rem;
    color: var(--accent-secondary);
    margin-bottom: var(--spacing-sm);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-highlight);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--glow-red);
}

.btn-secondary {
    background: var(--bg-highlight);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
}

.btn-success {
    background: var(--owned);
    color: white;
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-title h1 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

.login-title p {
    color: var(--text-muted);
}

/* Flash Messages */
.flash {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

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

.flash-error {
    background: rgba(198, 40, 40, 0.2);
    border: 1px solid var(--accent-primary);
    color: var(--accent-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-secondary);
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-highlight);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.admin-table tr:hover {
    background: var(--bg-highlight);
}

/* Video embed */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-md);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-banner {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .era-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .stats-banner {
        grid-template-columns: 1fr;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}
