/* Modern Societies Observatory - Stylesheet */
/* Clean, scientific, no-nonsense design */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-alt: #f8f9fa;
    --border-color: #e1e4e8;
    --max-width: 900px;
    --spacing: 2rem;
}

/* Dark mode */
[data-theme="dark"] {
    --primary-color: #e8eaf0;
    --secondary-color: #cbd0dd;
    --accent-color: #58a6ff;
    --text-color: #e8eaf0;
    --text-light: #9ca3af;
    --bg-color: #0d1117;
    --bg-alt: #161b22;
    --border-color: #30363d;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .navbar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--bg-alt);
    border-color: var(--border-color);
}

[data-theme="dark"] .application-category {
    background: var(--bg-alt);
}

[data-theme="dark"] .case-study-card {
    background: var(--bg-alt);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .case-study-title {
    color: var(--text-color);
}

[data-theme="dark"] .case-study-description {
    color: var(--text-light);
}

[data-theme="dark"] .case-study-image {
    background: var(--bg-color);
}

[data-theme="dark"] .category-title {
    color: var(--text-color);
}

[data-theme="dark"] .case-study-link {
    background: var(--accent-color);
    color: var(--bg-color);
}

[data-theme="dark"] .case-study-link:hover {
    background: #4a8ed6;
}

[data-theme="dark"] .lightbox {
    background-color: rgba(0,0,0,0.95);
}

[data-theme="dark"] .lightbox-caption {
    color: var(--text-color);
}

[data-theme="dark"] .lightbox-caption h2 {
    color: var(--text-color);
}

[data-theme="dark"] .lightbox-caption p {
    color: var(--text-light);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 17px;
    text-align: justify;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 500;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

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

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

.section {
    padding: 4rem 0;
}

/* Navigation */
.navbar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    border: none;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--accent-color);
    border: none;
}

.lang-switch {
    padding: 0.4rem 0.7rem;
    background: var(--accent-color);
    color: white !important;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
}

.lang-switch:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white !important;
}

.nav-support {
    padding: 0.4rem 0.7rem;
    background: #FF5E5B;
    color: white !important;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-support:hover {
    background: #e54542;
    color: white !important;
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    min-width: 220px;
    z-index: 1000;
    list-style: none;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--bg-alt);
    color: var(--accent-color);
}

/* Nested dropdown (submenu) */
.dropdown-menu > li.dropdown {
    position: relative;
}

.dropdown-menu > li.dropdown > a::after {
    content: ' >';
    float: right;
}

.dropdown-menu > li.dropdown > .dropdown-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0;
}

.dropdown-menu > li.dropdown:hover > .dropdown-menu {
    display: block;
}

/* Hero */
.hero {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0 2rem;
    text-align: center;
    min-height: 25vh;
    display: flex;
    align-items: center;
}

.hero .container {
    width: 100%;
}

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

.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-image {
    margin-top: 2rem;
    max-width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Content blocks */
.text-block {
    margin-bottom: 3rem;
}

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

/* Dimensions grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0 3rem;
}

.dimension {
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    text-transform: capitalize;
}

/* Capabilities with images */
.capabilities {
    margin: 3rem 0;
}

.capability-item {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    padding: 3rem;
    background: var(--bg-alt);
    border-radius: 4px;
}

.capability-item.reverse {
    flex-direction: row-reverse;
}

.capability-text {
    flex: 1;
}

.capability-text h4 {
    margin-top: 0;
}

.capability-image {
    flex: 1;
}

.capability-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Potential applications */
.potential-applications {
    margin: 3rem 0;
    padding: 1rem 2rem 2rem 2rem;
    background: var(--bg-alt);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
}

.potential-applications h3 {
    margin-top: 0;
}

.potential-applications ul {
    margin-left: 1.5rem;
    margin-bottom: 0;
}

.applications-section {
    margin: 1rem 0 2.5rem 0;
}

.applications-section:first-child {
    margin-top: 0;
}

.custom-data-title {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 2rem 0 1rem 0;
    font-style: italic;
}

.application-category.custom-data {
    border-left: 3px solid #0d9488;
}

.application-category.custom-data h5 {
    color: #0d9488;
}

[data-theme="dark"] .application-category.custom-data {
    border-left-color: #2dd4bf;
}

[data-theme="dark"] .application-category.custom-data h5 {
    color: #2dd4bf;
}

.applications-section h4 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

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

.application-category {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.application-category h5 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

.application-category ul {
    margin-left: 1.2rem;
    margin-bottom: 0;
}

.application-category li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

/* Lists */
ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Explorer access */
.explorer-access {
    text-align: center;
    padding: 2rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 3rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #2980b9;
    border: none;
}

.btn-kofi, .btn-paypal {
    background: #0070ba;
    color: white;
}

.btn-kofi:hover, .btn-paypal:hover {
    background: #005ea6;
}

/* Support section */
.support-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.support-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.support-section p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Video section */
.video-section {
    margin: 3rem 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 4px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Disclaimers */
.disclaimers {
    margin: 3rem 0;
}

.disclaimer {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-left: 3px solid var(--text-light);
    border-radius: 4px;
}

.disclaimer:last-child {
    margin-bottom: 0;
}

.disclaimer h4 {
    margin-top: 0;
}

/* Contact */
.contact-info {
    text-align: center;
    margin-bottom: 3rem;
}

.email {
    font-size: 1.2rem;
    font-weight: 500;
}

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

.author {
    padding: 2rem;
    background: var(--bg-alt);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
}

/* Acknowledgments */
.acknowledgments-section {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-light);
}

.acknowledgments-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.footer a {
    color: var(--text-light);
}

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

/* Dark mode toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-weight: 500;
    min-width: 40px;
    height: 36px;
}

.theme-toggle:hover {
    background: var(--bg-alt);
    border-color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .section {
        padding: 3rem 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .dimensions-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .capability-item,
    .capability-item.reverse {
        flex-direction: column;
    }

    .capability-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
    }

    .explorer-access {
        flex-direction: column;
    }

    .explorer-access .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

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