/* ==========================================
   AI Content Summarizer Frontend Stylesheet
   Fully Responsive, RTL, Premium & Modern
   ========================================== */

:root {
  --aics-font-family: iransansx, system-ui, -apple-system, sans-serif;
  --aics-transition-speed: 0.25s;
}

/* Modal Core Styles */
.aics-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999!important;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
  font-family: var(--aics-font-family);
}

.aics-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity var(--aics-transition-speed) ease;
}

.aics-modal-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 85vh;
  max-height: 850px;
  background-color: var(--card-white, #ffffff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--aics-transition-speed) cubic-bezier(0.16, 1, 0.3, 1), opacity var(--aics-transition-speed) ease;
}

/* Show State Animation */
.aics-modal.open .aics-modal-container {
  transform: scale(1);
  opacity: 1;
}

/* Modal Header */
.aics-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  background-color: var(--card-white, #ffffff);
}

.aics-modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aics-company-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--button-dark, #1f2937);
  background-color: var(--inner-box-gray, #f3f4f6);
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.aics-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--headings, #0f172a);
  margin: 0;
}

.aics-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.aics-modal-close:hover {
  background-color: var(--inner-box-gray, #f3f4f6);
  color: var(--dark-text, #111827);
}

/* Modal Body */
.aics-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--site-background, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Tabs Navigation */
.aics-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  padding-bottom: 12px;
}

.aics-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-family: var(--aics-font-family);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.aics-tab-btn svg {
  color: var(--text-muted, #6b7280);
  transition: color 0.2s;
}

.aics-tab-btn:hover {
  background-color: var(--inner-box-gray, #f3f4f6);
  color: var(--dark-text, #111827);
}

.aics-tab-btn.active {
  background-color: var(--button-dark, #1f2937);
  color: #ffffff;
}

.aics-tab-btn.active svg {
  color: #ffffff;
}

/* Tab Contents */
.aics-tab-content {
  display: none;
  background-color: var(--card-white, #ffffff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 12px;
  padding: 24px;
  line-height: 1.8;
  font-size: 1.3rem;
  color: var(--texts, #3b3b3b);
  min-height: 150px;
}

.aics-tab-content.active {
  display: block;
}

/* Formatted Bullet Summary List Styles */
.aics-tab-content ul {
  margin: 0;
  padding-right: 20px;
  list-style-type: disc;
}

.aics-tab-content li {
  margin-bottom: 12px;
}

.aics-tab-content li:last-child {
  margin-bottom: 0;
}

.aics-tab-content li b {
  color: var(--headings, #0f172a);
}

/* Skeleton Loading Animation */
.aics-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.aics-skeleton-line {
  height: 16px;
  background-color: var(--inner-box-gray, #f3f4f6);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.aics-skeleton-line::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.6) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: aics-shimmer 2s infinite;
}

/* Shimmer Keyframe direction agnostic or RTL friendly */
@keyframes aics-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.aics-skeleton-line.short {
  width: 40%;
}

.aics-skeleton-line.medium {
  width: 70%;
}

/* Detected Assets Section */
.aics-modal-assets-section {
  background-color: var(--card-white, #ffffff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 12px;
  padding: 16px 24px;
}

.aics-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--headings, #0f172a);
  margin: 0 0 12px 0;
}

.aics-section-title svg {
  color: var(--button-dark, #1f2937);
}

.aics-assets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aics-asset-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--button-dark, #1f2937);
  background-color: var(--inner-box-gray, #f3f4f6);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.aics-asset-tag:hover {
  background-color: var(--button-dark, #1f2937);
  color: #ffffff;
  border-color: var(--button-dark, #1f2937);
}

/* Pending Message State */
.aics-pending-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 40px 20px;
  color: var(--text-muted, #6b7280);
}

.aics-pending-icon {
  color: var(--text-muted, #6b7280);
  background-color: var(--inner-box-gray, #f3f4f6);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive / Mobile Styling (Mobile First is supported but using max-width for clear desktop overrides) */
@media (max-width: 768px) {
  .aics-modal-container {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
  }
  
  .aics-modal-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .aics-modal-body {
    padding: 16px;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling */
  }
  
  .aics-tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
  }
  
  .aics-tab-btn {
    padding: 8px 12px;
    font-size: 1rem;
  }
}
