/* UIBK Branded Publications CSS - Blue & Orange Theme */

/* ==================== CSS VARIABLES ==================== */
:root {
  /* UIBK Brand Colors - Light Mode */
  --uibk-blue-dark: #003366;
  --uibk-blue: #0066cc;
  --uibk-blue-light: #3399ff;
  --uibk-orange-dark: #cc5200;
  --uibk-orange: #ff6600;
  --uibk-orange-light: #ff9933;
  
  /* Light Mode Colors */
  --text-primary: #003366;
  --text-secondary: #0066cc;
  --text-muted: #666666;
  --text-inverse: #ffffff;
  --text-body: #333333;
  
  /* All Backgrounds Transparent */
  --bg-main: transparent;
  --bg-card: transparent;
  --bg-controls: transparent;
  --bg-stats: transparent;
  --bg-input: transparent;
  --bg-year-count: transparent;
  --bg-footer-code: transparent;
  
  /* Light Mode Borders & Effects */
  --border-color: #0066cc;
  --border-light: #cce0ff;
  --shadow-light: rgba(0, 102, 204, 0.1);
  --shadow-medium: rgba(0, 102, 204, 0.15);
  --shadow-strong: rgba(0, 102, 204, 0.25);
  
  /* Light Mode Button */
  --button-bg: #0066cc;
  --button-hover-bg: #ff6600;
  --button-text: #ffffff;
}

/* ==================== DARK MODE ==================== */
[data-theme="dark"] {
  /* UIBK Brand Colors - Dark Mode */
  --uibk-blue-dark: #3399ff;
  --uibk-blue: #66b3ff;
  --uibk-blue-light: #99ccff;
  --uibk-orange-dark: #ff8533;
  --uibk-orange: #ff9933;
  --uibk-orange-light: #ffad66;
  
  /* Dark Mode Colors */
  --text-primary: #99ccff;
  --text-secondary: #66b3ff;
  --text-muted: #aaaaaa;
  --text-inverse: #1a1a1a;
  --text-body: #e0e0e0;
  
  /* Dark Mode Borders & Effects */
  --border-color: #66b3ff;
  --border-light: #334d66;
  --shadow-light: rgba(102, 179, 255, 0.15);
  --shadow-medium: rgba(102, 179, 255, 0.2);
  --shadow-strong: rgba(102, 179, 255, 0.3);
  
  /* Dark Mode Button */
  --button-bg: #66b3ff;
  --button-hover-bg: #ff9933;
  --button-text: #1a1a1a;
}

/* ==================== BASE CONTAINER ==================== */
.publications-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-body);
  min-height: 100vh;
  position: relative;
}

@media (min-width: 768px) {
  .publications-container {
    padding: 2rem;
  }
}

/* ==================== HEADER ==================== */
.publications-container header h1 {
  color: var(--uibk-blue);
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  font-weight: 800;
}

@media (min-width: 768px) {
  .publications-container header h1 {
    font-size: 3rem;
  }
}

.publications-container header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

@media (min-width: 768px) {
  .publications-container header p {
    font-size: 1.2rem;
  }
}

/* ==================== CONTROLS SECTION ==================== */
.controls-section {
  background: var(--bg-controls);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.controls-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--uibk-blue), var(--uibk-orange));
}

@media (min-width: 768px) {
  .controls-section {
    padding: 2rem;
  }
}

.controls-section h2 {
  color: var(--uibk-blue);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (min-width: 768px) {
  .controls-section h2 {
    font-size: 1.8rem;
  }
}

/* ==================== SEARCH GRID ==================== */
.search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: end;
}

@media (min-width: 576px) {
  .search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 768px) {
  .search-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

@media (min-width: 1200px) {
  .search-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--uibk-blue);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .form-group label {
    font-size: 0.95rem;
  }
}

.form-group input,
.form-group select {
  padding: 0.9rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-body);
  width: 100%;
  box-sizing: border-box;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--uibk-orange);
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.15), 0 4px 16px var(--shadow-medium);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.form-group select option {
  background: var(--bg-input);
  color: var(--text-body);
  padding: 0.5rem;
}

/* ==================== SEARCH BUTTON ==================== */
.search-button {
  background: var(--button-bg);
  color: var(--button-text);
  border: 2px solid var(--border-color);
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.search-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.search-button:hover::before {
  left: 100%;
}

@media (min-width: 768px) {
  .search-button {
    padding: 0.9rem 1.8rem;
  }
}

.search-button:hover {
  background: var(--button-hover-bg);
  border-color: var(--uibk-orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--shadow-strong);
}

.search-button:active {
  transform: translateY(0);
}

/* ==================== STATS BAR ==================== */
.stats-bar {
  display: none;
  background: var(--bg-stats);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-light);
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.stats-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--uibk-blue), var(--uibk-orange));
}

@media (min-width: 576px) {
  .stats-bar {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 2rem;
  }
}

@media (min-width: 768px) {
  .stats-bar {
    justify-content: space-around;
  }
}

.stats-item {
  text-align: center;
  flex: 1;
  min-width: 140px;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: transform 0.3s ease;
}

.stats-item:hover {
  transform: translateY(-2px);
  border-color: var(--uibk-orange);
}

.stats-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--uibk-blue);
  line-height: 1;
  text-shadow: 0 2px 4px var(--shadow-light);
}

@media (min-width: 768px) {
  .stats-number {
    font-size: 2.5rem;
  }
}

.stats-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .stats-label {
    font-size: 0.9rem;
  }
}

/* ==================== LOADING & STATUS ==================== */
.loading-spinner {
  margin: 2rem auto;
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--uibk-blue);
  border-right: 4px solid var(--uibk-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 4px 16px var(--shadow-light);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status-message {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 4px 16px var(--shadow-light);
  border-left: 4px solid var(--uibk-blue);
}

.status-message.error {
  border-left-color: #dc3545;
  color: #dc3545;
}

.status-message.success {
  border-left-color: #198754;
  color: #198754;
}

/* ==================== YEAR SECTIONS ==================== */
.year-section {
  margin-bottom: 3rem;
}

.year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--uibk-blue), var(--uibk-orange)) 1;
  flex-wrap: wrap;
  gap: 0.8rem;
}

@media (min-width: 576px) {
  .year-header {
    flex-wrap: nowrap;
  }
}

.year-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--uibk-blue);
  margin: 0;
  text-shadow: 0 2px 4px var(--shadow-light);
}

@media (min-width: 768px) {
  .year-title {
    font-size: 1.8rem;
  }
}

.year-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-year-count);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid var(--uibk-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .year-count {
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
  }
}

/* ==================== PUBLICATION CARDS ==================== */
.publication-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px var(--shadow-light);
  border-left: 6px solid var(--uibk-blue);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .publication-card {
    padding: 2rem;
  }
}

.publication-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--uibk-blue), var(--uibk-orange));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.publication-card:hover {
  box-shadow: 0 12px 48px var(--shadow-strong);
  transform: translateY(-4px);
  border-left-color: var(--uibk-orange);
}

.publication-card:hover::before {
  opacity: 1;
}

/* ==================== PUBLICATION HEADER ==================== */
.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

@media (min-width: 576px) {
  .publication-header {
    align-items: center;
    flex-wrap: nowrap;
  }
}

/* ==================== PUBLICATION TYPE BADGES ==================== */
.publication-type-badge {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-start;
}

.pub-badge,
.publication-type {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  color: white;
}

@media (min-width: 768px) {
  .pub-badge,
  .publication-type {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
  }
}

.pub-badge:hover,
.publication-type:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Type-specific colors */
.pub-badge-journal,
.type-journal { 
  background: linear-gradient(135deg, #003366, #0066cc);
}

.pub-badge-conference,
.type-conference { 
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.pub-badge-workshop,
.type-chapter { 
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
}

.pub-badge-tutorial { 
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

.pub-badge-dataset { 
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.pub-badge-presentation { 
  background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}

.pub-badge-poster { 
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
}

.pub-badge-book,
.type-book { 
  background: linear-gradient(135deg, #795548 0%, #5d4037 100%);
}

.pub-badge-thesis,
.type-thesis { 
  background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
}

.type-report { 
  background: linear-gradient(135deg, #666666, #0066cc);
}

.pub-badge-other,
.type-other { 
  background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

[data-theme="dark"] .pub-badge,
[data-theme="dark"] .publication-type {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pub-badge:hover,
[data-theme="dark"] .publication-type:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.publication-doi {
  padding: 0.4rem 1rem;
  border-radius: 25px;
  font-size: 0.7rem;
  font-weight: 600;
  background: transparent;
  color: #198754;
  border: 2px solid #198754;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .publication-doi {
    padding: 0.4rem 1.2rem;
    font-size: 0.75rem;
  }
}

/* ==================== PUBLICATION CONTENT ==================== */
.publication-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0 0 1.2rem 0;
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .publication-title {
    font-size: 1.25rem;
  }
}

.publication-title a {
  color: var(--uibk-blue);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  transition: all 0.3s ease;
}

.publication-title a:hover {
  color: var(--uibk-orange);
  text-shadow: 0 2px 4px var(--shadow-light);
}

.title-link-icon {
  font-size: 0.8rem;
  opacity: 0.8;
  flex-shrink: 0;
  margin-top: 0.3rem;
  transition: transform 0.3s ease;
}

.publication-title a:hover .title-link-icon {
  transform: translateX(2px);
}

@media (min-width: 768px) {
  .title-link-icon {
    font-size: 0.9rem;
  }
}

.publication-meta {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-body);
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .publication-meta {
    font-size: 0.95rem;
  }
}

.publication-meta strong,
.publication-meta b {
  color: var(--uibk-blue);
  font-weight: 600;
}

/* ==================== DOWNLOAD BUTTONS ==================== */
.publication-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.btn-primary {
  background: var(--uibk-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--uibk-blue-dark);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

/* ==================== CITATION BOX ==================== */
.publication-citation {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(0, 102, 204, 0.05);
  border-left: 4px solid var(--uibk-blue);
  border-radius: 4px;
}

.publication-citation h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--uibk-blue);
  font-size: 1.2rem;
}

.publication-citation pre {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--border-light);
}

.publication-citation code {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-body);
}

/* ==================== FOOTER ==================== */
.publications-container footer {
  color: var(--text-secondary);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--uibk-blue), var(--uibk-orange)) 1;
  font-size: 0.9rem;
  padding-top: 1.5rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .publications-container footer {
    font-size: 0.95rem;
  }
}

.publications-container footer code {
  background: var(--bg-footer-code);
  color: var(--uibk-orange);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  font-weight: 600;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .publication-downloads {
    flex-direction: column;
  }
  
  .btn-download {
    width: 100%;
    justify-content: center;
  }
  
  .search-button,
  .form-group input,
  .form-group select {
    min-height: 48px;
  }
  
  .publication-title a {
    padding: 0.3rem 0;
    margin: -0.3rem 0;
  }
}

@media (max-width: 480px) {
  .publications-container {
    padding: 1rem;
  }
  
  .controls-section {
    padding: 1.2rem;
    border-radius: 12px;
  }
  
  .publication-card {
    padding: 1.2rem;
    border-radius: 12px;
  }
  
  .publication-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .year-header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  
  .stats-bar {
    padding: 1.2rem;
  }
  
  .search-grid {
    gap: 1rem;
  }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  .publication-card,
  .search-button,
  .stats-item,
  .form-group input,
  .form-group select,
  .btn-download {
    transition: none;
  }
  
  .publication-card:hover,
  .search-button:hover,
  .stats-item:hover,
  .btn-download:hover {
    transform: none;
  }
  
  .search-button::before {
    display: none;
  }
  
  .loading-spinner {
    animation: none;
  }
}
