/* ================== VARIABLES ================== */
:root {
    --primary-dark: #0d3b2a;
    --primary: #1b5e3a;
    --primary-light: #2e7d52;
    --accent: #4caf50;
    --accent-light: #81c784;
    --accent-gold: #d4af37;
    --text-dark: #212121;
    --text-light: #f5f5f5;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --sidebar-bg: #0d3b2a;
    --header-bg: #0d3b2a;
    --footer-bg: #0d3b2a;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --border-radius: 10px;
    --sidebar-width: 300px;
    --max-width: 1400px;
}

/* ================== GLOBAL RESET ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: var(--background);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================== HEADER ================== */
header {
    background: var(--header-bg);
    color: var(--text-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    width: 90%;
    max-width: var(--max-width);
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-light);
}

/* ================== NAV MENU HORIZONTAL BUTTONS ================== */
.nav-menu ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    list-style: none;
}

.nav-menu ul li {
    display: inline-block;
}

.nav-menu ul li a {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-menu ul li a:hover,
.nav-menu ul li a.active {
    color: var(--accent-light);
    background-color: rgba(255,255,255,0.1);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--header-bg);
        padding: 1rem 2rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        flex-direction: column;
        gap: 1rem;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-menu ul {
        flex-direction: column;
        gap: 1rem;
    }
    .mobile-menu-btn {
        display: block;
    }
}

/* ================== HERO ================== */
.hero {
    background: linear-gradient(rgba(13,59,42,0.85), rgba(13,59,42,0.9)),
                url('https://images.unsplash.com/photo-1576091160399-112ba8d25d1f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1500&q=80') center/cover no-repeat;
    color: var(--text-light);
    padding: 4rem 2rem;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
    text-decoration: none;
}

.cta-button:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
}

/* ================== SLIDER/CAROUSEL ================== */
.slider {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    height: 300px; /* Reduced height */
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.slider-content {
    height: 100%;
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    background-size: cover;
    background-position: center;
    position: relative;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(13,59,42,0.7), rgba(13,59,42,0.8));
}

.slide-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 2rem;
    max-width: 800px;
}

.slide-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.slide-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: var(--text-light);
    transform: scale(1.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.slider-btn.prev {
    left: 15px;
}

.slider-btn.next {
    right: 15px;
}

/* ================== MAIN LAYOUT ================== */
.main-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    width: 90%;
    max-width: var(--max-width);
    margin: 2rem auto;
    flex: 1;
    /* Ensure proper containment */
    overflow: visible;
}

/* ================== SIDEBAR ================== */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--text-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    /* Prevent horizontal overflow */
    width: var(--sidebar-width);
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-light);
    border-bottom: 1px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-list li:hover {
    background-color: rgba(255,255,255,0.1);
}

.sidebar-list li a {
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition);
}

.sidebar-list li a:hover {
    color: var(--accent-light);
}

/* ================== CONTENT AREA ================== */
.content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    /* Ensure content area takes remaining space properly */
    min-width: 0; /* Prevents overflow issues in grid */
    overflow: visible;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
    color: var(--primary);
}

/* ================== INTRODUCTORY WRITEUP ================== */
.intro-writeup p {
    font-size: 1.125rem; /* Tailwind text-lg */
    color: var(--primary-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ================== VISIT FULL ISSUE BUTTON ================== */
.latest-issue a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.latest-issue a:hover {
    background-color: var(--accent-light);
    transform: scale(1.05);
}

/* Article cards */
.featured-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.article-img {
    height: 180px;
    background: linear-gradient(to right, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
}

.article-content {
    padding: 1.5rem;
}

.article-content h3 {
    margin-bottom: 0.8rem;
    color: var(--primary);
}

.article-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--primary-light);
}

/* ================== CALL FOR PAPERS ================== */
.call-for-papers {
    background: linear-gradient(to right, var(--primary-light), var(--primary));
    color: #fff;
    padding: 1.8rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
}

.call-for-papers h3 {
    margin-bottom: 1rem;
}

.call-for-papers p {
    opacity: 0.9;
}

/* ================== FOOTER ================== */
footer {
    background: var(--footer-bg);
    color: var(--text-light);
    padding: 2.5rem 0;
    margin-top: auto; /* Changed from 3rem to auto for sticky footer */
}

.footer-container {
    width: 90%;
    max-width: var(--max-width);
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-section {
    flex: 1 1 200px;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-light);
}

.footer-section p,
.footer-section li {
    opacity: 0.9;
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
}

.footer-social a {
    color: var(--text-light);
    font-size: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ================== BUTTONS ================== */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* ================== TABLES ================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th, td {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #ddd;
}

th {
    background: var(--primary-light);
    color: #fff;
}

tr:hover {
    background: #f1f1f1;
}

/* ================== FORMS ================== */
input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* ================== GENERAL TAILWIND-LIKE UTILITY CLASSES ================== */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-lg { font-size: 1.125rem; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-[var(--primary-dark)] { color: var(--primary-dark); }
.text-[var(--accent)] { color: var(--accent); }
.text-[var(--accent-light)] { color: var(--accent-light); }

/* ================== RESPONSIVE ================== */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        order: 2; /* Move sidebar below content on mobile */
    }
    
    .content {
        order: 1; /* Content comes first on mobile */
    }
}

@media (max-width: 768px) {
    .main-container {
        width: 95%;
    }
    
    .sidebar,
    .content {
        padding: 1.2rem;
    }
    
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer-social {
        margin-top: 1.5rem;
    }
    
    /* Responsive adjustments for slider */
    .slider {
        height: 250px; /* Even smaller on mobile */
    }
    
    .slide-content h3 {
        font-size: 1.5rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
    
    .slider-btn {
        width: 35px;
        height: 35px;
    }
}

/* Additional fix for very small screens */
@media (max-width: 480px) {
    .main-container {
        width: 100%;
        padding: 0 1rem;
    }
    
    .sidebar,
    .content {
        border-radius: 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .featured-articles {
        grid-template-columns: 1fr;
    }
}