/* Modern Academic Theme for Journal of Wildlife and Ecology */
:root {
  --primary-color: #0b3c5d;
  --primary-light: #1d5f8a;
  --secondary-color: #328cc1;
  --accent-color: #d9b310;
  --dark-color: #1d2731;
  --light-bg: #f9f9f9;
  --border-color: #e0e0e0;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.8rem;
}

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

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

/* Header & Navigation */
header {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-img {
  height: 60px;
  width: auto;
}

.logo-text h1 {
  font-size: 1.4rem;
  margin: 0;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.85rem;
  color: #777;
  margin: 0;
}

/* Search bar */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 8px 15px;
  padding-right: 35px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 250px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  width: 320px;
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px rgba(50, 140, 193, 0.2);
}

.search-box i {
  position: absolute;
  right: 12px;
  color: #999;
  cursor: pointer;
}

/* Navigation bar */
.navbar {
  background: var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2%;
  min-height: 50px;
  height: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-item.active > .nav-link {
  background: var(--primary-light);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  display: none;
  min-width: 200px;
  list-style: none;
  border-radius: 0 0 4px 4px;
  border: 1px solid var(--border-color);
  z-index: 1001;
  max-height: 400px;
  overflow-y: auto;
}

.dropdown-item {
  position: relative;
}

.dropdown-link {
  display: block;
  padding: 10px 15px;
  color: var(--dark-color);
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.dropdown-link:hover {
  background: var(--light-bg);
  color: var(--primary-color);
}

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

/* Sub-dropdown */
.dropdown-menu .dropdown-menu {
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
}

.dropdown-toggle::after {
  content: ' ▼';
  font-size: 0.75rem;
  opacity: 0.7;
}

.dropdown-menu .dropdown-toggle::after {
  content: ' ▶';
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  height: 450px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
}

.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 81, 145, 0.45);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 800px;
  padding: 20px;
}

.hero-content h2 {
  font-size: 2.8rem;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 20px;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

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

.btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

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

/* Home Section Layout */
.section {
  padding: 60px 10%;
}

.section:nth-child(even) {
  background-color: var(--light-bg);
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--secondary-color);
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.info-card {
  background: #ffffff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  border: 1px solid var(--border-color);
}

/* Page Layout */
.main-container {
  display: flex;
  gap: 40px;
  padding: 40px 10%;
}

.content-area {
  flex: 3;
  min-width: 0;
}

.sidebar {
  flex: 1;
  background: var(--light-bg);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  margin-bottom: 30px;
}

.sidebar-widget h4 {
  font-size: 1.1rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
  margin-bottom: 15px;
}

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

.sidebar-list li {
  margin-bottom: 10px;
}

/* Tables for papers */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

td, th {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

th {
  background: var(--light-bg);
  color: var(--primary-color);
}

tr:hover {
  background-color: #fbfbfb;
}

/* PDF Links */
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  background: var(--primary-color);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.pdf-link:hover {
  background: var(--secondary-color);
  color: #ffffff;
}

/* Footer */
footer {
  background: var(--dark-color);
  color: #ffffff;
  padding: 50px 10% 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-widget h4 {
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.footer-widget p, .footer-widget a {
  color: #bbb;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 0.85rem;
  color: #777;
}

/* Search results styles */
.search-results-page {
  padding: 40px 10%;
}

.search-item {
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
}

.search-item h3 {
  font-size: 1.25rem;
  margin-bottom: 5px;
}

.search-item-meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 991px) {
  .main-container {
    flex-direction: column;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
  }
  .navbar {
    height: auto;
    flex-direction: column;
    padding: 10px 5%;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    height: auto;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-item {
    width: 100%;
    height: auto;
  }
  .nav-link {
    height: 45px;
    width: 100%;
  }
  .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    width: 100%;
    background: rgba(0,0,0,0.05);
  }
  .dropdown-menu .dropdown-menu {
    position: static;
  }
  .nav-item:hover > .dropdown-menu, .dropdown-item:hover > .dropdown-menu {
    display: block;
  }
  .nav-toggle {
    display: block;
    align-self: flex-end;
  }
  .hero-content h2 {
    font-size: 1.8rem;
  }
}
