/* =============================================
   MakaleBul — Global Styles
   Premium dark theme with glassmorphism
   ============================================= */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --accent-glow: rgba(99, 102, 241, 0.3);

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --oa-color: #f59e0b;

  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 60px;
  /* overflow: hidden buradan kaldırıldı - dropdown klıplanmasın diye */
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Parçacıklar ve gradient buraya sınırlandırılır */
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 70% 80%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 20% 60%, rgba(167, 139, 250, 0.08), transparent);
}

.hero-particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-3);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
    transform: translateY(-20vh) scale(1);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 40px;
}

/* ===== SEARCH FORM ===== */
.search-form {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  transition: var(--transition);
  overflow: hidden;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  position: absolute;
  left: 20px;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  flex: 1;
  padding: 18px 18px 18px 54px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  margin: 6px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.search-btn:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-glow);
}

.search-btn:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ===== FILTERS ===== */
.filters-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.filters-toggle:hover {
  color: var(--accent-3);
}

.filters-panel {
  display: none;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  animation: slideDown 0.3s ease;
}

.filters-panel.active {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-group {
  flex: 1;
  min-width: 180px;
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--accent-1);
}

.filter-select option {
  background: var(--bg-secondary);
}

.filter-separator {
  color: var(--text-muted);
  flex-shrink: 0;
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}

.filter-checkbox {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-hover);
  border-radius: 5px;
  transition: var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.filter-checkbox:checked+.checkbox-custom {
  background: var(--accent-1);
  border-color: var(--accent-1);
}

.filter-checkbox:checked+.checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.oa-badge-small {
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--oa-color);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===== RESULTS ===== */
.results-section {
  padding: 20px 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.results-container {
  width: 100%;
}

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

.results-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.results-title span {
  color: var(--accent-3);
}

.results-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== RESULT CARDS ===== */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: var(--transition);
  animation: cardFadeIn 0.4s ease forwards;
  opacity: 0;
}

.result-card:hover {
  border-color: var(--accent-1);
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  flex: 1;
}

.card-badges {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-oa {
  background: rgba(245, 158, 11, 0.15);
  color: var(--oa-color);
}

.badge-year {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-3);
}

.card-authors {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.citation-count {
  color: var(--accent-3);
  font-weight: 600;
}

.card-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.concept-tag {
  padding: 3px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== LOADING ===== */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--text-muted);
  font-size: 15px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== ERROR ===== */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.error-icon {
  font-size: 32px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-1);
  color: var(--accent-3);
  background: var(--bg-glass-hover);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 740px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.modal-body {
  padding: 32px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-authors-list {
  list-style: none;
}

.modal-author-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

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

.modal-author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.modal-author-inst {
  color: var(--text-muted);
  font-size: 13px;
}

.modal-abstract {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.modal-stat-card {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
}

.modal-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-3);
}

.modal-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent-gradient);
  color: white;
  text-decoration: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.modal-link:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-glow);
}

.modal-link-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.modal-link-secondary:hover {
  border-color: var(--accent-1);
  color: var(--accent-3);
  box-shadow: none;
}

.modal-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-concept {
  padding: 5px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent-3);
}

/* ===== FOOTER ===== */
.footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent-3);
  text-decoration: none;
}

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

/* ===== NO RESULTS ===== */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}

.no-results-icon {
  font-size: 48px;
  opacity: 0.5;
}

.no-results-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    padding: 100px 16px 40px;
    min-height: 420px;
  }

  .search-btn .btn-text {
    display: none;
  }

  .search-btn {
    padding: 12px 16px;
  }

  .result-card {
    padding: 18px;
  }

  .card-header {
    flex-direction: column;
  }

  .card-badges {
    align-self: flex-start;
  }

  .modal-body {
    padding: 24px 18px;
  }

  .modal-title {
    font-size: 18px;
  }

  .filters-panel {
    flex-direction: column;
  }

  .header-stats {
    display: none;
  }
}

@media (max-width: 480px) {
  .pagination {
    gap: 12px;
  }

  .page-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}