/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --primary-green: #65dc42;
    --accent-gray: #1a1a1a;
    --text-gray: #cccccc;
    --border-gray: #333333;
    --accent-green: #22c55e;
    --accent-gold: #fbbf24;
}

body {
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
    font-weight: 700;
    line-height: 1.6;
    color: var(--primary-white);
    background-color: var(--primary-green);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 2px solid var(--primary-green);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Text styling for better visibility and bold appearance */
h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    color: var(--primary-white);
}

p, span, div, a {
    font-weight: 700;
    color: var(--primary-white);
}

/* Header */
header {
    background: rgba(34, 139, 34, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    background: rgba(20, 100, 20, 0.42);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.2rem 0;
}

/* Hide any duplicate navigation elements */
.nav-menu {
    display: none !important;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: var(--primary-white);
    text-decoration: none;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.025em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

nav ul li a:hover {
    color: var(--primary-white);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 1px;
}

nav ul li a:hover::after {
    width: 80%;
}

nav ul li a.active {
    color: var(--primary-white);
    font-weight: 900;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

nav ul li a.active::after {
    width: 80%;
    background: var(--primary-white);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Section animations */
section {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

section.in-view {
    opacity: 1;
    transform: translateY(0);
}

section:first-of-type {
    opacity: 1;
    transform: translateY(0);
}

/* Individual section animation delays */
section:nth-of-type(2) {
    transition-delay: 0.1s;
}

section:nth-of-type(3) {
    transition-delay: 0.2s;
}

section:nth-of-type(4) {
    transition-delay: 0.3s;
}

section:nth-of-type(5) {
    transition-delay: 0.4s;
}

/* Content animations within sections */
.content-grid p,
.links-grid .link-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

section.in-view .content-grid p,
section.in-view .links-grid .link-item {
    opacity: 1;
    transform: translateY(0);
}

section.in-view .content-grid p:nth-child(1) { transition-delay: 0.1s; }
section.in-view .content-grid p:nth-child(2) { transition-delay: 0.2s; }
section.in-view .content-grid p:nth-child(3) { transition-delay: 0.3s; }
section.in-view .content-grid p:nth-child(4) { transition-delay: 0.4s; }

section.in-view .links-grid .link-item:nth-child(1) { transition-delay: 0.1s; }
section.in-view .links-grid .link-item:nth-child(2) { transition-delay: 0.2s; }
section.in-view .links-grid .link-item:nth-child(3) { transition-delay: 0.3s; }
section.in-view .links-grid .link-item:nth-child(4) { transition-delay: 0.4s; }

/* Logo Images */
.hero-logo {
    width: 900px;
    height: 900px;
    object-fit: contain;
    margin-bottom: 2rem;
    display: block;
    background-color: var(--primary-green);
    padding: 2rem;
    border-radius: 0;
    /* Remove animation */
}

.hero-logo.inverted {
    filter: brightness(0) invert(1); /* Apply filter only when needed */
}

.hero-logo:not([src]), .hero-logo[src=""] {
    background-image: url('images/keep-calm-logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--primary-green);
}

.section-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Sections */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8rem 3rem 5rem;
    margin: 0 auto;
    text-align: center;
}

/* Make chart section wider */
#dex-widget {
    max-width: 1400px;
    width: 100%;
}

#dex-widget .section-content {
    width: 100%;
    max-width: 1200px;
}

#dex-screener {
    width: 100%;
    max-width: 1200px;
}

#dex-screener iframe {
    border-radius: 12px;
    max-width: 100%;
    border: 1px solid var(--border-gray);
}

/* Other sections keep original width */
#landing, #about, #buy-section, #links {
    max-width: 1000px;
}

/* Landing Section */
#landing {
    background-color: var(--primary-green);
    position: relative;
    min-height: 80vh;
}

/* About Section */
#about {
    min-height: 60vh;
    background-color: var(--primary-green);
    position: relative;
    padding: 3rem 2rem 2rem;
}

/* Buy Section */
#buy-section {
    min-height: 60vh;
    background: #65dc42;
}

#buy-section h2 {
    font-size: clamp(2.75rem, 5.5vw, 4.4rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--primary-white);
}

#buy-section p {
    font-size: 1.32rem;
    color: var(--primary-white);
    margin-bottom: 3rem;
    font-weight: 900;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero p {
    font-size: clamp(1.21rem, 2.2vw, 1.54rem);
    font-weight: 900;
    max-width: 600px;
    color: var(--primary-white);
    line-height: 1.7;
    margin-bottom: 2rem;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-green), #22c55e);
    color: var(--primary-white);
    border: none;
    padding: 1.2rem 3rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #22c55e, var(--primary-white));
    transition: left 0.3s ease;
    z-index: -1;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.cta-button:hover::before {
    left: 0;
}

/* About Section */

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2.2rem, 4.4vw, 3.3rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    color: var(--primary-white);
}

.content-grid {
    display: grid;
    gap: 2rem;
    max-width: 700px;
}

.original-poster {
    width: 350px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 1rem auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.original-poster:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.content-grid p {
    font-size: 1.265rem;
    font-weight: 900;
    color: var(--primary-white);
    line-height: 1.8;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border-left: 4px solid var(--primary-white);
    transition: all 0.3s ease;
}

.content-grid p:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.highlight {
    background: linear-gradient(45deg, var(--primary-white), var(--text-gray));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

/* Other Sections */
#links {
    min-height: 60vh;
}

#dex-widget {
    min-height: 80vh;
    background: var(--primary-green);
}

#community h2, #contract h2, #links h2, #dex-widget h2 {
    font-size: clamp(2.2rem, 4.4vw, 3.3rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
    color: var(--primary-white);
}

/* Links Section */
#links {
    min-height: 60vh;
    background: #65dc42;
    position: relative;
    overflow: hidden;
}

#links::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

#links .section-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.links-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.link-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.link-item:hover::before {
    left: 100%;
}

.link-item:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2),
                0 0 30px rgba(255, 255, 255, 0.1);
}

.link-item:active {
    transform: translateY(-4px) scale(1.01);
}

.link-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-label {
    font-weight: 900;
    color: var(--primary-white);
    font-size: 1.3rem;
    letter-spacing: 0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.link-item:hover .link-label {
    color: var(--primary-white);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.link-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.link-item:hover .link-description {
    color: var(--primary-white);
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: var(--primary-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.link-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    transition: left 0.3s ease;
    z-index: -1;
}

.link-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(255, 255, 255, 0.1);
    color: var(--primary-white);
}

.link-button:hover::before {
    left: 0;
}

.link-button:active {
    transform: translateY(0);
}

/* Add subtle floating animation */
@keyframes linkFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.link-item:nth-child(1) {
    animation: linkFloat 6s ease-in-out infinite;
    animation-delay: 0s;
}

.link-item:nth-child(2) {
    animation: linkFloat 6s ease-in-out infinite;
    animation-delay: 1s;
}

.link-item:nth-child(3) {
    animation: linkFloat 6s ease-in-out infinite;
    animation-delay: 2s;
}

.link-item:nth-child(4) {
    animation: linkFloat 6s ease-in-out infinite;
    animation-delay: 3s;
}

#contract p {
    font-family: 'Courier New', monospace;
    background: var(--accent-gray);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    word-break: break-all;
    margin-bottom: 2rem;
    border: 1px solid var(--border-gray);
}

button {
    background: transparent;
    color: var(--primary-white);
    border: 1px solid var(--border-gray);
    padding: 0.75rem 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border-radius: 4px;
}

button:hover {
    background: var(--primary-white);
    color: var(--primary-black);
    transform: translateY(-1px);
}

/* Lists */
ul {
    list-style: none;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

ul li {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-gray);
}

a {
    color: var(--primary-white);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--text-gray);
}

/* DEX Widget */
#dex-screener iframe {
    border-radius: 12px;
    max-width: 100%;
    border: 1px solid var(--border-gray);
}

/* Footer */
footer {
    background: var(--primary-green);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0;
    text-align: center;
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
    position: relative;
    z-index: 2;
}

.footer-content p {
    color: var(--primary-white);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 0 1rem;
        justify-content: center;
        width: 100%;
    }
    
    nav ul {
        gap: 0;
        flex-wrap: nowrap;
        justify-content: space-evenly;
        align-items: center;
        padding: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%;
        display: flex;
    }
    
    nav ul::-webkit-scrollbar {
        display: none;
    }
    
    nav ul li {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    nav ul li a {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    section {
        padding: 1.5rem 0.5rem 1rem;
        min-height: auto;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    #landing {
        min-height: 90vh;
        padding: 1rem 0.5rem 0.5rem;
    }
    
    #about, #buy-section, #links {
        min-height: auto;
        padding: 1rem 1rem 1rem;
    }
    
    #links {
        padding: 1.5rem 1rem 1rem;
    }
    
    #dex-widget {
        min-height: auto;
        padding: 2rem 0.5rem 1rem;
    }
    
    .hero {
        gap: 1rem;
    }
    
    .hero-logo {
        width: 280px;
        height: 280px;
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
        line-height: 1.4;
        text-align: center;
    }
    
    .content-grid {
        gap: 1rem;
    }
    
    .content-grid p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .highlight {
        font-size: 1.1rem;
        margin-top: 0.5rem;
    }
    
    #buy-section h2 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    #buy-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    #links h2, #dex-widget h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .section-logo {
        width: 32px;
        height: 32px;
    }
    
    .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.8rem;
    }
    
    .links-grid {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
        max-width: 100%;
        width: calc(100% - 2rem);
    }
    
    .link-item {
        padding: 1rem;
        transform: none !important;
        animation: none !important;
        border-radius: 16px;
        min-height: auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    .link-item:hover {
        transform: translateY(-2px) scale(1.01);
    }
    
    .link-content {
        gap: 0.75rem;
        min-height: auto;
    }
    
    .link-label {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .link-description {
        font-size: 0.85rem;
        line-height: 1.4;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .link-button {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
        margin-top: 0.5rem;
        white-space: nowrap;
        text-align: center;
    }
    
    #dex-screener iframe {
        height: 400px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Prevent horizontal scroll */
    * {
        box-sizing: border-box;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Medium screens */
@media (max-width: 1024px) and (min-width: 769px) {
    .links-grid {
        max-width: 700px;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .link-item {
        padding: 1.75rem;
    }
    
    .link-label {
        font-size: 1.2rem;
    }
    
    .link-description {
        font-size: 0.95rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    nav {
        padding: 0 0.5rem;
        width: 100%;
    }
    
    nav ul {
        gap: 0;
        padding: 0;
        justify-content: space-evenly;
        width: 100%;
    }
    
    nav ul li {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 0.25rem 0.3rem;
        white-space: nowrap;
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Reduce dead space on small screens */
    section {
        padding: 1rem 0.5rem 0.5rem;
    }
    
    #links {
        padding: 2rem 1rem 1rem;
        min-height: auto;
    }
    
    .links-grid {
        gap: 0.75rem;
        padding: 0;
        width: 100%;
        margin: 0 auto;
    }
    
    .link-item {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    .link-content {
        gap: 0.5rem;
    }
    
    .link-label {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .link-description {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .link-button {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
        margin-top: 0.25rem;
    }
    
    /* Contract address container adjustments */
    .link-item:last-child div[style] {
        padding: 12px !important;
        font-size: 12px !important;
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .link-item:last-child div[style] span:last-child {
        word-break: break-all !important;
        font-size: 10px !important;
        letter-spacing: 0px !important;
    }
    
    .link-item:last-child div[style] button {
        font-size: 10px !important;
        padding: 6px 12px !important;
        margin: 0 !important;
    }
}
