/* Opari Dissertation Dashboard Styles */

* {
  box-sizing: border-box;
}

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

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

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

/* Masonry Grid Styles */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 640px) {
  .masonry-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Masonry Card Styles */
.masonry-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.masonry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.masonry-card:active {
  transform: translateY(-1px);
}

.masonry-card:focus {
  outline: 2px solid #0D9488;
  outline-offset: 2px;
}

.masonry-card.selected {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.3), 0 8px 24px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #F0FDFA 0%, white 100%);
}

.masonry-card__content {
  color: #1E293B;
  font-size: 0.9375rem;
  line-height: 1.6;
  font-weight: 400;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.masonry-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #F1F5F9;
}

.masonry-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}

.masonry-card__time {
  font-size: 0.6875rem;
  color: #94A3B8;
  font-weight: 500;
}

.masonry-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #94A3B8;
  font-size: 0.9375rem;
}

.masonry-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
}

/* Staggered animation delays for cards */
.masonry-card:nth-child(1) { animation-delay: 0ms; }
.masonry-card:nth-child(2) { animation-delay: 50ms; }
.masonry-card:nth-child(3) { animation-delay: 100ms; }
.masonry-card:nth-child(4) { animation-delay: 150ms; }
.masonry-card:nth-child(5) { animation-delay: 200ms; }
.masonry-card:nth-child(6) { animation-delay: 250ms; }
.masonry-card:nth-child(7) { animation-delay: 300ms; }
.masonry-card:nth-child(8) { animation-delay: 350ms; }
.masonry-card:nth-child(9) { animation-delay: 400ms; }
.masonry-card:nth-child(10) { animation-delay: 450ms; }
.masonry-card:nth-child(n+11) { animation-delay: 500ms; }

/* Form Focus States */
textarea:focus,
select:focus {
  outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Selection Color */
::selection {
  background: rgba(13, 148, 136, 0.2);
  color: #0F766E;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Button Transitions */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}
