:root {
    --primary-color: #000000;
    --secondary-color: #0073ac; /* Blue from buttons */
    --bg-dark: #2f353c; /* Dark slate background from hero */
    --text-dark: #222222;
    --text-gray: #666666;
    --border-color: #e5e5e5;
    
    --font-serif: 'Merriweather', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    --container-max-width: 1140px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.5;
    background-color: #ffffff;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    border-top: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -1.5px;
}

.header-top-links {
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 0.9rem;
}

.header-top-links a:hover {
    text-decoration: underline;
}

.search-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-search-panel {
    background: #000000;
    color: #ffffff;
    padding: 18px 0 20px;
    border-bottom: 1px solid #222;
}

.header-search-title {
    font-size: 1.15rem;
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.header-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.header-search-form input[type="search"] {
    flex: 1;
    border: 1px solid #c8c8c8;
    background: #ffffff;
    color: #000000;
    height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.header-search-form button {
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    padding: 0 18px;
    height: 40px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.header-search-form button:hover {
    background: #ffffff;
    color: #000000;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid var(--primary-color);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 0.95rem;
    font-weight: 700;
}

.nav-left a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.nav-right {
    font-size: 0.9rem;
}

.nav-right a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-right a:hover {
    text-decoration: underline;
}

.nav-item-dropdown {
    position: relative;
}

.nav-item-dropdown > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    margin: -10px -15px;
}

.nav-item-dropdown:hover > a {
    background-color: #f0f0f0;
    text-decoration: none;
}

.has-dropdown::after {
    content: "";
    display: inline-block;
    width: 0; 
    height: 0; 
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--primary-color);
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.nav-item-dropdown:hover .has-dropdown::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -15px;
    background-color: #000000;
    color: #ffffff;
    min-width: 240px;
    padding: 15px 0;
    display: none;
    flex-direction: column;
    z-index: 100;
    margin-top: 12px;
}

.nav-item-dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    color: #ffffff;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.dropdown-menu a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dropdown-divider {
    height: 1px;
    background-color: #333333;
    margin: 10px 0;
}

.external-link {
    justify-content: space-between;
}

/* Hero Section */
.hero-section {
    display: flex;
    margin-bottom: 30px;
}

.hero-content {
    flex: 0 0 42%;
    background-color: var(--bg-dark);
    color: #ffffff;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-title a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.hero-title a:hover {
    text-decoration: none;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #e0e0e0;
    line-height: 1.5;
    font-family: var(--font-sans);
}

.hero-image {
    flex: 0 0 58%;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Articles Grid */
.articles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 60px;
}

.article-card {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.article-card img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    margin-bottom: 12px;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 10px;
}

.article-title a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.article-title a:hover {
    text-decoration: none;
}

.article-excerpt {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.4;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: auto;
    line-height: 1.4;
}

.article-meta .author {
    display: block;
    margin-bottom: 2px;
}

.article-meta .category {
    font-weight: 700;
    color: var(--primary-color);
}

/* Magazine Cover Sidebar */
.magazine-sidebar {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
}

.magazine-cover {
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.magazine-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.btn {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: #ffffff;
}

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

.btn-solid:hover {
    background-color: #005682;
}

.magazine-meta {
    font-size: 0.85rem;
    font-weight: 700;
}

.magazine-meta span {
    font-weight: 400;
    color: var(--text-gray);
}

/* Latest Research Section */
.latest-research {
    margin-bottom: 60px;
    padding-top: 30px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.section-title a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-title a:hover {
    text-decoration: none;
}

.research-list {
    display: flex;
    flex-direction: column;
}

.research-item {
    display: flex;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 30px;
}

.research-item:last-child {
    border-bottom: none;
}

.research-meta {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 700;
}

.research-meta .type {
    margin-bottom: 5px;
}

.research-meta .access {
    color: #e35a32; /* Orange for open access */
    margin-bottom: 5px;
    font-weight: 400;
}

.research-meta .date {
    color: var(--text-gray);
    font-weight: 400;
}

.research-content {
    flex: 1;
}

.research-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.research-title a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.research-title a:hover {
    text-decoration: none;
}

.research-excerpt {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.5;
}

.research-authors {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.research-image {
    flex: 0 0 180px;
}

.research-image img {
    width: 100%;
    border: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
    background-color: #003147;
    color: #ffffff;
    padding: 50px 0 35px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    margin-top: 60px;
}

.site-footer a {
    color: #ffffff;
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-brand {
    text-align: center;
    margin-bottom: 30px;
}

.footer-logo-text {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #ffffff;
}

.footer-logo-text:hover {
    text-decoration: none;
    opacity: 0.85;
}

.footer-nav {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 10px 30px;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-bottom {
    margin-top: 25px;
    text-align: center;
}

.footer-copy {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===========================
   Auth Pages (Login/Register)
   =========================== */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 50px 0 80px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 40px 35px;
}

.auth-card-wide {
    max-width: 620px;
}

.auth-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.5;
}

.auth-alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.auth-alert p {
    margin: 0;
}

.auth-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.auth-form .required {
    color: #dc2626;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-family: var(--font-sans);
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 172, 0.1);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-check-group {
    margin-bottom: 24px !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--secondary-color);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.auth-btn:hover {
    background-color: #005682;
}

.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.auth-footer-link a {
    color: var(--secondary-color);
    font-weight: 600;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ===========================
   User Dashboard
   =========================== */
.dashboard-page {
    padding: 30px 0 60px;
}

.dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.dashboard-welcome h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.dashboard-subtitle {
    font-size: 0.95rem;
    color: var(--text-gray);
}

.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 20px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0f2fe;
    border-radius: 50%;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.stat-icon-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.stat-icon-success {
    background-color: #d1fae5;
    color: #059669;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 4px;
}

.dashboard-section {
    margin-bottom: 35px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
}

.section-btn {
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.section-btn:hover {
    background-color: #005682;
    color: #ffffff;
    text-decoration: none;
}

.profile-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.profile-row {
    display: flex;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-label {
    flex: 0 0 160px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.profile-value {
    flex: 1;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background-color: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-gray);
}

.empty-state svg {
    margin: 0 auto 15px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.empty-hint {
    font-size: 0.85rem;
}

/* ===========================
   Responsive adjustments
   =========================== */
@media (max-width: 1024px) {
    .articles-grid {
        flex-direction: column;
    }
    .article-card {
        flex-direction: row;
        gap: 20px;
    }
    .article-card img {
        width: 30%;
        margin-bottom: 0;
    }
    .magazine-sidebar {
        flex: 1;
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
    }
    .magazine-cover {
        width: 150px;
        margin-bottom: 0;
    }
    .magazine-actions {
        flex-direction: column;
        width: 150px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column-reverse;
    }
    .header-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .article-card {
        flex-direction: column;
    }
    .article-card img {
        width: 100%;
    }
    .research-item {
        flex-direction: column;
        gap: 15px;
    }
    .research-meta {
        flex: auto;
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }
    .research-meta .type {
        margin-bottom: 0;
    }
    .research-meta .access {
        margin-bottom: 0;
    }
    .research-image {
        flex: auto;
        width: 100%;
        max-width: 300px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .auth-card,
    .auth-card-wide {
        padding: 25px 20px;
    }
    .dashboard-stats {
        flex-direction: column;
    }
    .profile-row {
        flex-direction: column;
        gap: 4px;
    }
    .profile-label {
        flex: auto;
    }
    .header-search-panel {
        padding: 14px 0 16px;
    }
    .header-search-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .header-search-form {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        gap: 8px;
    }
    .header-search-form input[type="search"],
    .header-search-form button {
        width: 100%;
    }
}
