@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');


:root {
    --primary: #ed1c24;
    --secondary: #ffffff;
    --accent: #f9d423;
    --dark: #b31217;
    --bg-dark: #121212;
    --bg-light: #1a1a1a;
    --text-light: #ffffff;
    --text-dark: #121212;
    overscroll-behavior: none;
}

/* --- MODERN DARK THEME & BACKGROUND GRID --- */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    /* Subtle background grid for a tech feel */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(237, 28, 36, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- DYNAMIC GRID LAYOUT --- */
.page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 2rem auto;
    align-items: center;
}

.grid-left, .grid-right {
    animation: fadeIn 1s ease-out forwards;
}

.grid-left { animation-delay: 0.2s; opacity: 0; }
.grid-right { animation-delay: 0.4s; opacity: 0; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- PRELOADER --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark); /* Match your body background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Ensure it's on top of everything */
    opacity: 1;
    transition: opacity 0.5s ease-out; /* Smooth fade out */
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none; /* Allow clicks through once hidden */
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary); /* Use your primary color */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* --- LEFT COLUMN: HERO CONTENT --- */
.header-content { text-align: left; }

.header-nft-image {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 0 40px rgba(237, 28, 36, 0.3), /* existing */
                0 0 60px rgba(237, 28, 36, 0.2), /* stronger base glow */
                0 0 80px rgba(237, 28, 36, 0.1); /* even stronger, wider glow */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Ensure box-shadow transitions */
    border: 2px solid rgba(237, 28, 36, 0.5);
}


.header-nft-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(237, 28, 36, 0.5), /* Stronger on hover */
                0 0 80px rgba(237, 28, 36, 0.3),
                0 0 100px rgba(237, 28, 36, 0.2);
}

h1 {
    font-family: 'DM Sans', monospace;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--secondary);
    margin: 0;
}

.header-description {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 400;
    font-size: 1.1rem;
    max-width: 450px;
    margin-top: 1.5rem;
    color: var(--text-light);
}

/* --- RIGHT COLUMN: GLASSMORPHISM CARD --- */
.presale-container {
    background: rgba(26, 26, 26, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem;
}

.add-token-section {
    font-family: 'DM Sans';
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    margin-top: 2rem;
    margin-left: 20em;
    margin-right: 20em;
    
}

.info-card {
    font-family: 'DM Sans';
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
    font-family: 'Space Mono', monospace;
    color: var(--text-light);
    opacity: 0.7;
}

.info-value { 
    font-weight: 600; 
    font-size: 14px;
    color: var(--secondary); 
}

/* --- CUSTOM NUMBER INPUT STYLING --- */

/* 1. Hide the default browser spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* 2. Make space for our custom buttons inside the input */
#amount {
    /* Add padding on the right to prevent text from overlapping the buttons */
    padding-right: 3rem !important; /* Use !important to override Tailwind's w-full padding */
}

/* 3. Style the container and button wrapper */
.custom-number-input-container {
    position: relative; /* This is crucial for positioning the buttons */
}

.number-spinner-buttons {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Match the input's border radius */
    border-radius: 0 12px 12px 0; 
    overflow: hidden; /* Ensures the button corners are clipped correctly */
    border-left: 1px solid rgba(255, 255, 255, 0.1); /* Separator line */
}

/* 4. Style the individual spinner buttons */
.number-spinner-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 2.5rem; /* Adjust width as needed */
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.number-spinner-btn:hover {
    background-color: var(--primary); /* Use your primary red color */
    color: white;
}

.number-spinner-btn:active {
    background-color: var(--dark); /* Use your darker red on click */
}

/* Make the icons slightly smaller */
.number-spinner-btn i {
    font-size: 0.8em;
}

/* --- MODERNIZED FORMS & BUTTONS --- */
#amount {
    font-family: 'Space Mono', monospace;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.2rem;
    color: var(--secondary);
    transition: all 0.3s ease;
}

#amount::placeholder { color: rgba(255, 255, 255, 0.4); }

#amount:focus {
    background: rgba(0, 0, 0, 0.4);
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.5);
    border-color: rgba(237, 28, 36, 0.7);
}

.btn-primary {
    font-family: 'Space Mono', monospace;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(237, 28, 36, 0.4);
    width: 100%;
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 20px rgba(237, 28, 36, 0.4); }
    50% { box-shadow: 0 0 30px rgba(237, 28, 36, 0.6); }
    100% { box-shadow: 0 0 20px rgba(237, 28, 36, 0.4); }
}

.btn-primary:hover {
    background: var(--dark);
    transform: translateY(-3px);
    animation-play-state: paused;
}

/* --- NAVIGATION & FOOTER --- */
.main-nav, .footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    display: flex; 
    justify-content: center; 
}

.main-nav a { 
    color: var(--text-light); 
    text-decoration: none; 
    font-weight: 500; 
    font-size: 1rem; 
    padding: 8px 16px; 
    border-radius: 8px; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.main-nav a:hover { background-color: rgba(255, 255, 255, 0.1); }

.footer {
    text-align: center;
    border-bottom: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 3rem;
    padding: 2rem 1rem;
    position: relative;
}

#particles-js { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    top: 0; 
    left: 0; 
    z-index: -1; 
}

.social-icons { 
    display: flex; 
    justify-content: center; 
    gap: 25px; 
    margin-bottom: 1rem; 
}

.social-icon { 
    color: var(--text-light); 
    font-size: 20px; 
    transition: all 0.3s ease; 
}

.social-icon:hover { 
    transform: translateY(-4px); 
    color: var(--primary); 
}

/* --- UTILITIES & SCROLL TO TOP --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
}

.scroll-to-top.visible { opacity: 1; visibility: visible; }
.scroll-to-top:hover { background: var(--dark); transform: translateY(-5px); }

/* --- MOBILE MENU ICON (HIDDEN BY DEFAULT) --- */
.menu-icon {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    z-index: 1001;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    max-width: 350px;
    pointer-events: none;
}

.toast {
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(-20px);
    animation: toastIn 0.5s forwards, toastOut 0.5s forwards 4.5s;
    pointer-events: auto;
    min-width: 200px;
    max-width: 350px;
    font-size: 0.95em;
}

.toast.success { border-left: 5px solid #28a745; }
.toast.error { border-left: 5px solid #dc3545; }
.toast.warning { border-left: 5px solid #ffc107; }
.toast.pending { border-left: 5px solid #007bff; }
.toast.info { border-left: 5px solid #6c757d; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

.toast-icon {
    font-size: 1em;
    min-width: 18px;
}

@media (max-width: 768px) {
    #toast-container {
        top: 15px;
        right: 15px;
        left: 15px;
        max-width: calc(100% - 30px);
        transform: translateX(0);
    }
    .toast {
        min-width: unset;
        max-width: 100%;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .toast-icon {
        font-size: 0.9em;
    }
}

/* --- MOBILE RESPONSIVENESS --- */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .page-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .header-content { text-align: center; }
    .header-nft-image { margin: 0 auto 1.5rem; }
    .header-description { margin: 1.2rem auto 0; max-width: 500px; }
    
    .add-token-section {
        margin-left: 10%;
        margin-right: 10%;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        background-size: 30px 30px; /* Smaller grid on mobile */
    }
    
    /* Main content adjustments */
    main {
        padding: 1rem;
    }
    
    .page-grid {
        gap: 2rem;
        margin: 1rem auto;
        padding: 0;
    }
    
    /* Header content mobile optimization */
    .header-nft-image {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .header-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-top: 1rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    /* Presale container mobile optimization */
    .presale-container {
        padding: 1.5rem;
        border-radius: 12px;
        margin: 0 0.5rem;
    }
    
    .info-card {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    
    .info-label, .info-value {
        font-size: 0.9rem;
    }
    
    #amount {
        padding: 0.8rem;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    .btn-primary {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    /* Add token section mobile */
    .add-token-section {
        margin: 2rem 0.5rem 0;
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .add-token-section h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    /* Navigation mobile menu */
    .menu-icon { display: block; }
    
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-light);
        padding: 1rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        border-radius: 0 0 10px 10px;
    }
    
    .main-nav ul.active {
        display: flex;
    }
    
    .main-nav a {
        padding: 12px 16px;
        margin: 2px 0;
        border-radius: 8px;
        justify-content: flex-start;
    }
    
    /* Footer mobile optimization */
    .footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
    
    .social-icons {
        gap: 20px;
        margin-bottom: 1rem;
    }
    
    .social-icon {
        font-size: 18px;
    }
    
    /* Scroll to top mobile */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .page-grid {
        gap: 1.5rem;
        margin: 0.5rem auto;
    }
    
    .header-nft-image {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .header-description {
        font-size: 0.9rem;
        padding: 0;
    }
    
    .presale-container, .add-token-section {
        padding: 1rem;
        margin: 0 0.25rem;
        border-radius: 16px;
    }
    
    .info-card {
        padding: 0.8rem;
    }
    
    .info-label, .info-value {
        font-size: 0.85rem;
    }
    
    #amount {
        padding: 0.7rem;
        font-size: 1rem;
    }
    
    .btn-primary {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .add-token-section h2 {
        font-size: 1.1rem;
    }
    
    .social-icons {
        gap: 15px;
    }
    
    .social-icon {
        font-size: 16px;
    }
}

/* Extra small phones */
@media (max-width: 320px) {
    main {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .header-description {
        font-size: 0.85rem;
    }
    
    .presale-container, .add-token-section {
        padding: 0.8rem;
        margin: 0 0.1rem;
    }
    
    .info-card {
        padding: 0.6rem;
    }
    
    #amount {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Remove unused classes */
.header, .compass-rose { display: none; }