/* ============================================
   SafeAGI-01 Theme - Custom Styles
   ============================================ */

/* Color System */
:root {
  --primary-color: #2c3e50;
  --primary-light: #3498db;
  --secondary-color: #209cee;
  --accent-color: #00d1b2;
  --accent-warm: #f39c12;
  --text-dark: #2c3e50;
  --text-muted: #7f8c8d;
  --bg-light: #f8fafc;
  --bg-gradient-start: #667eea;
  --bg-gradient-end: #764ba2;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Typography */
body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
}

.publication-title,
.hero-title,
.section-title {
  font-family: 'Google Sans', 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Hero Section */
.hero-gradient {
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-gradient .title,
.hero-gradient .subtitle {
  position: relative;
  z-index: 1;
}

/* Fade-in Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animated .title {
  animation: fadeInUp 0.8s ease-out;
}

.hero-animated .subtitle {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-animated .publication-links {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Fixed Navbar */
.navbar.is-fixed-top {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-item.is-active {
  color: var(--primary-light) !important;
  font-weight: 600;
}

/* Card Styles */
.paper-card {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.paper-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(102, 126, 234, 0.2);
}

/* Badge Styles */
.badge-new {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Button Enhancements */
.button.is-dark {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  border: none;
  transition: all 0.3s ease;
}

.button.is-dark:hover {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Publication Authors */
.publication-authors a {
  color: var(--text-dark);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
  transition: all 0.2s ease;
}

.publication-authors a:hover {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

/* Abstract First Letter Drop Cap */
.drop-cap::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  padding-right: 0.1em;
  font-weight: 700;
  color: var(--primary-light);
}

/* BibTeX Container */
.bibtex-container {
  position: relative;
}

.bibtex-container pre {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 10px;
  font-size: 0.875rem;
  overflow-x: auto;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-button.copied {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* Quote Block */
.quote-block {
  border-left: 4px solid var(--bg-gradient-start);
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-dark);
}

/* Tags Enhancement */
.tag.is-info.is-light {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.tag.is-warning.is-light {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.tag.is-success.is-light {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e2e8f0;
  padding: 3rem 1.5rem;
}

.footer a {
  color: #e2e8f0;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--accent-color);
}

.footer .has-text-grey {
  color: #94a3b8 !important;
}

/* Section Backgrounds */
.section-alt {
  background: var(--bg-light);
}

/* Content Enhancements */
.content.has-text-justified p {
  margin-bottom: 1.5em;
}

.content ul li {
  margin-bottom: 0.75em;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
  .hero-title {
    font-size: 2rem !important;
  }

  .publication-links .button {
    margin-bottom: 0.5rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Loading Animation */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.page-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--bg-gradient-start);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Paper Thumbnail Placeholder */
.paper-thumbnail {
  width: 120px;
  height: 160px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.paper-thumbnail i {
  font-size: 3rem;
  color: #cbd5e0;
}
