/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fa;
  line-height: 1.6;
}

html,
body {
  height: 100%;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Header Styles */
.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Search Container */
.search-container .input-group-text {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.search-container .form-control {
  border-color: #dee2e6;
  box-shadow: none;
}

.search-container .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Document Cards */
.document-card {
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  height: 100%;
}

.document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #dee2e6;
}

.document-card .card-body {
  padding: 1.5rem;
}

.document-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.document-title {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.document-meta {
  font-size: 0.875rem;
  color: #718096;
  margin-bottom: 1rem;
}

.document-actions {
  margin-top: auto;
}

/* List View Styles */
.list-view .document-card {
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.list-view .document-card .card-body {
  padding: 1rem 1.5rem;
}

.list-view .document-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  margin-right: 1rem;
  font-size: 1.25rem;
}

/* Pagination */
.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  color: #6c757d;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

.pagination .page-link:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

/* Viewer Styles */
.viewer-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#pdfContainer {
  background: #525659;
}

#pdfCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Loading States */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .document-card .card-body {
    padding: 1rem;
  }

  .search-container {
    margin-bottom: 1rem;
  }

  .view-toggle {
    margin-top: 1rem;
  }

  .pagination {
    font-size: 0.875rem;
  }

  .pagination .page-link {
    padding: 0.375rem 0.75rem;
  }
}

@media (max-width: 576px) {
  .container-fluid .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .document-card .card-body {
    padding: 0.75rem;
  }

  .document-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* Utility Classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

/* Badge Styles */
.subject-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
}

/* Button Enhancements */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}
