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

:root {
    --background-color: #000;
    --text-color: #f5f5f7;
    --secondary-text-color: #a1a1a6;
    --border-color: #3a3a3c;
    --highlight-color: #ffffff;
    --card-background: #1c1c1e;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --brand-font-family: 'Koulen', display;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-align: center;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Scaled down */
    color: var(--text-color);
    margin-top: 3rem; /* Scaled down */
    font-family: var(--brand-font-family);
    letter-spacing: 0.02em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem); /* Scaled down */
    color: var(--text-color);
    margin-top: 2.25rem; /* Scaled down */
    margin-bottom: 1.125rem; /* Scaled down */
    font-family: var(--brand-font-family);
    letter-spacing: 0.02em;
}

p {
    margin-bottom: 1.125rem; /* Scaled down */
    font-size: 0.95rem; /* Scaled down */
    text-align: center;
}

/* Links */
a {
    color: var(--highlight-color);
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.8;
}

footer a, .white-paper-nav a {
    font-weight: normal;
}

/* Navigation */
header {
    padding: 24px;
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Brand styling */
.brand-container {
    text-align: left;
    display: flex;
    align-items: center;
}

.brand-container a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Brand text styling */
.brand-text {
    font-family: var(--brand-font-family);
    font-size: 32px;
    letter-spacing: 0.03em;
    color: var(--text-color);
    text-transform: uppercase;
    transition: color 0.3s;
}

.brand-text:hover {
    color: var(--highlight-color);
}

.logo:hover {
    opacity: 0.9;
}

nav {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    padding: 0;
}

.nav-link {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--highlight-color);
    transition: width 0.3s;
}

.nav-link.active, .nav-link:hover {
    color: var(--text-color);
}

.nav-link.active::after, .nav-link:hover::after {
    width: 100%;
}

/* Sections */
section {
    padding: 0;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    min-height: calc(100vh - 80px); /* Account for header height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px; /* Consistent starting point */
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
}

.section-container {
    max-width: 525px; /* 75% of 700px */
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    text-align: center;
}

/* Section Navigation with Edge Buttons */
.section-navigation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
}

/* For sections with forms and inputs, ensure they're accessible */
#calculator .section-container {
    z-index: 51; /* Higher than the section navigation */
    position: relative;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--text-color);
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.nav-button.prev-button {
    left: 20px;
}

.nav-button.next-button {
    right: 20px;
}

.nav-button:hover, .restart-button:hover {
    opacity: 0.7;
}

.nav-button:disabled {
    opacity: 0;
    cursor: default;
    pointer-events: none;
}

/* Add smooth transition for navigation buttons */
.section-navigation {
    transition: opacity 0.3s ease;
}

.hidden-section {
    display: none;
}

#mission {
    text-align: center;
    padding-top: 32px;
}

#mission h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--secondary-text-color);
    font-family: var(--brand-font-family);
}

#mission p {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.25rem;
}

/* Lists */
ul {
    list-style: none;
    margin-bottom: 2rem;
}

ul li {
    position: relative;
    padding-left: 24px; /* Scaled down */
    margin-bottom: 0.95rem; /* Scaled down */
    font-size: 0.95rem; /* Scaled down */
    text-align: left;
    max-width: 475px;
    margin-left: auto;
    margin-right: auto;
}

ul li::before {
    content: '→';
    color: var(--highlight-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 12px; /* Scaled down */
}

th {
    background-color: var(--card-background);
    font-weight: 500;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    background-color: rgba(28, 28, 30, 0.5);
    border-top: 1px solid var(--border-color);
}

tr:hover td {
    background-color: rgba(28, 28, 30, 0.8);
}

/* Mobile Table Styles */
@media (max-width: 768px) {
    /* Default table becomes scrollable horizontally */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin: 1.5rem 0;
    }
    
    /* All responsive tables convert to vertical cards */
    table.responsive-card-table,
    .growth-tiers table,
    .referral-system table {
        display: block;
        width: 100%;
        border-radius: 0;
        border-collapse: collapse;
        overflow: visible;
    }
    
    table.responsive-card-table thead,
    .growth-tiers table thead,
    .referral-system table thead {
        display: none; /* Hide headers on mobile */
    }
    
    table.responsive-card-table tbody,
    .growth-tiers table tbody,
    .referral-system table tbody {
        display: block;
        width: 100%;
    }
    
    table.responsive-card-table tr,
    .growth-tiers table tr,
    .referral-system table tr {
        display: block;
        width: 100%;
        margin-bottom: 1.5rem;
        border-radius: 8px;
        overflow: hidden;
        background-color: rgba(28, 28, 30, 0.5);
        border: 1px solid var(--border-color);
    }
    
    table.responsive-card-table td,
    .growth-tiers table td,
    .referral-system table td {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: flex-start; /* Changed from center to flex-start for better alignment */
        text-align: right;
        padding: 12px 16px;
        border-top: 1px solid rgba(58, 58, 60, 0.5);
        box-sizing: border-box;
        font-size: 0.85rem; /* Scaled down font size for mobile */
        line-height: 1.4;
    }
    
    table.responsive-card-table td:first-child,
    .growth-tiers table td:first-child,
    .referral-system table td:first-child {
        border-top: none;
    }
    
    table.responsive-card-table td:before,
    .growth-tiers table td:before,
    .referral-system table td:before {
        content: attr(data-label);
        font-weight: 500;
        margin-right: 12px;
        text-align: left;
        color: var(--secondary-text-color);
        flex: 0 0 45%; /* Fixed width for labels to prevent overlap */
        font-size: 0.8rem; /* Slightly smaller font for labels */
    }
    
    table.responsive-card-table td > *,
    .growth-tiers table td > *,
    .referral-system table td > * {
        flex: 0 0 50%; /* Ensure content doesn't overlap */
        word-break: break-word; /* Allow long words to break */
    }
    
    /* Force the stacked layout even for simple tables */
    tr, th, td {
        max-width: 100%;
        white-space: normal;
    }
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 500px;
    margin: 2rem auto;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

input[type="number"], 
input[type="email"], 
input[type="text"], 
input[type="tel"], 
input[type="url"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background-color: rgba(44, 44, 46, 0.5);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

button[type="submit"], .cta-button {
    display: inline-block;
    background-color: var(--highlight-color);
    color: black; /* Changed from white to black */
    border: none;
    border-radius: 30px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-family);
}

button[type="submit"]:hover, .cta-button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* CTA Section */
#join {
    text-align: center;
}

#join .cta-button {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    padding: 16px 36px;
}

/* Restart button styles */
.restart-button {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--text-color);
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

/* Removed duplicate hover style as it's combined with nav-button:hover above */

/* White Paper Styles */
.white-paper-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.white-paper-nav a {
    display: inline-block;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.white-paper-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.white-paper-section {
    padding: 80px 0 40px;
    scroll-margin-top: 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.paper-nav-buttons {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.paper-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--text-color);
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.paper-nav-button.prev {
    left: 20px;
}

.paper-nav-button.next {
    right: 20px;
}

.paper-nav-button:hover {
    opacity: 0.7;
}

.restart-icon-button {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-block;
    margin-left: 20px;
    transition: opacity 0.3s ease;
}

.restart-icon-button:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .paper-nav-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .paper-nav-button.prev {
        left: 10px;
    }
    
    .paper-nav-button.next {
        right: 10px;
    }
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--highlight-color);
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 40;
}

.scroll-top-btn.visible {
    opacity: 1;
}

/* Footer */
footer {
    padding: 48px 24px;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 64px;
    font-family: var(--brand-font-family);
    letter-spacing: 0.02em;
}

/* Touch/Swipe Navigation */
.swipe-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
}

/* Except for sections with forms/inputs */
#calculator .swipe-area {
    display: none; /* Disable swipe in calculator sections */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .brand-container {
        margin-bottom: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .brand-container a {
        justify-content: center;
    }
    
    .brand-text {
        font-size: 28px;
        text-align: center;
    }
    
    nav {
        margin-top: 10px;
        gap: 16px;
        justify-content: center;
        width: 100%;
    }
    
    section {
        padding: 70px 0 40px;
    }
    
    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .nav-button.prev-button {
        left: 10px;
    }
    
    .nav-button.next-button {
        right: 10px;
    }
    
    /* Additional fixes for mobile tables */
    .growth-tiers table, 
    .referral-system table {
        font-size: 0.8rem; /* Further reduce font size */
    }
    
    .growth-tiers td, 
    .referral-system td {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
        
    /* Fix for the tiered fee structure table */
    .growth-tiers td[data-label="Platform Fee"],
    .growth-tiers td[data-label="You Keep"],
    .referral-system td[data-label="Referral %"] {
        font-size: 0.75rem; /* Even smaller font for percentages */
    }
    
    /* Ensure text doesn't overlap */
    td {
        word-break: break-word;
        white-space: normal;
    }
}

/* Animation for performance */
@media (prefers-reduced-motion: no-preference) {
    .nav-link::after {
        transition: width 0.3s;
    }
    
    section {
        animation: fadeIn 0.5s ease-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
