/* ==========================================================================
   AlgoNav Base CSS
   Shared styles for all pages (variables, resets, components, layouts)
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    /* Colors */
    --color-bg: #0a0f1a;
    --color-bg-alt: #0f1629;
    --color-bg-elevated: #151d30;
    --color-primary: #fc6200;
    --color-primary-light: #ff8533;
    --color-primary-gradient: linear-gradient(135deg, #fc6200 0%, #ff8533 100%);
    --color-accent: #3B82F6;
    --color-accent-light: #60a5fa;
    --color-text: #F3F4F6;
    --color-text-muted: #9CA3AF;
    --color-glass: rgba(255, 255, 255, 0.03);
    --color-glass-border: rgba(255, 255, 255, 0.08);

    /* Fonts */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;

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

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

/* ---------- Background Elements ---------- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.1) 0%, transparent 70%);
    bottom: 10%;
    left: -150px;
}

/* ---------- Glass Effect ---------- */
.glass {
    background: var(--color-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-glass-border);
    border-radius: 20px;
}

/* ---------- Container ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    position: relative;
    z-index: 1;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-bounce);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    background: var(--color-primary-gradient);
    color: white;
    box-shadow: 0 4px 20px -5px rgba(255, 122, 0, 0.5);
    cursor: pointer;
    border: none;
    transition: var(--transition-bounce);
}

.btn-primary:hover {
    transform: translateY(-3px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

/* ---------- Header (base - overridden by shared-layout.css) ---------- */
header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1280px;
    z-index: 1000;
    padding: 0.75rem 1.5rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 42px;
}

header nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

header nav ul li a:not(.btn) {
    font-weight: 500;
    color: var(--color-text-muted);
}

header nav ul li a:hover {
    color: var(--color-text);
}

header nav ul li a.active {
    color: var(--color-primary);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    margin-top: 0.5rem;
    z-index: 1001;
}

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

.nav-dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--color-text-muted);
}

.nav-dropdown-menu li a:hover {
    background: rgba(255, 122, 0, 0.1);
    color: var(--color-primary);
}

/* ---------- Page Hero ---------- */
.page-hero {
    padding: 10rem 0 5rem;
    text-align: center;
}

.page-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.page-hero h1 .highlight {
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

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

/* ---------- Content Section ---------- */
.content-section {
    padding: var(--space-xl) 0;
}

.content-section.alt-bg {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-glass-border);
    border-bottom: 1px solid var(--color-glass-border);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Feature Grid ---------- */
.feature-section {
    padding: var(--space-xl) 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    padding: var(--space-md);
    transition: var(--transition-bounce);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 122, 0, 0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 122, 0, 0.1);
    border: 1px solid rgba(255, 122, 0, 0.2);
    border-radius: 16px;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

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

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

/* ---------- Use Cases ---------- */
.use-cases {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-glass-border);
    border-bottom: 1px solid var(--color-glass-border);
    padding: var(--space-lg) 0;
}

.use-case-list,
.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.use-case-item,
.use-case-card {
    padding: 1.5rem;
}

.use-case-item h4,
.use-case-card h4 {
    margin-bottom: 0.5rem;
}

.use-case-card h4 {
    margin-top: 1rem;
}

.use-case-item p,
.use-case-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.use-case-card {
    text-align: center;
}

.use-case-icon {
    font-size: 2rem;
}

/* ---------- Detail Content (alternating text+image sections) ---------- */
.detail-section {
    padding: var(--space-lg) 0;
}

.detail-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
    margin-bottom: var(--space-lg);
}

.detail-block:last-child {
    margin-bottom: 0;
}

.detail-block.reverse {
    direction: rtl;
}

.detail-block.reverse > * {
    direction: ltr;
}

.detail-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.detail-text p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.detail-text ul {
    list-style: none;
    padding: 0;
}

.detail-text ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text-muted);
}

.detail-text ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* ---------- Pain Points / Challenges Section ---------- */
.challenges-section {
    padding: var(--space-lg) 0;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.challenge-card {
    padding: 1.5rem;
}

.challenge-card h4 {
    margin-bottom: 0.5rem;
    color: var(--color-primary-light);
}

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

/* ---------- Keywords / Tags ---------- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(252, 98, 0, 0.1);
    border: 1px solid rgba(252, 98, 0, 0.2);
    border-radius: 999px;
    font-size: 0.9rem;
}

.tag .tag-icon {
    color: var(--color-primary);
}

/* ---------- Bento Grid (Space page + future use) ---------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.bento-card {
    padding: 2rem;
    transition: var(--transition-bounce);
}

.bento-card:hover {
    transform: translateY(-3px);
    border-color: rgba(252, 98, 0, 0.3);
}

.bento-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.bento-card p {
    color: var(--color-text-muted);
}

.bento-card ul {
    margin-top: 1rem;
}

.bento-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-glass-border);
}

.bento-card ul li:last-child {
    border-bottom: none;
}

.bento-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.bento-span-12 { grid-column: span 12; }
.bento-span-8 { grid-column: span 8; }
.bento-span-7 { grid-column: span 7; }
.bento-span-6 { grid-column: span 6; }
.bento-span-5 { grid-column: span 5; }
.bento-span-4 { grid-column: span 4; }
.bento-span-3 { grid-column: span 3; }

.bento-accent-left {
    border-left: 3px solid var(--color-primary);
}

.bento-gradient-bg {
    background: linear-gradient(135deg, rgba(252, 98, 0, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* ---------- Expertise Section ---------- */
.expertise-section {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-glass-border);
    border-bottom: 1px solid var(--color-glass-border);
    padding: var(--space-lg) 0;
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.expertise-card {
    padding: 1.5rem;
    text-align: center;
}

.expertise-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.expertise-card h4 {
    margin-bottom: 0.5rem;
}

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

/* ---------- Inline Highlight Boxes ---------- */
.highlight-box {
    padding: 0.75rem 1rem;
    background: rgba(252, 98, 0, 0.1);
    border: 1px solid rgba(252, 98, 0, 0.2);
    border-radius: 8px;
}

.highlight-box strong {
    color: var(--color-primary-light);
}

.highlight-box p {
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

/* ---------- Inline Tags ---------- */
.inline-tag {
    padding: 0.3rem 0.75rem;
    background: rgba(252, 98, 0, 0.1);
    border: 1px solid rgba(252, 98, 0, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--color-primary-light);
}

/* ---------- CTA Section ---------- */
.cta-section {
    padding: var(--space-xl) 0;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.cta-content h2 span {
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-content p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-glass-border);
    padding: var(--space-lg) 0 var(--space-md);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-glass-border);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
    }

    .detail-block {
        grid-template-columns: 1fr;
    }

    .detail-block.reverse {
        direction: ltr;
    }

    .page-hero {
        padding: 8rem 0 3rem;
    }
}
