/* ========================================
   COMPONENTS
   Buttons, Cards, Badges, Terminal, Forms
   ======================================== */

/* ----------------------------------------
   Buttons
   ---------------------------------------- */

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 100%);
    color: var(--bg);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.3);
    color: var(--bg);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--text-dim);
    color: var(--text);
}

/* CLI Theme - Buttons */
[data-theme="cli"] .btn-primary {
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}

[data-theme="cli"] .btn-primary:hover {
    background: var(--cyan);
    color: var(--bg);
    text-shadow: none;
    box-shadow: 0 0 30px var(--cyan);
}

[data-theme="cli"] .btn-secondary {
    border-color: var(--cyan);
    color: var(--cyan);
}

[data-theme="cli"] .btn-secondary:hover {
    background: rgba(0, 255, 159, 0.1);
}

/* ----------------------------------------
   Badge
   ---------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: var(--cyan);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.badge svg {
    width: 16px;
    height: 16px;
}

/* CLI Theme - Badge */
[data-theme="cli"] .badge {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}

/* ----------------------------------------
   Install Command Box
   ---------------------------------------- */

.install-box {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.install-box code {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-box .prompt {
    color: var(--cyan);
}

/* CLI Theme - Install Box Enhancement */
[data-theme="cli"] .install-box {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--cyan);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.2), inset 0 0 20px rgba(0, 255, 159, 0.05);
}

[data-theme="cli"] .install-box::before {
    content: 'root@server:~#';
    position: absolute;
    top: -1.5rem;
    left: 0;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ----------------------------------------
   Copy Button
   ---------------------------------------- */

.copy-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--bg-card);
    color: var(--text);
}

.copy-btn.copied {
    color: var(--green);
    border-color: var(--green);
}

.copy-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* CLI Theme - Copy Button */
[data-theme="cli"] .copy-btn {
    border-color: var(--cyan);
    color: var(--cyan);
}

[data-theme="cli"] .copy-btn:hover {
    background: var(--cyan);
    color: var(--bg);
}

/* ----------------------------------------
   Toast Notification
   ---------------------------------------- */

.toast {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-elevated);
    border: 1px solid var(--green);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast svg {
    width: 18px;
    height: 18px;
    color: var(--green);
}

/* ----------------------------------------
   Trust Badges
   ---------------------------------------- */

.trust-badges {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-badges svg {
    width: 16px;
    height: 16px;
    color: var(--green);
}

/* CLI Theme - Trust Badges */
[data-theme="cli"] .trust-badges span {
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    font-family: var(--font-mono);
}

[data-theme="cli"] .trust-badges svg {
    color: var(--green);
    filter: drop-shadow(0 0 3px var(--green));
}

/* ----------------------------------------
   Feature Cards
   ---------------------------------------- */

.feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.feature-card:hover {
    border-color: var(--cyan);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(0, 217, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* CLI Theme - Feature Cards */
[data-theme="cli"] .feature-card {
    border: 1px solid var(--cyan);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.2), inset 0 0 20px rgba(0, 255, 159, 0.05);
}

[data-theme="cli"] .feature-card:hover {
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.4), inset 0 0 30px rgba(0, 255, 159, 0.1);
}

[data-theme="cli"] .feature-icon {
    background: transparent;
    border: 1px solid var(--cyan);
    filter: grayscale(1) brightness(2);
}

/* ----------------------------------------
   Pricing Cards
   ---------------------------------------- */

.pricing-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    position: relative;
}

.pricing-card:hover {
    border-color: var(--cyan);
}

.pricing-card.featured {
    border-color: var(--cyan);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 100%);
    color: var(--bg);
    padding: 0.25rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.pricing-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pricing-amount {
    font-size: 3rem;
    font-weight: 800;
}

.pricing-period {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pricing-features li svg {
    color: var(--green);
    flex-shrink: 0;
}

.pricing-card .btn {
    width: 100%;
    justify-content: center;
}

/* CLI Theme - Pricing Cards */
[data-theme="cli"] .pricing-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cyan);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.2), inset 0 0 20px rgba(0, 255, 159, 0.05);
}

[data-theme="cli"] .pricing-card:hover {
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.4), inset 0 0 30px rgba(0, 255, 159, 0.1);
}

[data-theme="cli"] .pricing-card::before {
    content: 'LICENSE.TXT';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.6rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

[data-theme="cli"] .pricing-badge {
    background: var(--cyan);
    color: var(--bg);
    text-shadow: none;
}

[data-theme="cli"] .pricing-name {
    font-family: var(--font-mono);
}

[data-theme="cli"] .pricing-name::before {
    content: ':: ';
    color: var(--cyan);
}

[data-theme="cli"] .pricing-features li::before {
    content: '[x] ';
    color: var(--green);
    font-family: var(--font-mono);
}

[data-theme="cli"] .pricing-features li svg {
    display: none;
}

/* ----------------------------------------
   Terminal
   ---------------------------------------- */

.terminal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 800px;
    margin: 3rem auto 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 0.25rem;
}

.terminal-prompt {
    color: var(--cyan);
}

.terminal-command {
    color: var(--text);
}

.terminal-success {
    color: var(--green);
}

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

.terminal-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.terminal-box-title {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.terminal-progress {
    color: var(--cyan);
    letter-spacing: 0.2em;
}

/* CLI Theme - Terminal */
[data-theme="cli"] .terminal {
    border: 1px solid var(--cyan);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.2), inset 0 0 20px rgba(0, 255, 159, 0.05);
}

[data-theme="cli"] .terminal-dot.red { background: #ff0000; box-shadow: 0 0 5px #ff0000; }
[data-theme="cli"] .terminal-dot.yellow { background: #ffff00; box-shadow: 0 0 5px #ffff00; }
[data-theme="cli"] .terminal-dot.green { background: #00ff00; box-shadow: 0 0 5px #00ff00; }

/* ----------------------------------------
   Config Block
   ---------------------------------------- */

.config-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 700px;
    margin: 2rem auto 0;
    overflow: hidden;
}

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

.config-filename {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.config-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    overflow-x: auto;
}

.config-body pre {
    margin: 0;
    white-space: pre;
}

.yaml-comment {
    color: var(--text-dim);
}

.yaml-key {
    color: var(--cyan);
}

.yaml-value {
    color: var(--text);
}

.yaml-var {
    color: var(--yellow);
}

.config-caption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* CLI Theme - Config Block */
[data-theme="cli"] .config-block {
    position: relative;
    border: 1px solid var(--cyan);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.2), inset 0 0 20px rgba(0, 255, 159, 0.05);
}

[data-theme="cli"] .config-header {
    background: var(--bg);
    border-bottom-color: var(--cyan);
}

[data-theme="cli"] .yaml-key {
    color: var(--cyan);
    text-shadow: 0 0 5px var(--cyan);
}

[data-theme="cli"] .yaml-var {
    color: var(--yellow);
    text-shadow: 0 0 5px var(--yellow);
}

/* ----------------------------------------
   Comparison Table
   ---------------------------------------- */

.comparison-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.comparison-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr {
    background: var(--bg);
    transition: background 0.2s;
}

.comparison-table tbody tr:hover {
    background: var(--bg-elevated);
}

.comparison-table .highlight {
    background: rgba(0, 217, 255, 0.05);
}

.comparison-table .highlight th {
    color: var(--cyan);
    position: relative;
}

.comparison-table .check {
    color: var(--green);
    font-weight: 600;
}

.comparison-table .cross {
    color: var(--text-dim);
}

.comparison-table .price-cell {
    font-size: 0.85rem;
}

.comparison-table .price-cell .our-price {
    color: var(--green);
    font-weight: 600;
}

.comparison-table .price-cell .recurring {
    color: var(--text-dim);
}

.comparison-table .price-cell .free-tag {
    color: var(--cyan);
    font-weight: 600;
}

/* CLI Theme - Table */
[data-theme="cli"] .comparison-wrapper {
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.2);
}

[data-theme="cli"] .comparison-table th,
[data-theme="cli"] .comparison-table td {
    border-color: var(--cyan);
}

[data-theme="cli"] .comparison-table .highlight {
    background: rgba(0, 255, 159, 0.1);
}

[data-theme="cli"] .comparison-table .check {
    text-shadow: 0 0 10px var(--green);
}

[data-theme="cli"] .comparison-table .cross {
    color: var(--red);
    text-shadow: 0 0 5px var(--red);
}

/* ----------------------------------------
   FAQ
   ---------------------------------------- */

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

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-display);
}

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

.faq-icon {
    font-size: 1.5rem;
    color: var(--text-dim);
    transition: transform 0.3s;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

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

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-bottom: 1.5rem;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* CLI Theme - FAQ */
[data-theme="cli"] .faq-item {
    border-color: var(--border);
}

[data-theme="cli"] .faq-question::before {
    content: '$ ';
    color: var(--cyan);
}

[data-theme="cli"] .faq-answer p::before {
    content: '  > ';
    color: var(--text-dim);
}

/* ----------------------------------------
   ASCII Art Container
   ---------------------------------------- */

/* ASCII Art Logo (PNG) */
.ascii-art {
    display: none;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 0 10px var(--cyan)) drop-shadow(0 0 20px var(--cyan));
}

[data-theme="cli"] .ascii-art {
    display: block;
}

/* ----------------------------------------
   Responsive Component Adjustments
   ---------------------------------------- */

@media (max-width: 768px) {
    .comparison-wrapper {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .install-box {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        max-width: 100%;
    }

    .install-box code {
        font-size: 0.75rem;
        white-space: normal;
        word-break: break-all;
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .install-box .copy-btn {
        width: 100%;
        padding: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    [data-theme="cli"] .ascii-art {
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
    }

    .install-box {
        padding: 0.75rem;
        border-radius: var(--radius-sm);
    }

    .install-box code {
        font-size: 0.7rem;
        line-height: 1.5;
    }

    [data-theme="cli"] .ascii-art {
        max-width: 280px;
    }
}
