/* ============================================
   Blackbox Auditor - Shared Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --bg: #0f1113;
    --bg-secondary: #141619;
    --card: #1a1d21;
    --card-hover: #1f2328;
    --text: #ffffff;
    --text-secondary: #e2e8f0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --muted: #94a3b8;
    --border: #2d3139;
    --border-hover: #3d4149;
    --success: #10b981;
    --warning: #f97316;
    --error: #ef4444;
    --linkedin: #0077b5;

    /* Badge Colors */
    --soc2: #8b5cf6;
    --soc2-light: #c4b5fd;
    --pci: #f97316;
    --pci-light: #fdba74;
    --iso: #10b981;
    --iso-light: #a7f3d0;
    --hitrust: #06b6d4;
    --hitrust-light: #a5f3fc;

    /* Spacing */
    --nav-height: 72px;
    --container-max: 1200px;
    --container-narrow: 900px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    background-image: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08), transparent 50%);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

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

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

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

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(15, 17, 19, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.nav-logo img {
    width: 65px;
    height: 65px;
    border-radius: 8px;
}

.nav-logo span {
    font-weight: 700;
    font-size: 1.1rem;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1rem;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

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

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

/* Dropdown Arrow */
.nav-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.nav-item:hover .nav-link svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    list-style: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-item a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.coming-soon a {
    color: var(--muted);
    opacity: 0.6;
    cursor: default;
}

.dropdown-item.coming-soon a::after {
    content: " (Coming Soon)";
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* CTA Button in Nav */
.nav-cta {
    background: var(--accent);
    color: white !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 8px;
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--accent-hover);
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: var(--container-narrow);
}

main {
    padding-top: var(--nav-height);
}

.section {
    padding: 2.5rem 0;
}

.section-lg {
    padding: 4rem 0;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 4rem 0 2.5rem;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--muted);
}

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

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

.breadcrumb span {
    color: var(--text-secondary);
}

.breadcrumb-separator {
    color: var(--border);
}

/* ============================================
   Framework Badges
   ============================================ */
.badge-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.badge {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 6px 14px;
    border-radius: 6px;
    text-transform: uppercase;
    border: 1px solid;
    transition: transform 0.2s;
}

.badge:hover {
    transform: translateY(-2px);
}

.badge-soc2 {
    border-color: var(--soc2);
    color: var(--soc2-light);
    background: rgba(139, 92, 246, 0.1);
}

.badge-pci {
    border-color: var(--pci);
    color: var(--pci-light);
    background: rgba(249, 115, 22, 0.1);
}

.badge-iso {
    border-color: var(--iso);
    color: var(--iso-light);
    background: rgba(16, 185, 129, 0.1);
}

.badge-hitrust {
    border-color: var(--hitrust);
    color: var(--hitrust-light);
    background: rgba(6, 182, 212, 0.1);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}

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

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

.card-icon {
    background: rgba(59, 130, 246, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.card-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent);
    stroke-width: 1.5;
    fill: none;
}

.card h3 {
    color: var(--text);
}

/* Linked Cards */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link .card:hover {
    border-color: var(--accent);
}

.card-link .card h3 {
    transition: color 0.2s;
}

.card-link:hover .card h3 {
    color: var(--accent);
}

/* ============================================
   Evidence Tables
   ============================================ */
.evidence-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.evidence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.evidence-table caption {
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.evidence-table thead {
    background: var(--card);
}

.evidence-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.evidence-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

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

.evidence-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Risk Indicators */
.risk-high {
    color: var(--error);
}

.risk-medium {
    color: var(--warning);
}

.risk-low {
    color: var(--success);
}

/* ============================================
   Comparison Table
   ============================================ */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

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

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

.comparison-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.comparison-table thead th:last-child {
    border-radius: 0 12px 0 0;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    border-bottom: none;
}

.comparison-table tbody td:last-child {
    background: rgba(59, 130, 246, 0.05);
    border-left: 1px solid var(--accent);
    border-right: 1px solid var(--accent);
}

.comparison-table tbody tr:last-child td:last-child {
    border-bottom: 1px solid var(--accent);
    border-radius: 0 0 12px 0;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    background: linear-gradient(145deg, var(--card), var(--bg));
    border: 1px solid var(--accent);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    margin: 4rem 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.cta-section h2 {
    margin-bottom: 1rem;
}

.cta-section p {
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ============================================
   Related Pages Sidebar/Section
   ============================================ */
.related-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
}

.related-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

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

.related-list li {
    margin-bottom: 0.75rem;
}

.related-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    color: var(--muted);
    border-radius: 8px;
    transition: all 0.2s;
}

.related-list a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.related-list a svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 3rem 0;
}

.content-section h2 {
    margin-bottom: 1.5rem;
}

.content-section ul {
    list-style: none;
    margin: 1.5rem 0;
}

.content-section li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
}

.content-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Dividers */
.divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

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

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.9rem;
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-tagline {
    font-style: italic;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

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

.text-accent {
    color: var(--accent);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-toggle {
        display: block;
    }

    .nav-link {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        display: none;
    }

    .nav-item.active .dropdown-menu {
        display: block;
    }

    /* Layout adjustments */
    .hero {
        padding: 3rem 0 2rem;
    }

    .section {
        padding: 2rem 0;
    }

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

    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-section {
        padding: 3rem 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .badge-group {
        gap: 8px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}

/* ============================================
   Blog Styles
   ============================================ */

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.blog-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.blog-card-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.blog-category {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
}

.blog-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.2s;
}

.blog-card:hover .blog-title {
    color: var(--accent);
}

.blog-excerpt {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
}

.blog-read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.blog-card:hover .blog-read-more svg {
    transform: translateX(4px);
}

/* Blog Article */
.blog-article {
    padding-bottom: 2rem;
}

.article-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.article-header h1 {
    margin-bottom: 1.5rem;
    text-align: left;
}

.article-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
}

.article-content {
    padding: 2rem 0;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--muted);
}

.article-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

.article-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Blog Responsive */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .article-header {
        padding: 2rem 0 1.5rem;
    }

    .article-intro {
        font-size: 1.1rem;
    }
}
