/* Animation Keyframes */
@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(20px); }
}

@keyframes navbarGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1.1); }
  50% { transform: scale(1.2); }
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scanline Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 100, 162, 0.02) 0px,
    transparent 2px,
    transparent 4px,
    rgba(0, 100, 162, 0.02) 6px
  );
  pointer-events: none;
  z-index: 9998;
  opacity: 1;
  animation: scanlines 12s linear infinite;
}

@media (max-width: 991px) {
  body::before { opacity: 0.3; }
}

/* Utilities */
.code-badge {
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: "SF Mono", Monaco, monospace;
  border: 1px solid #e2e8f0;
}

.tags-container { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.tag-badge {
  background: rgba(0, 100, 162, 0.08);
  color: var(--ps-blue);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(0, 100, 162, 0.2);
  box-shadow: 0 1px 3px rgba(0, 100, 162, 0.1);
}

.action-buttons { display: flex; gap: 0.5rem; justify-content: flex-end; }
@media (max-width: 576px) { .action-buttons { flex-direction: column; width: 100%; } }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  background-image: linear-gradient(rgba(0, 100, 162, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 100, 162, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

.empty-icon { width: 64px; height: 64px; color: #cbd5e1; margin: 0 auto 1rem; }
.empty-title { color: #1e293b; font-weight: 600; margin-bottom: 0.5rem; }
.empty-text { color: #64748b; margin: 0; }

.status-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }

.form-control-lg, .form-select-lg {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ps-blue);
  box-shadow: 0 0 0 0.25rem rgba(0, 100, 162, 0.1);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 100, 162, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--ps-blue), var(--ps-blue-dark));
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--ps-blue-dark), var(--ps-blue));
}

::selection { background: rgba(0, 100, 162, 0.2); color: inherit; }
::-moz-selection { background: rgba(0, 100, 162, 0.2); color: inherit; }

/* Toast */
.toast-notification {
  position: fixed; bottom: 2rem; right: 2rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white; padding: 1rem 1.5rem; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(117, 255, 219, 0.2);
  border: 1px solid rgba(117, 255, 219, 0.3); font-weight: 500;
  opacity: 0; transform: translateY(1rem); transition: all 0.3s ease;
  z-index: 9999;
}
.toast-notification.show { opacity: 1; transform: translateY(0); }

/* Loading Overlay */
.loading-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(245, 247, 250, 0.98); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; transition: opacity 0.3s ease; pointer-events: all;
}
.loading-overlay[style*="display: none"] { pointer-events: none; }

.loading-spinner {
  text-align: center; padding: 2rem; background: white; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 0 60px rgba(0, 100, 162, 0.1);
  min-width: 250px; border: 1px solid rgba(0, 100, 162, 0.1);
}
.loading-spinner .spinner-border {
  width: 3rem; height: 3rem; border-width: 0.3rem;
  border-color: var(--ps-blue); border-right-color: transparent;
}
.loading-text { font-size: 1.1rem; font-weight: 600; color: #1e293b; margin-bottom: 0.5rem; }
.loading-spinner .text-muted { font-size: 0.875rem; color: #64748b; }

#content-wrapper { transition: opacity 0.5s ease-in; }

/* Print */
@media print {
  body::before, .navbar-custom, .btn-logout, .action-buttons, .footer { display: none !important; }
  .card-modern { box-shadow: none; border: 1px solid #000; }
}