/* ModbusBB Website Styles - Matching Max Energic Apps Design */

:root {
    --bg: #0e1324;
    --fg: #ffffff;
    --muted: #b7bfda;
    --card: #161b33;
    --brand: #46B5FF;
    --accent: #00d4aa;
    --error: #ff6b6b;
    --warning: #ffa726;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: Inter, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
}

/* Navigation */
.navbar {
    background: rgba(14, 19, 36, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.navbar .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

.nav-links .btn-nav {
    background: var(--brand);
    color: #0b1020 !important;
    border-color: var(--brand);
    font-weight: 700;
}

.nav-links .btn-nav:hover {
    background: #5fc4ff;
    border-color: #5fc4ff;
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--brand);
    color: #0b1020;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(70,181,255,0.3);
    color: #0b1020;
}

.btn-secondary {
    background: var(--accent);
    color: #0b1020;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,212,170,0.3);
    color: #0b1020;
}

.btn-outline {
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
}

.btn-outline:hover {
    background: var(--brand);
    color: #0b1020;
}

/* Hero Section */
.hero {
    padding: 140px 0 80px;
    margin-top: 70px;
}

.hero .wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-content {
    display: grid;
    gap: 20px;
}

.badge {
    display: inline-block;
    background: rgba(70,181,255,0.15);
    color: var(--brand);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

.hero h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin: 0;
}

.hero .lead {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.trial-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-image img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow);
}

/* Section Styles */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2rem;
    margin: 0 0 16px;
    text-align: center;
}

.section-subtitle {
    color: var(--muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 32px;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(70,181,255,0.3);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--brand);
}

.feature-card p {
    color: var(--muted);
    margin: 0;
}

/* Comparison Table */
.comparison {
    padding: 80px 0;
}

.comparison-table {
    max-width: 800px;
    margin: 0 auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

.comparison-table th,
.comparison-table td {
    padding: 20px;
    text-align: center;
}

.comparison-table th {
    background: rgba(70,181,255,0.15);
    color: var(--brand);
    font-weight: 600;
}

.comparison-table th:first-child {
    text-align: left;
}

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

.comparison-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.comparison-table tr:hover {
    background: rgba(70,181,255,0.05);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #1a2444 0%, #0e1324 100%);
    border: 2px solid var(--brand);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    margin: 40px 0;
}

.cta h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.cta p {
    color: var(--muted);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    padding: 40px 0;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.footer-brand img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--muted);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    color: #666;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #1a2444 0%, #0e1324 100%);
    padding: 140px 0 60px;
    margin-top: 70px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--muted);
    font-size: 1.1rem;
}

/* Download Section */
.download-section {
    padding: 80px 0;
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.download-card {
    background: var(--card);
    border-radius: 18px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s;
}

.download-card:hover {
    border-color: rgba(70,181,255,0.3);
    transform: translateY(-4px);
}

.download-card.featured {
    border-color: var(--accent);
    position: relative;
}

.download-card.featured::before {
    content: 'RECOMMENDED';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #0b1020;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.download-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--brand);
}

.download-card .price {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.download-card .price-note {
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.download-card ul {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
}

.download-card li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-left: 28px;
    position: relative;
    color: var(--muted);
}

.download-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Buy Section */
.buy-section {
    padding: 80px 0;
}

.buy-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 18px;
    padding: 48px;
    border: 1px solid rgba(255,255,255,0.08);
}

.buy-container h2 {
    text-align: center;
    margin-bottom: 8px;
}

.buy-container .price-display {
    text-align: center;
    font-size: 3rem;
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 4px;
}

.buy-container .price-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 32px;
}

.buy-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: var(--fg);
}

.form-group input {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: rgba(255,255,255,0.05);
    color: var(--fg);
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand);
    background: rgba(70,181,255,0.1);
}

.form-group input::placeholder {
    color: var(--muted);
}

.form-group small {
    color: var(--muted);
    font-size: 0.85rem;
}

.buy-features {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.buy-features h4 {
    margin-bottom: 12px;
    color: var(--fg);
}

.buy-features ul {
    list-style: none;
}

.buy-features li {
    padding: 6px 0;
    color: var(--muted);
    padding-left: 24px;
    position: relative;
}

.buy-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
}

#paypal-button-container {
    margin-top: 20px;
}

.secure-note {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 20px;
}

.secure-note::before {
    content: "🔒 ";
}

/* Messages */
.message {
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.message.success {
    background: rgba(0,212,170,0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.message.error {
    background: rgba(255,107,107,0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Success Page */
.success-section {
    padding: 80px 0;
    text-align: center;
}

.success-icon {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.success-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--accent);
}

.license-box {
    background: var(--card);
    padding: 32px;
    border-radius: 14px;
    max-width: 500px;
    margin: 32px auto;
    border: 1px solid rgba(255,255,255,0.08);
}

.license-box h3 {
    margin-bottom: 12px;
}

.license-key {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand);
    background: rgba(70,181,255,0.1);
    padding: 16px;
    border-radius: 8px;
    border: 2px dashed var(--brand);
    letter-spacing: 2px;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid var(--brand);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Features Detail Page */
.features-detail {
    padding: 60px 0;
}

.feature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.feature-section.reverse {
    direction: rtl;
}

.feature-section.reverse > * {
    direction: ltr;
}

.feature-section:last-child {
    border-bottom: none;
}

.feature-content h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.feature-content p {
    color: var(--muted);
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: var(--muted);
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.feature-box {
    background: var(--card);
    padding: 28px;
    border-radius: 14px;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255,255,255,0.08);
}

.feature-box h4 {
    color: var(--brand);
    margin-bottom: 8px;
    font-family: Inter, system-ui, sans-serif;
}

.feature-box p {
    margin: 4px 0;
    color: var(--fg);
}

.feature-box hr {
    margin: 16px 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.function-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}

.fc-code {
    background: var(--brand);
    color: #0b1020;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: bold;
}

.data-formats .format-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
}

.data-formats .format-row:last-child {
    border-bottom: none;
}

.data-formats .format-row span:last-child {
    color: var(--brand);
}

.log-preview {
    font-size: 0.8rem;
}

.log-entry {
    padding: 6px 10px;
    margin: 4px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: var(--muted);
}

.log-entry.success {
    border-left: 3px solid var(--accent);
}

.log-entry.error {
    border-left: 3px solid var(--error);
    color: var(--error);
}

/* System Requirements */
.sys-req-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 48px auto 0;
}

.sys-req-card {
    background: var(--card);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
}

.sys-req-card h4 {
    color: var(--brand);
    margin-bottom: 8px;
}

.sys-req-card p {
    color: var(--muted);
    margin: 0;
}

/* Portable Section */
.portable-section {
    max-width: 600px;
    margin: 48px auto 0;
    text-align: center;
    background: var(--card);
    padding: 40px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
}

.portable-section h3 {
    margin-bottom: 12px;
}

.portable-section p {
    color: var(--muted);
    margin-bottom: 20px;
}

/* Back to Main Site Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--brand);
}

/* Download Note */
.download-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Featured Badge for Download Card */
.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #0b1020;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* System Requirements */
.system-requirements {
    max-width: 800px;
    margin: 60px auto 0;
    text-align: center;
}

.system-requirements h2 {
    margin-bottom: 30px;
}

.req-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.req-item {
    background: var(--card);
    padding: 25px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: left;
}

.req-item h4 {
    color: var(--brand);
    margin-bottom: 10px;
}

.req-item p {
    color: var(--muted);
    margin: 0;
}

/* Success Page Styles */
.success-header {
    background: linear-gradient(135deg, #1a442a 0%, #0e2418 100%) !important;
}

.success-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.success-message {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 24px;
}

.email-display {
    font-size: 1.3rem;
    color: var(--brand);
    font-weight: bold;
    margin: 0;
}

.next-steps {
    max-width: 500px;
    margin: 32px auto;
    text-align: left;
    background: var(--card);
    padding: 32px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
}

.next-steps h3 {
    margin-bottom: 20px;
}

.next-steps ol {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.next-steps li {
    padding: 8px 0;
}

.success-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.help-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.help-section h4 {
    color: var(--muted);
    margin-bottom: 8px;
}

.help-section p {
    color: #666;
}

.help-section a {
    color: var(--brand);
}

/* Legal Pages (Terms & Privacy) */
.legal-section {
    padding: 60px 0 80px;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card);
    padding: 48px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
}

.legal-content .last-updated {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.legal-content h2 {
    color: var(--brand);
    font-size: 1.4rem;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.legal-content h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.legal-content h3 {
    color: var(--fg);
    font-size: 1.1rem;
    margin-top: 24px;
    margin-bottom: 12px;
}

.legal-content p {
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.legal-content ul {
    list-style: none;
    margin: 16px 0;
    padding: 0;
}

.legal-content li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.legal-content li:last-child {
    border-bottom: none;
}

.legal-content li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--brand);
    font-weight: bold;
}

.legal-content a {
    color: var(--brand);
}

.legal-content a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .hero .wrap {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .hero .lead {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

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

    .download-cards {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .comparison-table {
        overflow-x: auto;
    }

    .feature-section {
        grid-template-columns: 1fr;
    }

    .feature-section.reverse {
        direction: ltr;
    }

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

    .sys-req-grid {
        grid-template-columns: 1fr;
    }

    .cta {
        padding: 40px 24px;
    }

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

    .success-buttons {
        flex-direction: column;
    }

    .legal-content {
        padding: 28px 20px;
    }

    .legal-content h2 {
        font-size: 1.2rem;
    }
}
