/* CSS Variables - Unified with XTokenFactory */
:root {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --accent-primary: #663399; /* Rebecca Purple */
    --accent-secondary: #8b5fbf;
    --accent-light: #a77dd6;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: #333333;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --radius: 8px;
    --radius-lg: 12px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Network Badge - Critical styles from factory */
.network-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.2s ease;
}

.network-badge:hover {
    background: var(--accent-secondary);
}

.network-badge.clickable {
    position: relative;
}

.network-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.network-badge.open .network-arrow {
    transform: rotate(180deg);
}

/* Network Dropdown - Copied from working factory styles */
.network-dropdown {
    position: relative;
}

.network-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    margin-top: 0.25rem;
    overflow: hidden;
}

.network-menu.hidden {
    display: none;
}

.network-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.network-option:hover {
    background: var(--bg-tertiary);
}

.network-option.active {
    background: var(--accent-primary);
    color: white;
}

.network-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.network-name {
    font-weight: 500;
}

/* Wallet Styling */
.wallet-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wallet-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.wallet-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.wallet-address-full {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.6875rem;
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.wallet-balance {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.wallet-bottom-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    width: 100%;
}

.wallet-network-dropdown {
    position: relative;
}

.wallet-network-dropdown .network-menu {
    min-width: 120px;
    width: max-content;
}

.network-badge-small {
    background: var(--accent-primary);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius);
    font-size: 0.6rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.1875rem;
    transition: background-color 0.2s ease;
}

.network-badge-small:hover {
    background: var(--accent-secondary);
}

.network-badge-small .network-arrow {
    font-size: 0.5rem;
}

.wallet-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-wallet-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-wallet-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Header - Copy from working factory */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Roadmap Section */
.roadmap-section {
    margin: 4rem 0;
}

.roadmap-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.roadmap-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.roadmap-item {
    padding: 1.5rem 0;
}

.roadmap-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.roadmap-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.roadmap-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.contract-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.contract-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Header - Unified with XTokenFactory */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.network-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.2s ease;
}

.network-badge:hover {
    background: var(--accent-secondary);
}

.network-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-lg);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 4rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Card Styles - Unified */
.projects-card,
.roadmap-card,
.about-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Links Section */
.links-section {
    max-width: 800px;
    margin: 0 auto;
}

.links-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.link-item {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-align: center;
}

.link-item:last-child {
    margin-bottom: 0;
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.link-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.primary-link {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 1.5rem;
}

.primary-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.secondary-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.secondary-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.link-item p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Roadmap Section */
.roadmap-timeline {
    padding: 2rem;
}

.roadmap-item {
    position: relative;
    display: flex;
    gap: 1.5rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.roadmap-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.roadmap-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 3rem;
    bottom: -2rem;
    width: 2px;
    background: var(--border-color);
}

.roadmap-marker {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.roadmap-item.completed .roadmap-marker {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.roadmap-item.in-progress .roadmap-marker {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.roadmap-item.planned .roadmap-marker {
    background: var(--border-color);
    box-shadow: 0 0 0 4px rgba(51, 51, 51, 0.2);
}

.roadmap-content {
    flex: 1;
    padding-top: 0.25rem;
}

.roadmap-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.roadmap-content p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.roadmap-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.roadmap-item.completed .roadmap-status {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.roadmap-item.in-progress .roadmap-status {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.roadmap-item.planned .roadmap-status {
    background: rgba(136, 136, 136, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(136, 136, 136, 0.3);
}

/* About Section */
.about-content {
    padding: 2rem;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.feature-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.highlight-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.highlight-icon {
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-item span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Buttons - Unified */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Footer - Unified */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.footer-info-centered {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.footer-info-centered p {
    margin: 0.5rem 0;
}

.footer-info-centered a {
    color: var(--accent-light);
    text-decoration: none;
}

.footer-info-centered a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Toast Notifications - Unified */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .projects-grid,
    .roadmap-timeline,
    .about-content {
        padding: 1.5rem;
    }
    
    .project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .roadmap-item {
        gap: 1rem;
    }
    
    .roadmap-item:not(:last-child)::after {
        left: 0.5rem;
    }
    
    .roadmap-marker {
        width: 1rem;
        height: 1rem;
    }
    
    .feature-highlights {
        grid-template-columns: 1fr;
    }
}

/* Force desktop layout improvements */
@media (min-width: 769px) {
    body {
        min-width: 1200px !important;
        width: 100% !important;
    }
    
    .container {
        max-width: 1400px !important;
        padding: 0 2rem !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .main {
        padding: 3rem 0 !important;
        width: 100% !important;
    }
    
    .hero {
        padding: 3rem 2rem !important;
        max-width: 900px !important;
        margin: 0 auto 4rem auto !important;
        width: 100% !important;
    }
    
    .header-content {
        flex-direction: row !important;
        width: 100% !important;
    }
    
    .wallet-status {
        min-width: 200px !important;
    }
}

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

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

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

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-warning {
    color: var(--warning);
}