/* ===========================================
   VERCAM DOCUMENTI - Modern CSS
   =========================================== */

/* CSS Custom Properties */
:root {
  --vercam-primary: #43e97b;
  --vercam-secondary: #198754;
  --vercam-accent: #00b4d8;
  --vercam-dark: #0d6efd;
  --text-primary: #222;
  --text-secondary: #666;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --shadow-light: rgba(67, 233, 123, 0.07);
  --shadow-medium: rgba(67, 233, 123, 0.15);
  --shadow-strong: rgba(67, 233, 123, 0.25);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===========================================
   HERO SECTION
   =========================================== */

.hero-section-doc {
  position: relative;
  background: linear-gradient(135deg, var(--vercam-primary) 0%, var(--vercam-secondary) 100%);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(25, 135, 84, 0.15);
  z-index: 2;
}

/* ===========================================
   PARTICLES BACKGROUND
   =========================================== */

.particles-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--vercam-primary) 0%, rgba(234, 255, 242, 0.9) 100%);
  opacity: 0.14;
  animation: floatParticle 8s infinite ease-in-out;
  will-change: transform, opacity;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-40px) scale(1.2);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* ===========================================
   ANIMATIONS
   =========================================== */

.fade-in {
  animation: fadeInBase 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInBase {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInDocTitle {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ===========================================
   TYPOGRAPHY
   =========================================== */

.doc-title-modern {
  font-size: 3rem;
  font-weight: 900;
  color: const(--text-primary);
  letter-spacing: 1px;
  text-shadow: 0 2px 16px const(--shadow-light);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 2.5rem;
  animation: fadeInDocTitle 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
}

.doc-title-modern::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: const(--bg-white);
  border-radius: 2px;
}

/* ===========================================
   SEARCH BOX
   =========================================== */

.doc-search-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2.5rem;
  animation: fadeInBase 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-search-wrapper {
  display: flex;
  align-items: center;
  background: const(--bg-white);
  border-radius: const(--border-radius-xl);
  box-shadow: 0 4px 20px const(--shadow-medium);
  padding: 0.25rem 0.75rem 0.25rem 1.25rem;
  transition: all const(--transition-normal);
  border: 1px solid rgba(67, 233, 123, 0.1);
}

.doc-search-wrapper:hover {
  box-shadow: 0 6px 25px const(--shadow-strong);
  transform: translateY(-2px);
}

.doc-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.125rem;
  padding: 0.75rem 0.5rem;
  width: 240px;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: const(--vercam-secondary);
  transition: width const(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-search-input:focus {
  width: 320px;
}

.doc-search-btn {
  border: none;
  background: none;
  color: const(--vercam-secondary);
  font-size: 1.375rem;
  padding: 0.625rem 0.75rem;
  border-radius: 50%;
  transition: all const(--transition-fast);
  cursor: pointer;
}

.doc-search-btn:hover, .doc-search-btn:focus {
  background: rgba(67, 233, 123, 0.1);
  color: const(--vercam-primary);
  transform: scale(1.1);
}

/* ===========================================
   ACCORDION
   =========================================== */

.modern-accordion {
  --bs-accordion-bg: transparent;
  animation: fadeInBase 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-accordion-item {
  border: none;
  background: none;
  margin-bottom: 1.5rem;
  border-radius: const(--border-radius-lg);
  box-shadow: 0 2px 16px const(--shadow-light);
  transition: all const(--transition-normal);
  overflow: hidden;
}

.modern-accordion-item:hover {
  box-shadow: 0 6px 24px const(--shadow-medium);
  transform: translateY(-2px);
}

.modern-accordion-btn {
  background: linear-gradient(90deg, const(--bg-light) 60%, rgba(234, 255, 242, 0.8) 100%);
  color: const(--vercam-secondary);
  font-weight: 700;
  font-size: 1.1875rem;
  border-radius: const(--border-radius-lg) !important;
  box-shadow: none;
  transition: all const(--transition-normal);
  padding: 1.25rem 1.75rem;
  border: 1px solid rgba(67, 233, 123, 0.1);
}

.modern-accordion-btn:not(.collapsed) {
  background: rgba(67, 233, 123, 0.15);
  color: const(--vercam-secondary);
  box-shadow: 0 2px 12px const(--shadow-light);
}

.modern-accordion-btn:hover {
  background: rgba(67, 233, 123, 0.1);
  color: const(--vercam-secondary);
  transform: translateX(4px);
}

.modern-accordion-collapse {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-accordion-body {
  background: const(--bg-white);
  border-radius: 0 0 const(--border-radius-lg) const(--border-radius-lg);
  box-shadow: inset 0 2px 8px const(--shadow-light);
  padding: 1.5rem 1.75rem;
  animation: fadeInAccordion 0.5s;
  border-top: 1px solid rgba(67, 233, 123, 0.05);
}

.modern-accordion-list {
  margin: 0;
  padding-left: 1.5rem;
}

.modern-accordion-list li {
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
  position: relative;
  padding-left: 1rem;
}

.modern-accordion-list li::before {
  content: '→';
  position: absolute;
  left: -1rem;
  color: const(--vercam-primary);
  font-weight: bold;
}

.modern-accordion-list a {
  color: const(--vercam-secondary);
  text-decoration: underline;
  transition: all const(--transition-fast);
  font-weight: 500;
}

.modern-accordion-list a:hover {
  color: const(--vercam-primary);
  text-decoration: none;
}

/* ===========================================
   DOCUMENT ITEMS
   =========================================== */

.doc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0.25rem;
  animation: fadeInBase 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-link-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-link {
  color: const(--vercam-secondary);
  text-decoration: underline;
  transition: all const(--transition-fast);
  font-weight: 500;
}

.doc-link:hover {
  color: const(--vercam-primary);
  text-decoration: none;
}

.doc-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
  font-size: 1.25rem;
  color: const(--vercam-secondary);
  background: rgba(234, 255, 242, 0.8);
  border-radius: 50%;
  padding: 0.5rem 0.625rem;
  box-shadow: 0 2px 8px const(--shadow-light);
  transition: all const(--transition-normal);
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  animation: fadeInBase 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-download:hover, .doc-download:focus {
  background: rgba(67, 233, 123, 0.2);
  color: const(--vercam-secondary);
  transform: scale(1.15);
  box-shadow: 0 4px 16px const(--shadow-medium);
}

/* ===========================================
   INTRO BOX
   =========================================== */

.intro-doc-box {
  max-width: 800px;
  background: const(--bg-light);
  border-radius: const(--border-radius-xl);
  box-shadow: 0 6px 24px const(--shadow-medium);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
  padding: 2.5rem 2rem;
  animation: fadeInBase 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(67, 233, 123, 0.1);
}

.intro-doc-title {
  font-size: 2.125rem;
  font-weight: 700;
  color: const(--vercam-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  text-align: center;
}

.intro-doc-sub {
  font-size: 1.25rem;
  color: const(--text-primary);
  margin-bottom: 0;
  line-height: 1.6;
  text-align: center;
}

.intro-doc-link {
  color: const(--vercam-secondary);
  font-weight: 700;
  text-decoration: underline;
  transition: all const(--transition-fast);
}

.intro-doc-link:hover {
  color: const(--vercam-primary);
  text-decoration: none;
}

/* ===========================================
   FILTERS SECTION
   =========================================== */

.filters-section {
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(233, 236, 239, 0.7) 100%);
  border-radius: const(--border-radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(67, 233, 123, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.filters-section .form-label {
  color: const(--vercam-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.filters-section .form-select {
  border: 2px solid #dee2e6;
  border-radius: const(--border-radius-md);
  padding: 0.625rem 1rem;
  font-size: 0.95rem;
  transition: all const(--transition-normal);
  min-width: 200px;
  background: const(--bg-white);
}

.filters-section .form-select:focus {
  border-color: const(--vercam-primary);
  box-shadow: 0 0 0 0.2rem rgba(67, 233, 123, 0.25);
  transform: translateY(-1px);
}

.filters-section .btn {
  border-radius: const(--border-radius-md);
  font-weight: 600;
  padding: 0.625rem 1.75rem;
  transition: all const(--transition-normal);
  background: linear-gradient(135deg, const(--vercam-primary) 0%, const(--vercam-secondary) 100%);
  border: none;
  color: const(--bg-white);
}

.filters-section .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px const(--shadow-medium);
}

/* ===========================================
   DOCUMENT INFO
   =========================================== */

.doc-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.doc-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, const(--vercam-primary) 0%, const(--vercam-secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: const(--bg-white);
  margin-right: 1.25rem;
  flex-shrink: 0;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px const(--shadow-medium);
}

.doc-details {
  flex: 1;
  min-width: 0;
}

.doc-meta {
  margin-top: 0.375rem;
}

.doc-meta small {
  display: block;
  margin-bottom: 0.375rem;
  color: const(--text-secondary);
}

.doc-stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: const(--text-secondary);
}

.file-size,
.upload-date {
  font-weight: 500;
}

/* ===========================================
   MOBILE RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 768px) {
  .hero-section-doc {
    min-height: 420px;
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .doc-title-modern {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  .doc-search-box {
    margin-bottom: 2rem;
  }

  .doc-search-input {
    font-size: 1.125rem;
    width: 200px;
    padding: 0.75rem 0.5rem;
    border-radius: const(--border-radius-lg);
  }

  .doc-search-input:focus {
    width: 280px;
  }

  .doc-search-btn {
    font-size: 1.25rem;
    padding: 0.625rem 0.75rem;
  }

  .modern-accordion {
    animation: none;
  }

  .modern-accordion-item {
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 15px const(--shadow-medium);
    border-radius: const(--border-radius-xl);
  }

  .modern-accordion-btn {
    font-size: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: const(--border-radius-xl) !important;
    font-weight: 700;
  }

  .modern-accordion-body {
    padding: 1.5rem;
    font-size: 1.0625rem;
  }

  .modern-accordion-list {
    padding-left: 0.75rem;
  }

  .doc-list-item {
    gap: 0.875rem;
    font-size: 1.0625rem;
    padding: 0.25rem 0;
  }

  .doc-download {
    font-size: 1.375rem;
    padding: 0.5rem 0.625rem;
  }

  .intro-doc-box {
    padding: 1.75rem 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px const(--shadow-light);
    border-radius: const(--border-radius-lg);
  }

  .intro-doc-title {
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
  }

  .intro-doc-sub {
    font-size: 1.0625rem;
  }

  .filters-section {
    padding: 1.75rem 1.25rem;
  }

  .filters-section .row > div {
    margin-bottom: 1.25rem;
  }

  .filters-section .form-select {
    min-width: auto;
    width: 100%;
  }

  .doc-info {
    flex-direction: column;
    text-align: center;
  }

  .doc-icon {
    margin-right: 0;
    margin-bottom: 1.25rem;
  }

  .doc-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ===========================================
   CATEGORY COLLAPSIBLE SECTIONS
   =========================================== */

.category-header {
  transition: all 0.3s ease;
  border: 1px solid rgba(67, 233, 123, 0.2);
}

.category-header:hover {
  background-color: rgba(67, 233, 123, 0.1) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 233, 123, 0.15);
}

.category-chevron {
  transition: transform 0.3s ease;
  color: const(--vercam-secondary);
  font-size: 1.2rem;
}

.category-section .collapse {
  transition: all 0.3s ease;
}

/* Animation for category content */
.category-section .collapsing {
  transition: height 0.3s ease;
}

/* Enhanced card hover effects for collapsible sections */
.category-section .card {
  transition: all 0.3s ease;
}

.category-section .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(67, 233, 123, 0.2);
}

/* ===========================================
   NEW DOCUMENTS HIGHLIGHTING
   =========================================== */

.card.border-danger {
  position: relative;
}

.card.border-danger::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #dc3545, #fd7e14, #ffc107);
  border-radius: 0.375rem;
  z-index: -1;
  opacity: 0.3;
  animation: pulse 2s infinite;
}

.badge.bg-danger {
  animation: bounceIn 0.6s ease-out;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .category-header {
    padding: 1rem;
  }
  
  .category-header h3 {
    font-size: 1.25rem;
  }
  
  .category-chevron {
    font-size: 1rem;
  }
  
  /* Search box mobile improvements */
  .doc-search-box {
    margin-bottom: 1.5rem;
  }
  
  .doc-search-wrapper {
    position: relative;
  }
  
  .doc-search-input {
    padding-right: 3rem;
    border-radius: 0.5rem;
    font-size: 1rem;
  }
  
  .doc-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: const(--vercam-secondary);
    padding: 0.5rem;
  }
  
  /* Card improvements for mobile */
  .card-title {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .card-text {
    font-size: 0.875rem;
  }
  
  /* Badge spacing on mobile */
  .badge {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }
  
  /* Button improvements */
  .btn-success {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 991px) {
  .category-header h3 {
    font-size: 1.5rem;
  }
}