/* FLUQXLABS - NFT Gallery Styles */

/* ========================================
   GALLERY HEADER
   ======================================== */
.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   NFT GRID
   ======================================== */
.nft-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    /* Reduced gap for better fit */
    padding: 2rem 0;
}

/* NFT Card */
.nft-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(5px);

    /* Default: Fit 5 per row on large screens (20%) */
    /* Calculation: (100% - (4 * gap)) / 5 */
    /* 4 * 1.5rem = 6rem. But to be safe with justify-center, we use a slightly smaller basis */
    flex: 0 0 calc(20% - 1.2rem);
    min-width: 160px;
    /* Don't get too small */
}

.nft-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.nft-image-container {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.nft-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 10px;
}

.nft-card:hover .nft-image-container img {
    transform: scale(1.05);
}

.nft-info {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nft-name {
    font-size: 1rem;
    /* Slightly smaller text for 5-col layout */
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Light Mode Styles */
body.light-mode .nft-card {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.8);
    /* Slate-300 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

body.light-mode .nft-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.4);
    /* Blue-500 */
}

body.light-mode .nft-image-container {
    background: rgba(241, 245, 249, 0.5);
}

body.light-mode .nft-info {
    border-top-color: rgba(30, 41, 59, 0.05);
}

body.light-mode .nft-name {
    color: #1e293b;
}

/* Loading State for Images */
.nft-image-loading {
    filter: blur(10px);
    transform: scale(0.95);
}

.nft-image-loaded {
    filter: blur(0);
    transform: scale(1);
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* No Results */
.no-results {
    width: 100%;
    text-align: center;
    padding: 4rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

/* Responsive */

/* Tablet: 4 per row */
@media (max-width: 1280px) {
    .nft-card {
        flex: 0 0 calc(25% - 1.25rem);
        /* 4 per row */
    }
}

/* Tablet Small: 3 per row */
@media (max-width: 1024px) {
    .nft-card {
        flex: 0 0 calc(33.333% - 1rem);
        /* 3 per row */
    }
}

/* Mobile: 2 per row */
@media (max-width: 640px) {
    .nft-grid {
        gap: 0.75rem;
        /* Smaller gap on mobile */
    }

    .nft-card {
        flex: 0 0 calc(50% - 0.4rem);
        /* 2 per row strictly */
        min-width: 0;
        /* Allow shrinking */
    }

    .gallery-title {
        font-size: 2rem;
    }

    .nft-card:hover {
        transform: translateY(-4px);
    }

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

    .nft-name {
        font-size: 0.9rem;
    }
}

/* ========================================
   CHAIN SELECTOR
   ======================================== */
.chain-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.chain-btn {
    padding: 0.5rem 1.5rem;
    min-width: 140px;
    /* Ensure equal width */
    text-align: center;
    display: flex;
    /* Align text center if using min-width */
    justify-content: center;
    align-items: center;
    font-weight: 600;
    border-radius: 9999px;
    /* Rounded Full */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    /* Default Inactive */
    color: #e5e7eb;
    /* Gray-200 */
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.chain-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Active State - Matches Connect Wallet Gradient */
.chain-btn.bg-blue-600 {
    /* This class is toggled in JS */
    background: linear-gradient(to right, #3b82f6, #9333ea) !important;
    /* Blue-500 to Purple-600 */
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.chain-btn.bg-blue-600:hover {
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
    /* Purple shadow */
    transform: scale(1.05);
}

/* Light Mode Overrides for Chain Btn are handled in lighter block below if needed, 
   but specific graduate style usually persists or adapts. 
   User wants Connect Wallet style, which is gradient. 
*/

/* ========================================
   PAGINATION
   ======================================== */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-bottom: 2rem;
    width: 100%;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    min-width: 120px;
    /* Equal width for Next/Prev */
    font-weight: 600;
    border-radius: 9999px;
    /* Rounded Full */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Default Style (Inactive/Secondary feel or same as Connect Wallet? 
       User said "asi se deben de ver", implying the gradient style.
       Let's use the gradient style for normal state.
    */
    background: linear-gradient(to right, #3b82f6, #9333ea);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    /* Fallback for disabled */
    box-shadow: none;
    transform: none;
    color: #9ca3af;
}

.pagination-info {
    font-weight: 600;
    color: #d1d5db;
    /* Gray-300 */
    min-width: 100px;
    text-align: center;
}

/* Light Mode Overrides */
body.light-mode .chain-btn:not(.bg-blue-600) {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.8);
    /* Slate-300 */
    color: #475569;
    /* Slate-600 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-mode .chain-btn:not(.bg-blue-600):hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #3b82f6;
}

/* Active State in Light Mode uses same gradient */
body.light-mode .chain-btn.bg-blue-600 {
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Pagination in Light Mode */
body.light-mode .pagination-info {
    color: #475569;
}

body.light-mode .pagination-btn:disabled {
    background: #e2e8f0;
    /* Slate-200 */
    color: #94a3b8;
}

/* Gallery Header Text in Light Mode */
body.light-mode .gallery-subtitle {
    color: #64748b;
}

/* No Results Text */
body.light-mode .no-results {
    color: #64748b;
}

/* ========================================
   NFT MODAL
   ======================================== */
.nft-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(15, 15, 35, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.nft-modal-content {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    /* Fixed width for desktop, responsive for mobile */
    width: 360px;
    max-width: 90%;

    /* Vertical Constraint */
    max-height: 85vh;
    height: auto;

    /* Flex Layout */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* PROHIBIT SCROLL */

    position: relative;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Flexible Image Container */
.modal-image-container {
    width: 100%;
    /* Take available height but allow shrinking */
    flex: 1 1 auto;
    min-height: 0;
    /* Crucial for shrinking */

    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);

    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

/* Fixed Details Section */
.modal-details {
    text-align: center;
    flex-shrink: 0;
    /* Prevent details from squishing */
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
    line-height: 1.2;
}

.modal-chain {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-chain:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Specific Chain Gradients */
.chain-bsc {
    background: linear-gradient(135deg, #06B6D4, #3B82F6) !important;
    /* Cyan to Blue */
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3) !important;
}

.chain-alvey {
    background: linear-gradient(135deg, #8B5CF6, #A78BFA) !important;
    /* Purple to Light Purple */
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3) !important;
}

.chain-bsc:hover {
    box-shadow: 0 6px 15px rgba(6, 182, 212, 0.5) !important;
}

.chain-alvey:hover {
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.5) !important;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1;
}

.modal-price span {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.modal-buy-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modal-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
    filter: brightness(1.1);
}

.modal-buy-btn:active {
    transform: translateY(0);
}

/* Light Mode Modal */
body.light-mode .nft-modal-overlay {
    background: rgba(248, 250, 252, 0.6);
}

body.light-mode .nft-modal-content {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

body.light-mode .modal-close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
}

body.light-mode .modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

body.light-mode .modal-title {
    color: #1e293b;
}

body.light-mode .modal-price {
    color: #1e293b;
}

body.light-mode .modal-price span {
    color: #64748b;
}

body.light-mode .modal-image-container {
    background: #f8fafc;
}

/* Light Mode Chain Badge Overrides */
body.light-mode .chain-bsc {
    color: #0891b2 !important;
    /* Cyan-600 */
    border-color: rgba(8, 145, 178, 0.3) !important;
    background: rgba(6, 182, 212, 0.1) !important;
}

body.light-mode .chain-alvey {
    color: #7c3aed !important;
    /* Purple-600 */
    border-color: rgba(124, 58, 237, 0.3) !important;
    background: rgba(139, 92, 246, 0.1) !important;
}