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

:root {
    --primary: #000000;
    --secondary: #ffffff;
    --accent: #6366f1;
    --accent-light: #8b5cf6;
    --accent-dark: #4f46e5;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Avenir', 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--primary);
    background: var(--secondary);
    overflow-x: hidden;
    padding-top: 80px; /* Space for fixed nav */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

/* App page simple italic brand using existing font */
.app-brand-italic {
    font-style: italic !important;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Increase specificity to avoid any override on app page */
.top-nav .nav-brand .app-brand-italic {
    font-style: italic !important;
    font-weight: 900 !important;
    font-size: 1.5rem !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.3s ease;
}

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

/* Special App CTA in top-right */
.nav-app-cta {
    padding: 10px 18px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-app-cta::after { /* disable underline transition for CTA */
    display: none;
}

.nav-app-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
}

@media (max-width: 768px) {
    .nav-app-cta {
        align-self: center;
        width: auto;
        margin-top: 8px;
    }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Bottom Navigation / Footer */
.bottom-nav {
    background: var(--gray-900);
    color: var(--secondary);
    padding: 36px 0 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    margin-bottom: 24px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.footer-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin: 0;
    white-space: nowrap;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    justify-content: end;
    justify-items: end;
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--secondary);
}

.footer-link {
    display: block;
    color: var(--gray-400);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: 16px 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--gray-500);
    margin: 0;
    font-size: 0.875rem;
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #f59e0b, #ef4444);
    top: 60%;
    right: 20%;
    animation-delay: 2s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #10b981, #06b6d4);
    bottom: 20%;
    left: 60%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-section .container {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--secondary);
}

.logo-container {
    margin-bottom: 48px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: 24px;
}

.title-line {
    display: block;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.title-subtitle {
    display: block;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 500;
    margin-top: 16px;
    opacity: 0.9;
    letter-spacing: 0.05em;
}

.hero-description {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    line-height: 1.6;
    margin-bottom: 32px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.code-showcase {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    margin: 12px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.code-title {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
}

.code-block {
    background: #1a1a1a;
    border-radius: var(--border-radius);
    padding: 12px;
    overflow: hidden;
    border: 1px solid #333;
}

.code-block pre {
    margin: 0;
    color: #e5e7eb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 15;
    line-clamp: 15;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.code-block code {
    color: #e5e7eb;
}

.cta-section {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

.primary-btn, .secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: var(--secondary);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.primary-btn:hover::before {
    left: 100%;
}

.secondary-btn {
    background: transparent;
    color: var(--secondary);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Principles Section */
.principles-section {
    padding: 64px 0;
    background: var(--secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* Enhanced app page title */
.app-title {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: relative;
}

.app-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.app-subtitle {
    opacity: 0.8;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.principle-card {
    background: var(--secondary);
    padding: 28px 22px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.principle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.principle-card:hover::before {
    transform: scaleX(1);
}

.principle-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--secondary);
}

.principle-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.principle-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

.workflow-section {
    background: var(--gray-50);
    padding: 32px 24px;
    border-radius: var(--border-radius-lg);
    margin-top: 24px;
}

.workflow-section h3 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary);
}

.workflow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--secondary);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    flex: 1;
    min-width: 280px;
    max-width: 360px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.step-content p {
    color: var(--gray-600);
    line-height: 1.5;
}

.workflow-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 1px;
    flex-shrink: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--secondary);
    margin: 5% auto;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.modal-body {
    padding: 32px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.app-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.token-form-section, .token-list-section {
    background: var(--gray-50);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
}

.token-form-section h3, .token-list-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--secondary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.create-token-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--secondary);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-token-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.token-list {
    max-height: 400px;
    overflow-y: auto;
}

.token-item {
    background: var(--secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.token-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.token-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
}

.token-item p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.token-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.token-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-launch {
    background: var(--success);
    color: var(--secondary);
}

.btn-edit {
    background: var(--accent);
    color: var(--secondary);
}

.btn-delete {
    background: var(--error);
    color: var(--secondary);
}

.token-actions button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    /* Navigation Mobile */
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        width: 100%;
        text-align: center;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Footer Mobile */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 16px;
    }
    
    .footer-brand {
        max-width: 100%;
    }
    
    .footer-tagline {
        white-space: normal;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 32px;
        justify-content: start;
        justify-items: start;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .code-showcase {
        padding: 24px;
        margin: 32px 0;
    }
    
    .code-block {
        padding: 16px;
    }
    
    .code-block pre {
        font-size: 12px;
    }
    
    .cta-section {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .principles-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .workflow-steps {
        flex-direction: column;
    }
    
    .workflow-step {
        flex-direction: column;
        text-align: center;
        min-width: auto;
    }
    
    .workflow-connector {
        width: 2px;
        height: 40px;
        background: linear-gradient(180deg, var(--accent), var(--accent-light));
    }
    
    .app-interface {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .token-form-section, .token-list-section {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .code-showcase {
        padding: 20px;
    }
    
    .principle-card {
        padding: 32px 24px;
    }
    
    .workflow-section {
        padding: 48px 24px;
    }
    
    .workflow-step {
        padding: 24px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .token-form-section, .token-list-section {
        padding: 20px;
    }
    
    .footer-container {
        padding: 0 16px;
        gap: 24px;
    }
    
    .bottom-nav {
        padding: 24px 0 0;
    }
    
    .footer-column h4 {
        font-size: 0.9375rem;
    }
    
    .footer-link {
        font-size: 0.875rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========================================
   Swimlane Diagram Styles
   ======================================== */

/* CSS Variables for Light/Dark Theme */
.swimlane-section {
    --swim-bg-light: #F8FAFC;
    --swim-bg-dark: #0F172A;
    --swim-primary: #0EA5E9;
    --swim-primary-hover: #0284C7;
    --swim-secondary: #64748B;
    --swim-secondary-hover: #475569;
    --swim-card-light: #FFFFFF;
    --swim-card-dark: #1E293B;
    --swim-text-primary-light: #1E293B;
    --swim-text-primary-dark: #F1F5F9;
    --swim-text-secondary-light: #475569;
    --swim-text-secondary-dark: #CBD5E1;
    --swim-header-light: #1E293B;
    --swim-header-dark: #1E293B;
    --swim-border-light: rgba(30, 41, 59, 0.1);
    --swim-border-dark: rgba(241, 245, 249, 0.1);
    --swim-lifeline-light: rgba(30, 41, 59, 0.08);
    --swim-lifeline-dark: rgba(241, 245, 249, 0.08);
    --swim-shadow-light: rgba(30, 41, 59, 0.08);
    --swim-shadow-dark: rgba(0, 0, 0, 0.3);
}

/* Light theme (default) */
.swimlane-section {
    background-color: var(--swim-bg_light, var(--swim-bg-light)) !important;
    padding: 24px 0 8px; /* further reduce top/bottom whitespace */
}

/* Dark theme override - use light background */
@media (prefers-color-scheme: dark) {
    .swimlane-section {
        background-color: var(--swim-bg-light) !important;
    }
}

.swimlane-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 0 0; /* even tighter inner spacing */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.swimlane-wrapper::-webkit-scrollbar {
    height: 8px;
}

.swimlane-wrapper::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.swimlane-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.swimlane-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Compact header spacing only for this section */
.swimlane-section .section-header {
    margin-bottom: 8px;
}

/* Prevent line wrapping for swimlane subtitle */
.swimlane-section .section-subtitle {
    white-space: nowrap;
    display: block;
    max-width: none;
    width: auto;
    margin: 0 auto;
    text-align: center;
}

.swimlane-diagram {
    width: 100%;
    height: auto;
    min-height: 600px;
    max-width: 100%;
}

/* Mobile: maintain full width for horizontal scrolling */
@media (max-width: 768px) {
    .swimlane-section {
        padding: 16px 0 4px; /* Reduced top/bottom spacing on mobile */
    }
    
    .swimlane-section .container {
        padding: 0 16px; /* Keep padding for header */
    }
    
    .swimlane-section .section-header {
        padding: 0;
        margin-bottom: 4px; /* Reduced margin on mobile */
    }
    
    .swimlane-wrapper {
        margin: 0 -16px; /* Extend wrapper to edges for full-width scroll */
        padding: 2px 16px 0; /* Reduced padding on mobile */
        width: calc(100% + 32px); /* Compensate for negative margin */
    }
    
    .swimlane-diagram {
        width: 1500px; /* Full diagram width based on viewBox */
        min-width: 1500px;
        max-width: none;
    }
}

/* Lane Headers */
.swimlane-diagram .lane-header {
    fill: #1E293B;
    stroke: rgba(30, 41, 59, 0.15);
    stroke-width: 1;
    filter: drop-shadow(0 1px 2px var(--swim-shadow-light));
}

.swimlane-diagram .lane-header-text {
    fill: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    text-anchor: middle;
    letter-spacing: -0.2px;
}

/* Lifelines */
.swimlane-diagram .lifeline {
    stroke: rgba(30, 41, 59, 0.18);
    stroke-width: 1.5;
    stroke-dasharray: 6 8;
}

/* Arrow Markers */
.swimlane-diagram .arrow-primary {
    fill: var(--swim-primary);
}

.swimlane-diagram .arrow-secondary {
    fill: var(--swim-secondary);
}

/* Arrow Lines */
.swimlane-diagram .arrow-primary-line {
    stroke: var(--swim-primary);
    stroke-width: 2;
    fill: none;
    z-index: 1;
}

.swimlane-diagram .arrow-secondary-line {
    stroke: var(--swim-secondary);
    stroke-width: 2;
    fill: none;
    z-index: 1;
}

/* Message Bubbles */
.swimlane-diagram .message-bubble {
    fill: #FFFFFF;
    stroke: rgba(30, 41, 59, 0.1);
    stroke-width: 1;
    filter: drop-shadow(0 1px 3px rgba(30, 41, 59, 0.08));
    z-index: 2;
}

/* Number Badge */
.swimlane-diagram .badge-number {
    fill: var(--swim-primary);
    stroke: none;
}

.swimlane-diagram .badge-text {
    fill: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
}

.swimlane-diagram .badge-self-action {
    fill: var(--swim-secondary);
    font-size: 10px;
    font-weight: 500;
}

/* Message Text */
.swimlane-diagram .message-direction {
    fill: #1E293B;
    font-size: 14px;
    font-weight: 600;
    text-anchor: start;
}

.swimlane-diagram .message-desc {
    fill: #475569;
    font-size: 13px;
    font-weight: 400;
    text-anchor: middle;
    line-height: 1.4;
}

/* Notes Section */
.swimlane-diagram .notes-box {
    fill: #F1F5F9;
    stroke: rgba(30, 41, 59, 0.1);
    stroke-width: 1;
    filter: drop-shadow(0 1px 2px rgba(30, 41, 59, 0.08));
}

.swimlane-diagram .notes-title {
    fill: #0EA5E9;
    font-size: 14px;
    font-weight: 700;
}

.swimlane-diagram .notes-item {
    fill: #475569;
    font-size: 13px;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 1279px) {
    .swimlane-diagram {
        min-height: 700px;
    }
}

@media (max-width: 767px) {
    .swimlane-diagram {
        min-height: 900px;
        width: 1500px !important; /* Ensure full width on mobile */
        min-width: 1500px !important;
        max-width: none !important;
    }
    
    .swimlane-diagram .message-direction {
        font-size: 13px;
    }
    
    .swimlane-diagram .message-desc {
        font-size: 12px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .swimlane-section {
        padding: 12px 0 2px; /* Even smaller spacing on extra small screens */
    }
    
    .swimlane-section .section-header {
        margin-bottom: 2px; /* Minimal margin */
    }
    
    .swimlane-wrapper {
        margin: 0 -16px;
        width: calc(100% + 32px);
        padding: 0 16px 0; /* Minimal padding */
    }
    
    .swimlane-diagram {
        width: 1500px !important;
        min-width: 1500px !important;
    }
}

/* Accessibility */
.swimlane-diagram .step-bubble {
    cursor: pointer;
    outline: none;
}

.swimlane-diagram .step-bubble:focus {
    outline: 2px solid var(--swim-primary);
    outline-offset: 4px;
}

/* Ensure minimum font size for readability */
.swimlane-diagram text {
    font-size: clamp(13px, 1vw, 16px);
}