/* =========================================================
   ClusterOne Website — Modern Dark Theme
   ========================================================= */

:root {
    --co-primary: #6366f1;
    --co-primary-light: #818cf8;
    --co-primary-dark: #4f46e5;
    --co-bg: #0a0a0f;
    --co-bg-card: #111118;
    --co-bg-elevated: #16161f;
    --co-border: rgba(255, 255, 255, 0.08);
    --co-text: #e4e4e7;
    --co-text-muted: #71717a;
    --co-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --co-glow: rgba(99, 102, 241, 0.15);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--co-bg);
    color: var(--co-text);
}

/* ---- Navbar ---- */
.navbar-blur {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--co-border);
    padding: 0.75rem 0;
    z-index: 1050;
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

/* ---- Text Gradient ---- */
.text-gradient {
    background: var(--co-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fw-800 { font-weight: 800; }

/* ---- Hero ---- */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--co-glow), transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

.hero-title {
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* ---- Terminal Card ---- */
.hero-terminal {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: var(--co-bg-elevated);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--co-border);
}

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

.terminal-title {
    margin-left: 8px;
    font-size: 0.8rem;
    color: var(--co-text-muted);
}

.terminal-body {
    padding: 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 2px;
}

.terminal-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    height: 20px;
    margin-bottom: 10px;
    overflow: hidden;
}

.terminal-bar-fill {
    background: var(--co-primary);
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.7rem;
    color: white;
    transition: width 1s ease;
}

/* ---- Sections ---- */
.py-6 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.mb-6 {
    margin-bottom: 5rem;
}

.mt-6 {
    margin-top: 5rem;
}

.bg-dark-subtle {
    background-color: var(--co-bg-card) !important;
}

/* ---- Page Header ---- */
.page-header {
    padding-top: 120px;
    padding-bottom: 3rem;
    background: linear-gradient(180deg, var(--co-bg-card) 0%, var(--co-bg) 100%);
}

/* ---- Feature Cards ---- */
.feature-card {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 12px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--co-primary);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--co-glow);
    border-radius: 10px;
    font-size: 1.25rem;
    color: var(--co-primary-light);
    margin-bottom: 1rem;
}

.feature-list-item {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.feature-list-item i {
    margin-right: 0.5rem;
}

/* ---- Feature Preview ---- */
.feature-preview {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.preview-card {
    background: var(--co-bg-elevated);
    border: 1px solid var(--co-border);
    border-radius: 8px;
    padding: 1.25rem;
}

/* ---- Pricing Cards ---- */
.pricing-card {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-highlight {
    border-color: var(--co-primary);
    box-shadow: 0 0 40px var(--co-glow);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--co-gradient);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-amount {
    margin: 1.5rem 0;
}

.pricing-features {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

/* ---- Auth ---- */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    padding-bottom: 2rem;
}

.auth-card {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 16px;
    padding: 2.5rem;
}

.portal-select-btn {
    background: transparent;
    border: 1px solid var(--co-border);
    color: var(--co-text-muted);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.portal-select-btn:hover {
    color: var(--co-text);
    border-color: var(--co-primary);
}

.portal-select-btn.active {
    background: var(--co-primary);
    border-color: var(--co-primary);
    color: #fff;
}

/* ---- Pricing Toggles ---- */
.pricing-toggle {
    display: inline-flex;
    border: 1px solid var(--co-primary);
    border-radius: 8px;
    overflow: hidden;
}

.pricing-toggle-btn {
    background: transparent;
    border: none;
    color: var(--co-primary-light);
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pricing-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.15);
}

.pricing-toggle-btn.active {
    background: var(--co-primary);
    color: white;
}

.pricing-toggle-btn + .pricing-toggle-btn {
    border-left: 1px solid var(--co-primary);
}

/* ---- Portal ---- */
.portal-section {
    padding-top: 80px;
    min-height: 100vh;
}

.portal-sidebar {
    background: var(--co-bg-card);
    border-right: 1px solid var(--co-border);
    min-height: calc(100vh - 80px);
    padding-top: 2rem;
}

.sidebar-content {
    padding: 0 1rem;
    position: sticky;
    top: 100px;
}

.portal-nav .nav-link {
    color: var(--co-text-muted);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.portal-nav .nav-link:hover {
    color: var(--co-text);
    background: rgba(255, 255, 255, 0.05);
}

.portal-nav .nav-link.active {
    color: white;
    background: var(--co-primary);
}

.portal-main {
    padding: 2rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ---- License Key Display ---- */
.license-key-display {
    display: flex;
    align-items: center;
    background: var(--co-bg-elevated);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--co-border);
    margin-top: 0.5rem;
}

.license-key-display code {
    font-size: 0.85rem;
    word-break: break-all;
    flex-grow: 1;
}

/* ---- Code Block ---- */
.code-block {
    background: var(--co-bg-elevated);
    border: 1px solid var(--co-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a5f3fc;
    white-space: pre;
}

/* ---- Tech Badges ---- */
.tech-badge {
    background: var(--co-bg-elevated);
    border: 1px solid var(--co-border);
    border-radius: 8px;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tech-badge:hover {
    border-color: var(--co-primary);
    transform: translateY(-2px);
}

/* ---- Doc Sidebar ---- */
.doc-sidebar {
    background: var(--co-bg-card);
    border: 1px solid var(--co-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
    max-width: 400px;
}

.flash-container .alert {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--co-border);
}

/* ---- Footer ---- */
.footer-section {
    background: var(--co-bg-card);
    border-top: 1px solid var(--co-border);
    padding: 4rem 0 2rem;
    margin-top: 0;
}

.footer-links a {
    color: var(--co-text-muted);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--co-primary-light);
}

/* ---- Bootstrap Overrides ---- */
.btn-primary {
    background: var(--co-primary);
    border-color: var(--co-primary);
}

.btn-primary:hover {
    background: var(--co-primary-dark);
    border-color: var(--co-primary-dark);
}

.btn-outline-primary {
    color: var(--co-primary-light);
    border-color: var(--co-primary);
}

.btn-outline-primary:hover {
    background: var(--co-primary);
    border-color: var(--co-primary);
    color: white;
}

.text-primary {
    color: var(--co-primary-light) !important;
}

.bg-primary {
    background-color: var(--co-primary) !important;
}

.form-control {
    background: var(--co-bg-elevated);
    border-color: var(--co-border);
    color: var(--co-text);
}

.form-control:focus {
    background: var(--co-bg-elevated);
    border-color: var(--co-primary);
    color: var(--co-text);
    box-shadow: 0 0 0 0.25rem var(--co-glow);
}

.form-control::placeholder {
    color: var(--co-text-muted);
}

.card {
    border-radius: 12px;
}

.table-dark {
    --bs-table-bg: transparent;
}

.accordion-button:focus {
    box-shadow: none;
}

.accordion-button::after {
    filter: invert(1);
}

.progress {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .portal-sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--co-border);
        padding-bottom: 1rem;
    }

    .sidebar-content {
        position: static;
    }

    .portal-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .portal-nav .nav-item {
        flex-grow: 1;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.pricing-card,
.auth-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Stagger animations */
.row .col-md-6:nth-child(2) .feature-card,
.row .col-lg-4:nth-child(2) .feature-card,
.row .col-lg-4:nth-child(2) .pricing-card {
    animation-delay: 0.1s;
}

.row .col-md-6:nth-child(3) .feature-card,
.row .col-lg-4:nth-child(3) .feature-card,
.row .col-lg-4:nth-child(3) .pricing-card {
    animation-delay: 0.2s;
}

.row .col-lg-4:nth-child(4) .feature-card { animation-delay: 0.15s; }
.row .col-lg-4:nth-child(5) .feature-card { animation-delay: 0.2s; }
.row .col-lg-4:nth-child(6) .feature-card { animation-delay: 0.25s; }
