/* Modal Responsive Fixes */
.service-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.modal-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 1rem;
  z-index: 10;
}

.modal-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.service-modal-header {
  background: linear-gradient(135deg, #74893e 0%, #5a6b30 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-header-content {
  display: flex;
  align-items: center;
}

.service-modal-header .service-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 15px;
}

.service-modal-header .service-info h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.service-modal-header .service-info p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.close-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.close-btn::before {
  content: '×';
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.service-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.service-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.footer-actions .btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer-actions .btn-outline-secondary {
  background: white;
  border: 1px solid #6c757d;
  color: #6c757d;
}

.footer-actions .btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
}

.footer-actions .btn-success {
  background: linear-gradient(135deg, #74893e 0%, #5a6b30 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(116, 137, 62, 0.3);
}

.footer-actions .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(116, 137, 62, 0.4);
}

.files-count {
  background: rgba(116, 137, 62, 0.1);
  color: #74893e;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

/* Document table in modal */
.document-table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.document-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  padding: 12px;
  border-bottom: 2px solid #e9ecef;
}

.document-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

.document-table tr:hover {
  background-color: #f8f9fa;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .service-modal {
    align-items: flex-start;
    padding-top: 20px;
  }
  
  .modal-wrapper {
    margin: 0.5rem;
    max-width: 95%;
    height: auto;
    max-height: 90vh;
  }

  .service-modal-header {
    padding: 15px;
    position: relative;
  }

  .service-header-content {
    width: 100%;
    text-align: center;
  }

  .service-modal-header .service-icon {
    margin: 0 auto 10px;
  }

  .service-modal-header .service-info h3 {
    font-size: 18px;
  }

  .service-modal-header .service-info p {
    font-size: 13px;
    padding: 0 20px;
  }

  .service-modal-body {
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .service-modal-footer {
    padding: 10px 15px;
  }

  .footer-actions {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .footer-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    margin: 0 5px;
  }

  .document-table {
    width: 100%;
  }

  .document-table th:nth-child(3),
  .document-table td:nth-child(3) {
    display: none; /* Hide size column on mobile */
  }

  .action-buttons {
    display: flex;
    flex-direction: row;
    gap: 5px;
  }

  .action-buttons .btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .action-buttons .btn i {
    margin-right: 0;
  }

  .action-buttons .btn span {
    display: none; /* Hide text, show only icons */
  }

  .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .files-count {
    display: inline-block;
    margin-top: 5px;
    font-size: 12px;
  }
}