/* Chainflake - Styles
 * ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --text-primary: #37352f;
    --text-secondary: #787774;
    --text-light: #9b9b9b;
    --accent: #2eaadc;
    --border-color: #e9e9e7;
}

[data-theme="dark"] {
    --bg-primary: #191919;
    --bg-secondary: #202020;
    --text-primary: #e3e3e1;
    --text-secondary: #9b9a97;
    --text-light: #6b6b6b;
    --accent: #529cca;
    --border-color: #373737;
}

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

body {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 16px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 96px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    height: 45px;
    max-width: 100%;
    padding: 0 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
    margin-right: 16px;
}

.header-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: var(--text-secondary);
}

.header-nav a.app-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 6px 16px;
    border-radius: 30px;
    transition: opacity 0.2s ease;
}

.header-nav a.app-btn:hover {
    opacity: 0.8;
    color: var(--bg-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s ease;
}

.header-link:hover {
    color: var(--text-secondary);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

@media (max-width: 600px) {
    .header-nav {
        gap: 12px;
        margin-right: 8px;
    }
    .header-nav a {
        font-size: 14px;
    }
    .header-nav a.app-btn {
        padding: 4px 12px;
    }
}

/* Main Content */
main {
    padding: 80px 0 40px;
}

/* Hero Section */
.hero h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.hero .subtitle {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.hero .description {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 48px;
}

/* Section headings */
.section-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Announcements Section */
.announcements {
    margin-bottom: 48px;
}

.announcement-item {
    margin-bottom: 8px;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

.announcement-bullet {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.announcement-toggle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.announcement-item.active .announcement-toggle {
    transform: rotate(90deg);
}

.announcement-content {
    flex: 1;
}

.announcement-date {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.announcement-text {
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.5;
}

.announcement-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 20px;
}

.announcement-item.active .announcement-body {
    max-height: 500px;
}

.announcement-body p {
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 8px;
    margin-bottom: 12px;
}

.token-links {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.token-link {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
}

.token-link:last-child {
    border-bottom: none;
}

.token-link:hover {
    background: var(--bg-secondary);
}

/* FAQ Section */
.faq {
    margin-bottom: 48px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--text-secondary);
}

.faq-toggle {
    color: var(--text-secondary);
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(90deg);
}

.faq-question span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 16px;
    padding-left: 20px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.footer-social a:hover {
    color: var(--text-secondary);
}

.footer-social svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

.footer-copyright {
    color: var(--text-primary);
    font-size: 14px;
}

/* Page Header */
.page-header {
    padding: 60px 0 40px;
}

.page-header h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Content pages (Privacy, Terms, Cookies) */
.content {
    padding-bottom: 40px;
}

.content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.content ul, .content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content a {
    color: var(--accent);
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content strong {
    font-weight: 600;
}

/* Token pages */
.token-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.token-hero img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.token-hero h1 {
    font-size: 40px;
    font-weight: 700;
}

.token-info {
    margin-bottom: 48px;
}

.token-info p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.token-details {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.token-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.token-detail-row:last-child {
    border-bottom: none;
}

.token-detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.token-detail-value {
    font-weight: 600;
    font-size: 14px;
    word-break: break-all;
}

.token-detail-value a {
    color: var(--accent);
    text-decoration: none;
}

.token-detail-value a:hover {
    text-decoration: underline;
}

/* Contract diagram */
.contract-diagram {
    margin: 32px 0;
    text-align: center;
}

.contract-diagram img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* App page */
.app-hero {
    text-align: center;
    padding: 60px 0;
}

.app-hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.app-hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.app-screenshot {
    max-width: 100%;
    margin: 32px 0;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .app-screenshot {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.app-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 48px 0;
}

.app-feature {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 8px;
}

.app-feature h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.app-feature p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* 404 Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    text-align: center;
    padding: 40px 24px;
}

.error-content h1 {
    font-size: 120px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
}

.error-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.error-content a {
    display: inline-block;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.error-content a:hover {
    opacity: 0.8;
}

/* Token pages specific */
.page-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.token-logo {
    width: 108px;
    height: 108px;
    margin-bottom: 24px;
}

.token-diagram {
    width: 100%;
    max-width: 708px;
    margin: 24px 0;
}

.contract-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
    font-size: 14px;
}

.content code {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    display: inline-block;
}

/* Cookies page (soon) */
.soon-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.soon-text {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-secondary);
}
