/**
 * IMProtectors Mint System - Shared Styles
 * =========================================
 * Includes: Header, Hamburger Menu, NFT Cards, Modals, Animations
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Lora:wght@400;600&display=swap');

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a24;
    --border: #2a2a3a;
    --border-gold: rgba(214, 186, 102, 0.3);
    --text: #e4e4e7;
    --text-muted: #71717a;
    --gold: #d6ba66;
    --gold-light: #e0c77a;
    --gold-dark: #b89d4a;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Montserrat', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Gradient */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, rgba(214, 186, 102, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   HEADER / TOP BAR
   ============================================ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

/* Logo - Left */
.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gold);
    flex-shrink: 0;
}

.top-bar .logo img {
    width: 40px;
    height: 40px;
}

.top-bar .logo span {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Nav Links - Center */
.nav-center {
    display: flex;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-center a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-center a:hover,
.nav-center a.active {
    color: var(--gold);
}

/* Wallet Status - Right */
.wallet-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.wallet-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
}

.wallet-status.connected .dot {
    background: var(--success);
}

.wallet-status .address {
    font-family: monospace;
    color: var(--text-muted);
}

.connect-btn {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.connect-btn:hover {
    background: var(--gold-light);
}

/* ============================================
   HAMBURGER MENU (Mobile Only)
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1002;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.98);
    z-index: 999;
    padding: 2rem;
    flex-direction: column;
    gap: 0;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--gold);
}

.mobile-menu .mobile-wallet {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gold);
}

.mobile-menu .mobile-wallet .wallet-status {
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
}

.mobile-menu .mobile-wallet .connect-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .top-bar .logo span {
        display: none;
    }
    
    .nav-center {
        display: none;
    }
    
    .wallet-area .wallet-status,
    .wallet-area .connect-btn {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
}

/* ============================================
   NFT CARD STYLES (with glows and tilts)
   ============================================ */
.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .nft-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.nft-card {
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardGlow 12s infinite ease-in-out;
}

.nft-card:hover {
    transform: perspective(500px) rotateX(5deg) rotateY(5deg) translateY(-8px);
    border-color: var(--gold);
}

/* Glowing Border Animation */
@keyframes cardGlow {
    0% { box-shadow: 0 0 20px rgba(255, 192, 203, 0.4); }
    20% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.4); }
    40% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); }
    60% { box-shadow: 0 0 20px rgba(0, 0, 255, 0.4); }
    80% { box-shadow: 0 0 20px rgba(128, 0, 128, 0.4); }
    100% { box-shadow: 0 0 20px rgba(255, 192, 203, 0.4); }
}

/* Stagger animation for variety */
.nft-card:nth-child(3n) { animation-delay: 0.5s; }
.nft-card:nth-child(3n+1) { animation-delay: 1s; }
.nft-card:nth-child(3n+2) { animation-delay: 1.5s; }

/* Smoke Effect */
.nft-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0.1;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
    animation: smokeSwirl 8s infinite ease-in-out;
}

.nft-card:hover::before {
    opacity: 0.4;
}

@keyframes smokeSwirl {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-10px, -10px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

.nft-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    position: relative;
    z-index: 0;
}

.nft-card-info {
    padding: 1rem;
    position: relative;
    z-index: 2;
}

.nft-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gold);
}

.nft-card-rarity {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Rarity Colors */
.rarity-founding { color: #f472b6 !important; }
.rarity-frequency { color: var(--gold) !important; }
.rarity-elder { color: #a78bfa !important; }
.rarity-animal { color: #818cf8 !important; }
.rarity-rare { color: #60a5fa !important; }
.rarity-standard { color: #9ca3af !important; }

/* ============================================
   NFT POPUP / MODAL
   ============================================ */
.nft-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.nft-popup.active {
    display: flex;
}

.nft-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--gold);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.nft-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.nft-popup-close:hover {
    color: var(--error);
}

.nft-popup-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.nft-popup-title {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.nft-popup-rarity {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Attributes Grid */
.nft-attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.nft-attribute {
    background: var(--bg-dark);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.nft-attribute-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.nft-attribute-value {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
}

/* Popup Buttons */
.nft-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.nft-popup-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gold);
    color: #000;
}

.btn-primary:hover {
    background: var(--gold-light);
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--gold);
    border: 1px solid var(--gold) !important;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

/* ============================================
   COLLECTION CARDS (for /protectors and /collection pages)
   ============================================ */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.collection-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 2rem;
    padding-top: 3rem; /* Extra space for centered badge */
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(214, 186, 102, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.collection-card:hover {
    border-color: var(--gold);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(214, 186, 102, 0.2);
}

.collection-card:hover::before {
    opacity: 1;
}

.collection-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.collection-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-gold);
}

/* Status badges - TOP CENTER */
.status-badge {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 5;
}

.badge-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.badge-coming-soon {
    background: var(--bg-dark);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-sold-out {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.badge-burn {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.5);
}

.collection-image {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid var(--gold);
}

.collection-name {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.collection-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.collection-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sold out styling */
.collection-card.sold-out {
    opacity: 0.7;
}

.collection-card.sold-out:hover {
    transform: translateY(-4px) scale(1.01);
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--gold);
    color: var(--gold);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}

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

.pagination .page-info {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
}

/* ============================================
   LOADING & SPINNER
   ============================================ */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5.5rem 1rem 2rem;
    position: relative;
    z-index: 10;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: 'Lora', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stats-bar .stat-item {
    text-align: center;
}

.stats-bar .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.stats-bar .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-family: 'Lora', serif;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-state .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--gold);
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.empty-state .btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}
