/* ===============================
   Root & Base
================================*/
:root {
  --color-primary: #046bd2;
  --color-primary-light: #2a83e0;
  --color-bg: #f9fafb;
  --color-text: #222;
  --color-muted: #666;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /*background-color: var(--color-bg);*/
  color: var(--color-text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===============================
   Header
================================*/
header {
  background: var(--color-primary);
  color: #fff;
  padding: 20px 40px;
  box-shadow: var(--shadow-md);
}

header h1 {
  margin: 0;
  font-weight: 700;
  font-size: 1.8rem;
}

/* ===============================
   Main Layout
================================*/
#main-container {
  flex: 1;
  display: flex;
  gap: 30px;
  padding: 20px 40px;
}

/* ===============================
   Sidebar Filters
================================*/
#filter-form {
  flex: 0 0 22%;
  min-width: 280px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#sidebar-filters h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* Filter groups */
#filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.keyword-search {
    margin-bottom:20px;
}

.filter-group label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

/* Keyword input */
.filter-group.keyword-search input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.filter-group.keyword-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(4, 107, 210, 0.15);
}

/* ===============================
   Results Area
================================*/
#content-results {
  flex: 1;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#result-count {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
  margin-bottom: 15px;
}

/* Results grid */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex-grow: 1;
}

/* ===============================
   Result Cards
================================*/
.result-card {
  background: #fafafa;
  border-radius: var(--radius-lg);
  padding: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.result-card p {
    font-size:14px;
}

.result-card:hover,
.result-card:focus {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.result-card h3 a {
  color: #222;
  text-decoration: none;
}

.result-card h3 a:hover {
  text-decoration: underline;
}

.result-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #111;
}

.result-desc {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.5;
}

.result-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  border-top: 1px solid #ddd;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  font-style: italic;
}

/* ===============================
   Pagination
================================*/
.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.pagination-controls button {
  padding: 6px 12px;
  border: none;
  background-color: #e2e6ea;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}

.pagination-controls button:hover:not(:disabled) {
  background-color: var(--color-primary-light);
  color: #fff;
}

.pagination-controls button.active {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.pagination-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.pagination-controls .pagination-dots {
  padding: 6px 10px;
  color: #666;
}

/* ===============================
   Modal
================================*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(4px);
  z-index: 100;
  padding: 20px;
  display: none;
  overflow-y: auto;
}

.modal-content {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-weight: bold;
}

.modal-close:hover {
  color: var(--color-primary);
}

/* ===============================
   Responsive Design
================================*/
@media (max-width: 950px) {
  #main-container {
    flex-direction: column;
    padding: 15px 25px;
  }

  #sidebar-filters {
    width: 100%;
    max-height: none;
    margin-bottom: 20px;
  }

  #content-results {
    padding: 20px 25px;
  }
}

@media (max-width: 600px) {
  .result-card {
    padding: 18px 20px;
  }
}
