/* Modal styles for Eiinvoice */

.modal-row {
  display: flex !important;
  flex-wrap: wrap;
  height: auto;
  min-height: 70vh;
  overflow: visible;
}

.modal-col-left {
  flex: 0 0 65%;
  padding-right: 15px;
}

.modal-col-right {
  flex: 0 0 35%;
  padding-left: 15px;
  background-color: #f8f9fa;
  border-left: 1px solid #dee2e6;
  padding: 20px;
}

.pdfModal-left {
  height: 100%;
  min-height: 75vh;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.pdfModal-left iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdfModal-right h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
  font-weight: bold;
}

.pdfModal-right-table {
  width: 100%;
  margin-bottom: 20px;
}

.pdfModal-right-table td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.pdfModal-right-table td:first-child {
  color: #666;
  width: 60%;
}

.pdfModal-right-table td:last-child {
  text-align: right;
  font-weight: bold;
  color: #333;
}

.pdfModal-right-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pdfModal-right-list li {
  margin-bottom: 10px;
}

.pdfModal-right-item {
  display: block;
  padding: 10px 15px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.pdfModal-right-item:hover {
  background-color: #e9ecef;
  text-decoration: none;
  color: #333;
}

.pdfModal-right-item i {
  margin-right: 10px;
  color: #007bff;
  width: 20px;
}

@media (max-width: 991px) {
  .modal-row {
    flex-direction: column;
  }

  .modal-col-left,
  .modal-col-right {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0;
  }

  .modal-col-left {
    margin-bottom: 15px;
    height: 70vh;
  }

  .pdfModal-left {
    height: 100%;
  }
}

/* Ensure modal doesn't get covered by header with very high z-index */
.modal {
  z-index: 999999 !important;
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
}

.modal-backdrop {
  z-index: 999998 !important;
  position: fixed !important;
}

/* Modal dialog positioning */
.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
  max-width: 85%;
  width: 85%;
  height: calc(100vh - 1rem);
  display: flex;
  align-items: center;
  margin: 0.5rem auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
  max-height: calc(100vh - 1rem);
  overflow: hidden;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px auto !important;
    max-width: 98% !important;
    width: 98% !important;
    height: calc(100vh - 20px) !important;
  }

  .modal-content {
    height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.5rem !important;
  }

  .modal-col-left {
    height: 60vh !important;
    margin-bottom: 1rem !important;
  }

  .pdfModal-left {
    min-height: 60vh !important;
  }
}