/* ============================================
   SHARED.CSS v4.2 - Updated for IMCollectibles
   Path: /var/www/improtectors.com/mint/assets/css/shared.css

   CHANGES IN v4.2:
   - RESTORED: NFT card grid styles
   - RESTORED: NFT popup/modal styles
   - RESTORED: Filter button styles
   - RESTORED: Stats bar styles
   - RESTORED: Rarity color classes
   - RESTORED: Spinner animation
   - RESTORED: Page header styles
   ============================================ */

:root {
    --gold: #d6ba66;
    --gold-light: #e8d38a;
    --gold-dark: #b89d4a;
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --border: rgba(214, 186, 102, 0.15);
    --border-gold: rgba(214, 186, 102, 0.3);
    --text: #e8e6e3;
    --text-muted: #8a8a8a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 75px; /* Account for fixed header */
}

.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse at 20% 20%, rgba(214, 186, 102, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(214, 186, 102, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(214, 186, 102, 0.03) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gold);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.logo:hover {
    color: var(--gold-light);
}

/* Header Controls (Wallet + Hamburger) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

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

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

.wallet-status.connected .address {
    color: var(--gold);
}

.connect-btn {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(214, 186, 102, 0.4);
}

.connect-btn.hidden {
    display: none;
}

/* ============================================
   HAMBURGER BUTTON
   ============================================ */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    gap: 5px;
    transition: all 0.3s;
}

.hamburger:hover {
    border-color: var(--gold);
}

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

.hamburger.active {
    border-color: var(--gold);
}

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

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

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

/* ============================================
   DROPDOWN MENU - v4.1 (320px + Gold Scrollbar)
   ============================================ */

/* Custom Gold Scrollbar */
.dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark), var(--gold));
    border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gold), var(--gold-light));
}

/* Firefox scrollbar */
.dropdown-menu {
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--bg-dark);
}

.dropdown-menu {
    position: fixed;
    top: 75px;
    right: 0;
    width: 320px;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid rgba(214, 186, 102, 0.4);
    border-top: none;
    border-radius: 0 0 0 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: rgba(214, 186, 102, 0.1);
    color: var(--gold);
    border-left-color: var(--gold);
}

/* External link indicator */
.dropdown-menu a[target="_blank"]::after {
    content: '↗';
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.5;
}

/* Gold Gradient Dividers */
.dropdown-menu .divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0.5rem 1rem;
    opacity: 0.4;
}

/* Section Labels */
.dropdown-menu .section-label {
    padding: 0.6rem 1.25rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    opacity: 0.7;
}

/* Wallet Section in Dropdown */
.dropdown-wallet {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(214, 186, 102, 0.4);
    margin-top: 0.5rem;
}

.dropdown-wallet .wallet-status {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.dropdown-wallet .connect-btn,
.dropdown-wallet .disconnect-btn {
    display: block;
    width: 100%;
    text-align: center;
}

.disconnect-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    font-family: inherit;
}

.disconnect-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

/* Menu Backdrop */
.menu-backdrop {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   LEGACY STYLES (kept for backward compat)
   ============================================ */
.nav-center { display: none; }
.nav-dropdown { display: none; }
.mobile-menu { display: none; }
.wallet-area { display: none; }

/* ============================================
   PAGE HEADER & STATS BAR
   ============================================ */
.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 {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

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

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

/* ============================================
   FILTER BUTTONS
   ============================================ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

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

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

.filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
}

/* Mobile: Convert filters to dropdown */
@media (max-width: 600px) {
    .filters {
        position: relative;
    }
    
    .filters::before {
        content: 'Filter by Rarity';
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 10px;
        color: var(--gold);
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .filters .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ============================================
   NFT GRID
   ============================================ */
.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .nft-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .nft-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ============================================
   NFT CARDS
   ============================================ */
.nft-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nft-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(214, 186, 102, 0.15);
}

.nft-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.nft-card-info {
    padding: 0.75rem;
}

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

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

/* ============================================
   RARITY COLORS
   ============================================ */
.rarity-founding {
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rarity-frequency {
    color: #9333ea !important;
}

.rarity-elder {
    color: #3b82f6 !important;
}

.rarity-animal {
    color: #10b981 !important;
}

.rarity-rare {
    color: #f59e0b !important;
}

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

/* ============================================
   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: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
}

.nft-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

.nft-popup-image {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

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

.nft-popup-rarity {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.nft-attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

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

.nft-attribute-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.nft-attribute-value {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
}

.nft-popup-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.nft-popup-buttons .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}

/* ============================================
   SPINNER
   ============================================ */
.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;
}

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

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

.collection-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: block;
}

.collection-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(214, 186, 102, 0.15);
}

.collection-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.collection-card.sold-out {
    background: linear-gradient(135deg, var(--bg-card), rgba(100, 100, 100, 0.1));
}

.collection-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

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

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

.collection-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.stat {
    text-align: center;
}

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

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

/* Status badges */
.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-coming {
    background: rgba(214, 186, 102, 0.2);
    color: var(--gold);
    border: 1px solid rgba(214, 186, 102, 0.3);
}

.badge-sold-out {
    background: rgba(100, 100, 100, 0.3);
    color: #888;
    border: 1px solid rgba(100, 100, 100, 0.4);
}

.badge-burn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   BUTTONS & CARDS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(214, 186, 102, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--gold);
}

.btn-secondary:hover {
    background: rgba(214, 186, 102, 0.1);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.card-title {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

/* ============================================
   MAIN CONTENT AREAS
   ============================================ */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 75px);
}

.content {
    text-align: center;
    max-width: 1200px;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(214, 186, 102, 0.4));
}

h1 {
    font-family: 'Lora', serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 40px rgba(214, 186, 102, 0.3);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

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

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.loading p {
    margin-top: 1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 600px) {
    .top-bar {
        padding: 0 1rem;
    }

    .logo span {
        display: none;
    }

    .wallet-status .address {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dropdown-menu {
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .nft-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .nft-card-info {
        padding: 0.5rem;
    }
    
    .nft-card-name {
        font-size: 0.8rem;
    }
    
    .nft-card-rarity {
        font-size: 0.7rem;
    }
    
    .nft-popup-content {
        padding: 1rem;
    }
    
    .nft-popup-image {
        max-width: 220px;
    }
    
    .nft-attributes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    .collections-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .main {
        padding: 1.5rem 1rem;
    }
    
    .stats-bar {
        gap: 1.5rem;
    }
}
