/* 
 * Vesware.com Redesign
 * Additional CSS for embedded content and media
 */

/* Video container for responsive embeds */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1.5rem 0;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive iframe */
.responsive-iframe {
  max-width: 100%;
  border: none;
  margin: 1.5rem 0;
}

/* Enhanced loading indicator */
.loading-indicator {
  text-align: center;
  padding: 3rem;
  color: var(--medium-gray);
  font-size: 1.2rem;
}

.loading-indicator::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border: 3px solid var(--medium-gray);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-left: 0.8rem;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error message styling */
.error-message {
  padding: 2rem;
  background-color: rgba(255, 0, 0, 0.05);
  border-left: 4px solid var(--secondary-color);
  margin: 2rem 0;
  border-radius: 4px;
}

.error-message h2 {
  color: var(--secondary-color);
  margin-top: 0;
}

.error-message p {
  margin-bottom: 0.5rem;
}

/* Enhanced image handling */
.responsive-image {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
  box-shadow: var(--box-shadow);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.responsive-image:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Lightbox for images */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img-container {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-img-container img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* External link indicator */
.external-link {
  position: relative;
  padding-right: 1.2em;
}

.external-link::after {
  content: '↗';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.8em;
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  box-shadow: var(--box-shadow);
}

.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.table-responsive th,
.table-responsive td {
  padding: 0.75rem;
  border: 1px solid var(--light-gray);
}

.table-responsive th {
  background-color: var(--primary-color);
  color: var(--white);
  text-align: left;
}

.table-responsive tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* PDF embed container */
.pdf-container {
  width: 100%;
  height: 600px;
  margin: 1.5rem 0;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
}

/* Audio player styling */
audio {
  width: 100%;
  margin: 1.5rem 0;
}

/* Content transition */
.content-body {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.content-body.loading {
  opacity: 0.6;
}

/* Code blocks */
pre, code {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-family: monospace;
  overflow-x: auto;
}

pre {
  padding: 1rem;
  margin: 1.5rem 0;
}

pre code {
  padding: 0;
  background-color: transparent;
}

/* Blockquote styling */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin-left: 0;
  color: #555;
  font-style: italic;
}

/* Print styling */
@media print {
  .site-header, .site-footer, .breadcrumbs, .back-to-top {
    display: none !important;
  }
  
  .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .content-section {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  body {
    background: white !important;
    font-size: 12pt !important;
  }
  
  a {
    text-decoration: underline !important;
    color: #000 !important;
  }
  
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
