﻿/* ============================================
   TradeXil - Base & Shared Styles
   Modular CSS Architecture
   
   This file contains:
   - CSS Variables
   - Reset & Base Styles
   - Container & Layout
   - Navigation
   - Footer
   - Buttons
   - Badges
   - Info Boxes
   - Page Headers
   - Animations
   - Responsive Design
   
   Page-specific styles are in /css/pages/
   ============================================ */

/* ============================================
   CSS Variables
   ============================================ */

:root {
    /* Color Palette */
    --bg-primary: #101418;
    --bg-surface: #161b20;
    --accent-ice: #a2cfff;
    --accent-slate: #6b7688;
    --text-primary: #f3f3f3;
    --text-secondary: #b8bcc8;
    --border-color: #1e242a;
    --hover-glow: rgba(162, 207, 255, 0.1);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-headings: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(16, 20, 24, 0.9);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: var(--spacing-lg);
}

.nav-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: var(--spacing-md);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 0 0 auto;
}

.logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-ice);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Desktop Menu */
.nav-menu-desktop {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--spacing-xs) var(--spacing-sm);
    display: block;
    white-space: nowrap;
}

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

.nav-divider {
    color: var(--border-color);
    font-weight: 300;
    opacity: 0.5;
}

/* Auth Section */
.nav-auth-desktop {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.nav-link-login {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--spacing-xs) var(--spacing-sm);
    white-space: nowrap;
}

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

/* Custom nav button size */
.btn-nav {
    padding: 5px 14px;
    font-size: 13px;
    height: auto;
    display: inline-block;
}

.btn-nav-small {
    padding: 4px 12px !important;
    font-size: 13px;
    height: auto;
    display: inline-block;
    line-height: 1.4;
    min-height: auto;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.nav-dropdown-trigger:hover {
    color: var(--accent-ice);
}

.nav-dropdown-trigger.active {
    color: var(--accent-ice);
}

.nav-dropdown-trigger svg {
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: fixed;
    top: calc(56px + 8px);
    left: 50%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transform: translateX(-50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

/* Grid layout for products dropdown */
.nav-dropdown-menu-grid {
    min-width: 840px;
}

.nav-dropdown-menu-grid .nav-dropdown-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
}

.nav-dropdown-column {
    padding: 12px 16px;
    /* no default right border — only the core column shows a divider */
    border-right: none;
}

/* Put a single divider between Core and the rest */
.nav-dropdown-core {
    border-right: 1px solid var(--border-color);
}

.nav-dropdown-column:last-child {
    border-right: none;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-content {
    padding: 8px;
}

.nav-dropdown-item {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
    text-decoration: none;
}

.nav-dropdown-item:hover {
    background-color: var(--hover-glow);
}

.nav-dropdown-section {
    padding: 8px 0;
}

.nav-dropdown-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.nav-section-label {
    padding: 8px 16px 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.nav-item-content {
    width: 100%;
}

.nav-item-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.badge-dev {
    display: inline-block;
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffb347;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Mobile Toggle Button */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    z-index: 1002;
    position: relative;
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--accent-ice);
    transition: all var(--transition-smooth);
    border-radius: 1px;
}

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

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

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

/* Mobile Menu */
.nav-menu-mobile {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-surface);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 998;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.nav-menu-mobile.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.nav-mobile-section {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: block;
}

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

.nav-mobile-section-inline {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.nav-mobile-section-inline .nav-mobile-link {
    flex: 1;
    text-align: center;
    padding: var(--spacing-sm);
}

/* Mobile: make buttons align exactly with links (full width inside padded section) */
.nav-menu-mobile .btn,
.nav-menu-mobile .btn-nav-small {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    /* match link vertical padding for visual alignment */
    padding: calc(var(--spacing-sm) + 2px) var(--spacing-sm);
}

.nav-menu-mobile .btn {
    text-align: center;
}

/* Make the "Log In" link match Sign Up spacing/alignment on mobile */
.nav-menu-mobile .nav-mobile-link.nav-mobile-auth {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 var(--spacing-sm) 0;
    padding: calc(var(--spacing-sm) + 2px) var(--spacing-sm);
    text-align: center;
}

.nav-mobile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.nav-mobile-link {
    display: block;
    padding: var(--spacing-sm) 0;
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
    color: var(--accent-ice);
}

.nav-mobile-auth {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.nav-mobile-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-center {
        display: none !important;
    }

    .nav-menu-desktop {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .nav-auth-desktop {
        display: none;
    }

    .nav-left {
        flex: 0 0 auto;
    }

    .nav-right {
        flex: 0 0 auto;
    }

    .nav-wrapper {
        height: 56px;
        gap: 0;
    }

    .nav-menu-mobile {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: none;
        border-radius: 0;
    }

    /* Make dropdown grid responsive */
    .nav-dropdown-menu-grid {
        min-width: auto !important;
        left: auto !important;
        right: 0;
        transform: translateX(0) !important;
    }

    .nav-dropdown-menu-grid .nav-dropdown-content {
        grid-template-columns: 1fr;
    }

    .nav-dropdown-column {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
    }

    .nav-dropdown-column:last-child {
        border-bottom: none;
    }
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-family: var(--font-headings);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-ice);
    margin-bottom: var(--spacing-xs);
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

.footer-heading {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer .footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* slightly larger than 4px for better readability */
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-ice);
}

.footer-bottom {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }

    .footer-section:first-child {
        grid-column: 1 / -1;
    }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Ensure footer link lists are vertical by default (consistent spacing) */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-ice);
}

.footer-copyright {
    color: var(--accent-slate);
    font-size: 0.875rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

.btn-primary {
    background-color: var(--accent-ice);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background-color: #b8dcff;
    box-shadow: 0 4px 12px rgba(162, 207, 255, 0.15);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-ice);
    border: 2px solid var(--accent-ice);
}

.btn-secondary:hover {
    background-color: rgba(162, 207, 255, 0.05);
    box-shadow: 0 2px 8px rgba(162, 207, 255, 0.1);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}

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

.btn-link {
    background: transparent;
    color: var(--accent-ice);
    border: 1px solid rgba(162, 207, 255, 0.3);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
}

.btn-link:hover {
    background: rgba(162, 207, 255, 0.1);
    border-color: var(--accent-ice);
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-free {
    background-color: rgba(162, 207, 255, 0.2);
    color: var(--accent-ice);
}

.badge-soon {
    background-color: rgba(107, 118, 136, 0.2);
    color: var(--accent-slate);
}

.badge-recommended {
    background: rgba(162, 207, 255, 0.2);
    color: var(--accent-ice);
    border: 1px solid rgba(162, 207, 255, 0.4);
}

.badge-alternative {
    background: rgba(107, 118, 136, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 118, 136, 0.4);
}

/* ============================================
   Info Box (Shared Component)
   ============================================ */

.info-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.info-box h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--accent-ice);
}

.info-box h4 {
    font-size: 1rem;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    color: var(--accent-ice);
}

.info-box p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-box ul {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 0.5rem;
}

/* ============================================
   Page Header (Shared Component - Pricing Style)
   ============================================ */

.page-header {
    position: relative;
    padding: calc(var(--spacing-xl) * 1.2) 0 var(--spacing-xl) 0;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.page-header-background {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 14, 24, 0.95) 0%, rgba(6, 14, 24, 0.9) 60%, var(--bg-primary) 100%),
        radial-gradient(circle at 15% 20%, rgba(162, 207, 255, 0.28), transparent 55%),
        radial-gradient(circle at 85% 25%, rgba(56, 239, 125, 0.18), transparent 60%);
    opacity: 1;
}

.page-header-content {
    position: relative;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    color: var(--text-primary);
}

.page-header-label {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent-ice);
    margin-bottom: var(--spacing-sm);
}

.page-title {
    font-family: var(--font-headings);
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
}

.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--accent-ice);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

/* ============================================
   Content Section (Shared)
   ============================================ */

.content-section {
    padding: var(--spacing-lg) 0;
}

/* ============================================
   Section Titles (Shared)
   ============================================ */

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    text-align: center;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .nav-menu {
        gap: var(--spacing-sm);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* Desktop: increase nav vertical spacing (top & bottom) without affecting mobile */
@media (min-width: 769px) {
    .nav-wrapper {
        /* Slightly larger vertical padding for a more open header */
        padding-top: 12px;
        padding-bottom: 12px;
    }

    /* Adjust products dropdown so it clears the taller header
       Original used: top: calc(56px + 8px);
       We add the extra nav top padding (12px) so the dropdown sits correctly. */
    .nav-dropdown-menu {
        top: calc(56px + 12px + 8px);
    }

    /* Align columns: give the third column extra top padding so items line up
       with the 'More' section label in the middle column */
    .nav-dropdown-no-heading {
        /* existing column padding is 12px; add extra spacing to match the
           nav-section-label height + its bottom margin */
        padding-top: calc(12px + 8px + var(--spacing-sm) + 4px);
    }
}