/* ==========================================================================
   Convergence Protocol - Main Styles
   ========================================================================== */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --text: #334155;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--light);
    background: var(--dark) url('../assets/images/bg-hex-pattern.svg') repeat;
    overflow-x: hidden;
    padding-top: 60px;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.brand-logo img {
    height: 40px;
    width: auto;
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
}

nav a:hover {
    color: var(--primary);
}

nav a.cta-button {
    color: white;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    padding: 2rem;
    max-width: 1100px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.hero .subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 1.1rem;
}

.cta-button.primary {
    background: white;
    color: var(--primary);
}

.cta-button:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cta-button.primary:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px) scale(1.05);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ==========================================================================
   Container & Sections
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section {
    margin-bottom: 5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.125rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

h2 {
    color: var(--light);
}

p {
    color: var(--light);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Feature Cards & Grids
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text);
    line-height: 1.8;
}

/* ==========================================================================
   Journey Section
   ========================================================================== */

.journey-section {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.journey-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.journey-step {
    position: relative;
    padding: 2rem;
    background: var(--light);
    border-radius: 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.journey-step:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.step-number {
    position: absolute;
    top: -1rem;
    left: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.journey-step h4 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.journey-step p {
    color: var(--text);
    line-height: 1.7;
}

/* ==========================================================================
   Unlock Tiers & Preview
   ========================================================================== */

.tiers-preview {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: 24px;
    padding: 3rem;
    margin: 3rem 0;
}

.tier-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tier-card:hover {
    transform: translateX(10px);
    border-color: var(--primary);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
}

.tier-icon {
    font-size: 3rem;
    min-width: 80px;
    text-align: center;
}

.tier-content {
    flex: 1;
}

.tier-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.tier-cost {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tier-features {
    list-style: none;
    padding: 0;
}

.tier-features li {
    padding: 0.375rem 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-features li:before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* ==========================================================================
   CTA Banner
   ========================================================================== */

.cta-banner {
    background: var(--gradient);
    color: white;
    padding: 4rem 3rem;
    border-radius: 24px;
    text-align: center;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: drift 15s linear infinite;
}

.cta-banner-content {
    position: relative;
    z-index: 1;
}

.cta-banner h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-banner p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Unlock UI Components
   ========================================================================== */

.unlock-badge {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    border: 2px solid transparent;
}

.unlock-badge.locked {
    border-color: #e2e8f0;
    opacity: 0.9;
}

.unlock-badge.unlocked {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
}

.unlock-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
}

.badge-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.badge-content {
    flex: 1;
}

.badge-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.badge-cost {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-description {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
}

.badge-unlock-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.badge-unlock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.badge-unlock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.badge-unlocked {
    color: var(--success);
    font-weight: 700;
    font-size: 1.125rem;
    white-space: nowrap;
}

.unlock-progress {
    margin: 2rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.progress-stats {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* ==========================================================================
   Writings Page Styles
   ========================================================================== */

.writings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.writing-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.writing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.writing-card.locked {
    opacity: 0.8;
}

.card-header {
    padding: 2rem;
    background: var(--gradient);
    color: white;
    text-align: center;
    position: relative;
}

.card-header.parable {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

.lock-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.lock-badge.unlocked {
    background: var(--success);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-category {
    font-size: 0.875rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.5rem;
}

.card-description {
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

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

.read-time {
    font-size: 0.875rem;
    color: var(--text);
}

.read-button {
    padding: 0.75rem 1.5rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.read-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.unlock-status-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

.status-title h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.status-subtitle {
    color: var(--text);
    font-size: 0.95rem;
}

.unlock-actions {
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Content Card
   ========================================================================== */

.content-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    line-height: 1.8;
    color: var(--text);
}

.content-card p {
    margin-bottom: 1.5rem;
}

.content-card h2 {
    color: var(--dark);
    margin: 2rem 0 1rem;
}

.content-card h3 {
    color: var(--dark);
    margin: 1.5rem 0 0.75rem;
}

/* ==========================================================================
   Dashboard Styles
   ========================================================================== */

.banner {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

.token-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.token-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.token-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.token-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.token-card h3 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.token-card .balance {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    width: 100%;
    margin: 3rem 0;
}

.divider img {
    width: 100%;
    opacity: 0.3;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    animation: scaleIn 0.3s forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: #06b6d4;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover {
    color: #f8fafc;
}

.modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-section {
    margin-top: 1.5rem;
}

.modal-section h3 {
    font-size: 1rem;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    border-left: 3px solid #2563eb;
    padding-left: 0.75rem;
}

.modal-body ul,
.modal-body ol {
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body a {
    color: #7c3aed;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.modal-body a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 1rem 1.5rem;
    text-align: right;
    border-top: 1px solid #334155;
}

.modal-button {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-button:hover {
    opacity: 0.9;
}

.unlock-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    max-width: 500px;
    animation: scaleIn 0.3s forwards;
}

.unlock-success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.unlock-success h2 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.unlock-success-features {
    list-style: none;
    text-align: left;
    margin: 1.5rem 0;
}

.unlock-success-features li {
    padding: 0.5rem 0;
    color: var(--text);
}

.unlock-success-features li:before {
    content: '✓ ';
    color: var(--success);
    font-weight: 700;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        padding: 3rem 1.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    nav {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;
    }

    nav a {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }

    .hero {
        padding-top: 90px;
        min-height: auto;
        padding-bottom: 3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1.125rem;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .features-grid,
    .journey-steps {
        grid-template-columns: 1fr;
    }

    .tier-card {
        flex-direction: column;
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-button {
        width: 100%;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .writings-grid {
        grid-template-columns: 1fr;
    }

    .status-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .unlock-actions {
        flex-direction: column;
        width: 100%;
    }

    .unlock-actions button {
        width: 100%;
    }

    .token-container {
        grid-template-columns: 1fr;
    }

    .cta-banner {
        padding: 2rem 1.5rem;
    }

    .cta-banner h3 {
        font-size: 1.75rem;
    }

    .cta-banner p {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 2rem 1rem;
    }

    .feature-card,
    .journey-section,
    .content-card {
        padding: 1.5rem;
    }

    .hero-stats {
        gap: 1rem;
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}
