/* ===========================
   NablaFEM Main Styles
   =========================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6; /* headers and buttons */
    --primary-dark: #2563eb;
    --secondary-color: #b8b094;
    --accent-color: #faef8b;
    --text-color: #f0efe2; /* main text color */
    --text-light: #b8ae94;
    --bg-color: #2b2b2b; /* 2b2b2b */
    --bg-light: #1e293b;
    --bg-dark: #020617;
    --border-color: #535533;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem;
}

/* Header and Navigation */
header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin: 0;
}

.logo span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    /* border-radius: 0.5rem; */
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #222222 0%, #430086 100%);
    color: white;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content .subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-content .description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.85;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.field-visualization {
    background-color: rgba(255, 255, 255, 0.1);
    /* border-radius: 1rem; */
    padding: 2rem;
    backdrop-filter: blur(10px);
}

#heroCanvas {
    max-width: 100%;
    height: auto;
}

/* Features Overview */
.features-overview {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.features-overview h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 2rem;
    /* border-radius: 1rem; */
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Applications */
.applications {
    padding: 4rem 0;
}

.applications h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.application-item {
    padding: 1.5rem;
    background-color: var(--bg-light);
    /* border-radius: 0.5rem; */
    border-left: 4px solid var(--primary-color);
}

.application-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Page Header */
.page-header {
    padding: 3rem 0;
    background: linear-gradient(135deg, #430086 0%, #222222 100%);
    color: white;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Features Detailed */
.features-detailed {
    padding: 4rem 0;
}

.feature-detail {
    margin-bottom: 4rem;
}

.feature-detail h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-item {
    background-color: var(--bg-light);
    padding: 1.5rem;
    /* border-radius: 0.5rem; */
}

.feature-item h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.feature-item ul {
    margin-left: 1.5rem;
}

.feature-item li {
    margin-bottom: 0.5rem;
}

/* Technical Specs */
.technical-specs {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.technical-specs h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.spec-card {
    background-color: var(--bg-color);
    padding: 2rem;
    /* border-radius: 1rem; */
    box-shadow: var(--shadow-md);
}

.spec-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.spec-card ul {
    margin-left: 1.5rem;
}

.spec-card li {
    margin-bottom: 0.5rem;
}

/* Documentation */
.documentation-content {
    padding: 2rem 0 4rem;
}

.doc-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
}

.doc-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.doc-nav h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.doc-nav ul {
    list-style: none;
}

.doc-nav ul li {
    margin-bottom: 0.5rem;
}

.doc-nav a {
    color: var(--text-color);
    font-size: 0.9rem;
    display: block;
    padding: 0.25rem 0;
}

.doc-nav a:hover {
    color: var(--primary-color);
}

.doc-main article {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-main article:last-child {
    border-bottom: none;
}

.code-block {
    background-color: var(--bg-dark);
    color: #e2e8f0;
    padding: 1.5rem;
    /* border-radius: 0.5rem; */
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.equation {
    background-color: var(--bg-light);
    padding: 1rem;
    /* border-radius: 0.5rem; */
    font-family: var(--font-mono);
    text-align: center;
    margin: 1rem 0;
    font-size: 1.125rem;
}

/* Examples */
.examples-grid {
    padding: 2rem 0 4rem;
}

.examples-grid .container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.example-card {
    background-color: var(--bg-color);
    /* border-radius: 0.5rem; */
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.example-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.example-content {
    padding: 1.5rem;
}

.example-content h3 {
    margin-bottom: 0.5rem;
}

.example-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    /* border-radius: 1rem; */
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

/* About & Contact */
.about-content,
.contact-content {
    padding: 2rem 0 4rem;
}

.about-content article {
    margin-bottom: 3rem;
}

.about-content ul,
.contact-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-content li,
.contact-content li {
    margin-bottom: 0.5rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    /* border-radius: 0.5rem; */
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
}

.contact-method {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-method:last-child {
    border-bottom: none;
}

.contact-method h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: #cbd5e1;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e1;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
}

/* Visitor Counter Stats */
.footer-stats {
    padding: 2rem 0;
    border-top: 1px solid #334155;
    margin-top: 2rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visitor-status {
    font-size: 1rem;
    color: #cbd5e1;
    font-style: italic;
}

.visitor-status #visitorStatus {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero .container {
        grid-template-columns: 1fr;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .features-grid,
    .applications-grid,
    .specs-grid {
        grid-template-columns: 1fr;
    }

    .doc-layout {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .examples-grid .container {
        grid-template-columns: 1fr;
    }
}
