/*--------------------------------------------------------------
# PhyFa Aparat Player - Dedicated Styles v1.1.0
--------------------------------------------------------------*/

/* Player Styles */
.phyfa-aparat-container { margin: 20px 0; }
.phyfa-aparat-player-wrapper { position: relative; width: 100%; padding-top: 56.25%; background-color: #000; border-radius: var(--phyfa-border-radius-medium); overflow: hidden; }
.phyfa-aparat-facade, .phyfa-aparat-player-embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.phyfa-aparat-facade { cursor: pointer; }
.phyfa-aparat-facade img, .phyfa-aparat-placeholder-thumb { width: 100%; height: 100%; object-fit: cover; border: none; }
.phyfa-aparat-placeholder-thumb { background-color: #222; }
.phyfa-aparat-facade .phyfa-play-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px; background-color: rgba(30, 30, 30, 0.85); border-radius: 12px; transition: background-color 0.2s ease; display: flex; align-items: center; justify-content: center; z-index: 2; }
.phyfa-aparat-facade .phyfa-play-button::before { content: ''; display: block; width: 0; height: 0; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent var(--phyfa-text-light, #fff); margin-left: 3px; }
.phyfa-aparat-facade:hover .phyfa-play-button { background-color: var(--phyfa-primary-color, #e65717); }
.phyfa-aparat-player-embed iframe { width: 100%; height: 100%; border: 0; }

/* --- START: Playlist Styles (Copied from phyfa-player) --- */
.phyfa-playlist-container { background-color: #1b1a1b; border: 2px solid #898989; border-radius: var(--phyfa-border-radius-medium); padding: 15px; margin-bottom: 25px; color: var(--phyfa-text-light); font-family: var(--phyfa-font-primary); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); }
.phyfa-playlist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--phyfa-background-light); }
.phyfa-playlist-title { font-size: 1.1em; color: var(--phyfa-text-light); margin: 0; font-weight: 600; flex-grow: 1; }
.phyfa-playlist-counter { font-size: 0.9em; color: var(--phyfa-text-gray); white-space: nowrap; margin-right: 5px; }
.phyfa-playlist-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--phyfa-primary-color) var(--phyfa-background-light); }
.phyfa-playlist-list::-webkit-scrollbar { width: 8px; }
.phyfa-playlist-list::-webkit-scrollbar-track { background: var(--phyfa-background-light); border-radius: var(--phyfa-border-radius-small); }
.phyfa-playlist-list::-webkit-scrollbar-thumb { background-color: var(--phyfa-primary-color); border-radius: var(--phyfa-border-radius-small); border: 2px solid var(--phyfa-background-light); }
.phyfa-playlist-item { margin-bottom: 8px; }
.phyfa-playlist-item:last-child { margin-bottom: 0; }
.phyfa-playlist-item-link { display: flex; align-items: center; padding: 8px; text-decoration: none; border-radius: var(--phyfa-border-radius-small); transition: background-color var(--phyfa-transition-fast); }
.phyfa-playlist-item:hover .phyfa-playlist-item-link { background-color: var(--phyfa-background-light); }
.phyfa-playlist-item.current-video .phyfa-playlist-item-link { background-color: rgba(230, 87, 23, 0.2); }
.phyfa-playlist-item-numbering { flex-shrink: 0; width: 20px; text-align: center; color: var(--phyfa-text-gray); font-size: 0.9em; margin-left: 10px; align-self: center; }
.phyfa-play-icon-indicator { color: var(--phyfa-primary-color); font-size: 1.1em; }
.phyfa-video-index { font-weight: 500; }
.phyfa-playlist-item-thumbnail { flex-shrink: 0; width: 100px; position: relative; border-radius: var(--phyfa-border-radius-small); overflow: hidden; }
.phyfa-playlist-item-thumbnail img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }
.phyfa-video-duration-badge { position: absolute; bottom: 5px; right: 5px; background-color: rgba(0, 0, 0, 0.75); color: #fff; padding: 2px 6px; font-size: 0.75em; font-weight: 500; border-radius: var(--phyfa-border-radius-small); line-height: 1; }
.phyfa-playlist-item-details { flex-grow: 1; min-width: 0; margin-right: 12px; }
.phyfa-playlist-item-title { font-size: 0.9em; color: var(--phyfa-text-light); margin: 0 0 4px 0; line-height: 1.4; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: ellipsis; max-height: 2.8em; }
.phyfa-playlist-item.current-video .phyfa-playlist-item-title, .phyfa-playlist-item:hover .phyfa-playlist-item-title { color: var(--phyfa-primary-color); }
.phyfa-playlist-message { text-align: center; color: var(--phyfa-text-gray); padding: 15px; font-size: 0.95em; }
/* --- END: Playlist Styles --- */

/* --- START: Aparat Login Prompt Styles --- */
.phyfa-aparat-login-prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 26, 27, 0.85) 0%, rgba(37, 38, 38, 0.95) 100%); /* Similar to shop dark gradient */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    color: var(--phyfa-text-light, #fffcf2);
    z-index: 3; /* Higher than play button */
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: visible;
    border-radius: var(--phyfa-border-radius-medium); /* Match player wrapper */
}

.phyfa-aparat-login-prompt-overlay.hidden-prompt {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.phyfa-aparat-login-prompt-content {
    background: rgba(42, 41, 41, 0.6); /* Slightly transparent dark background */
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(85, 85, 85, 0.5);
    max-width: 450px;
    width: 90%;
}

.phyfa-aparat-login-prompt-title {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--phyfa-primary-color, #e65717);
    margin-top: 0;
    margin-bottom: 12px;
}

.phyfa-aparat-login-prompt-text {
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--phyfa-text-light-gray, #d4d4d4);
}

.phyfa-aparat-login-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Inherit .phyfa-button styles from core or define similar ones if not available */
/* Assuming .phyfa-button styles are similar to filter-apply-btn & filter-reset-btn */

.phyfa-aparat-login-prompt-actions .phyfa-button {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex; /* For icon alignment */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between text and icon */
    position: relative;
    overflow: hidden;
}
.phyfa-aparat-login-prompt-actions .phyfa-button::before { /* Shine effect */
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}
.phyfa-aparat-login-prompt-actions .phyfa-button:hover::before {
    left: 100%;
}


.phyfa-aparat-login-prompt-actions .phyfa-button-primary {
    background: linear-gradient(135deg, var(--phyfa-primary-color, #e65717) 0%, var(--phyfa-primary-darker, #dc2f02) 100%);
    color: #fffcf2;
    box-shadow: 0 4px 15px rgba(230, 87, 23, 0.3);
}
.phyfa-aparat-login-prompt-actions .phyfa-button-primary:hover {
    background: linear-gradient(135deg, var(--phyfa-primary-darker, #dc2f02) 0%, var(--phyfa-primary-darkest, #b02a05) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 47, 2, 0.4);
}

.phyfa-aparat-login-prompt-actions .phyfa-button-secondary {
    background: transparent;
    border: 2px solid var(--phyfa-primary-color, #e65717);
    color: var(--phyfa-primary-color, #e65717);
    box-shadow: 0 2px 8px rgba(230, 87, 23, 0.1);
}
.phyfa-aparat-login-prompt-actions .phyfa-button-secondary:hover {
    background: linear-gradient(135deg, var(--phyfa-primary-color, #e65717) 0%, var(--phyfa-primary-darker, #dc2f02) 100%);
    color: #fffcf2 !important; /* Ensure text color changes */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 87, 23, 0.4);
}

/* Styles for screens from 320px up to 479px */
@media (min-width: 320px) and (max-width: 479px) {
    .phyfa-aparat-login-prompt-overlay {
        padding: 15px; /* Adjust overall padding if needed */
    }
    .phyfa-aparat-login-prompt-content {
        padding: 5px 5px; /* Slightly more padding inside the box */
        width: 100%;         /* Can be a bit wider */
        /* max-width remains unset or can be set to something like 300px if needed */
    }
    .phyfa-aparat-login-prompt-title {
        font-size: 1.05em; /* Slightly larger than the smallest screens */
        margin-bottom: 10px;
        padding-top: 10px;
    }
    .phyfa-aparat-login-prompt-text {
        font-size: 0.85em; /* Slightly larger */
        line-height: 1.5;
        margin-bottom: 15px;
    }
    .phyfa-aparat-login-prompt-actions {
        gap: 10px; /* Standard gap for this size */
    }
    .phyfa-aparat-login-prompt-actions .phyfa-button {
        font-size: 0.85em; /* Standard button text size for this range */
        padding: 10px 12px; /* Standard button padding for this range */
    }
    .phyfa-aparat-login-prompt-actions .phyfa-button i {
        font-size: 0.95em;
    }
}

/* Styles for screens 480px and wider (where buttons might go side-by-side) */
@media (min-width: 480px) {
    .phyfa-aparat-login-prompt-overlay {
        padding: 20px;
    }
    .phyfa-aparat-login-prompt-content {
        padding: 25px 30px;
        width: 100%;
        max-width: 450px; /* Max width for larger screens */
    }
    .phyfa-aparat-login-prompt-title {
        font-size: 1.25em; /* Default larger title */
    }
    .phyfa-aparat-login-prompt-text {
        font-size: 0.95em; /* Default larger text */
        margin-bottom: 20px;
    }
    .phyfa-aparat-login-prompt-actions {
        flex-direction: row; /* Buttons side-by-side */
        gap: 12px;
    }
    .phyfa-aparat-login-prompt-actions .phyfa-button {
        font-size: 0.95em;
        padding: 10px 20px;
        width: auto;
        flex-grow: 1;
    }
}
/* --- END: Aparat Login Prompt Styles --- */


/* --- START: Aparat Related Videos Slider Styles --- */
.phyfa-aparat-related-slider-wrapper {
  background: linear-gradient(135deg, #1b1a1b 0%, #252626 100%);
  /* Fallback برای همه مرورگرها */
  border-radius: 50px;
	
  /* فقط برای مرورگرهای پشتیبان از squircle */
  @supports (corner-shape: squircle) {
    border-radius: 100px;
    corner-shape: squircle;
  }
  padding: 1.2rem 1rem; /* Slightly less padding for sidebar */
  margin-bottom: 2rem;
  border: 1px solid #403d39;
  direction: rtl;
  position: relative;
  overflow: hidden;
}

.phyfa-aparat-related-slider-wrapper::before { /* Optional pattern */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 15% 15%, rgba(230, 87, 23, 0.02) 0%, transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(248, 155, 41, 0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.phyfa-aparat-related-slider-wrapper > * {
  position: relative;
  z-index: 1;
}

.phyfa-aparat-related-slider-wrapper h4 {
  color: #fffcf2;
  font-size: 1.1rem; /* Suitable for sidebar */
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.6rem;
}

.phyfa-aparat-related-slider-wrapper h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2.5px;
  background: linear-gradient(135deg, #e65717 0%, #f89b29 100%);
  border-radius: 2px;
}

/* Swiper specific styles for Aparat slider */
.phyfa-aparat-related-slider-wrapper .swiper {
  width: 100%;
  height: auto;
  padding-top: 5px;
  padding-bottom: 35px; /* Space for pagination */
  direction: rtl;
}

.phyfa-aparat-related-slider-wrapper .swiper-wrapper {
  align-items: stretch;
}

.phyfa-aparat-related-slider-wrapper .swiper-slide {
  height: auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: transparent;
}

/* Aparat Slider Item (Card-like) */
.phyfa-aparat-slider-item {
  background: linear-gradient(145deg, #202121, #181718); /* Darker, subtle gradient */
   /* Fallback برای همه مرورگرها */
  border-radius: 50px;
	
  /* فقط برای مرورگرهای پشتیبان از squircle */
  @supports (corner-shape: squircle) {
    border-radius: 100px;
    corner-shape: squircle;
  }
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #403d39;
  display: flex;
  flex-direction: column;
  width: 100%; /* Take full width of swiper-slide */
}

.phyfa-aparat-slider-item:hover {
  transform: translateY(-2px);
}

.phyfa-aparat-slider-item-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.phyfa-aparat-slider-item-thumbnail {
    overflow: hidden;
  position: relative;
}

.phyfa-aparat-slider-item-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.phyfa-aparat-slider-item:hover .phyfa-aparat-slider-item-thumbnail img {
  transform: scale(1.05);
}

/* Duration Badge - Ensure it's positioned correctly within the slider thumbnail */
.phyfa-aparat-slider-item-thumbnail .phyfa-video-duration-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.75); /* Copy from original if needed */
    color: #fff;                          /* Copy from original if needed */
    padding: 2px 6px;                    /* Copy from original if needed */
    font-size: 0.9em; /* یا 0.75em */    /* Copy from original if needed */
    font-weight: 500;                    /* Copy from original if needed */
    border-radius: var(--phyfa-border-radius-small); /* Copy from original if needed */
    line-height: 1;                      /* Copy from original if needed */
}

/* Play Overlay - Make it more generic or override for slider */
.phyfa-aparat-slider-item-thumbnail .phyfa-archive-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    color: #fffcf2;
    opacity: 0;
    z-index: 1;
    border-radius: inherit;
}
.phyfa-aparat-slider-item-link:hover .phyfa-archive-play-overlay {
    transform: scale(1.05);
        opacity: 1;

}


.phyfa-aparat-slider-item-details {
  padding: 15px 18px; /* Smaller padding for sidebar */
  background: linear-gradient(135deg, #252626 0%, #1b1a1b 100%);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.phyfa-aparat-slider-item-title {
  font-size: 0.9em; /* Smaller for sidebar */
  color: #fffcf2;
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
  /* For multi-line truncation if needed */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  max-height: 2.8em; /* Adjust based on font-size and line-height (0.9em * 1.4 * 2) */
  transition: color 0.3s ease;
}
.phyfa-aparat-slider-item-link:hover .phyfa-aparat-slider-item-title {
  color: var(--phyfa-primary-color, #f89b29);
}

/* Swiper Navigation & Pagination for Aparat Slider */
.phyfa-aparat-related-slider-wrapper .swiper-button-next,
.phyfa-aparat-related-slider-wrapper .swiper-button-prev {
  color: var(--phyfa-primary-color, #e65717);
  background-color: rgba(30, 31, 30, 0.7);
  border-radius: 50%;
  width: 34px; /* Smaller for sidebar */
  height: 34px;
  border: 1px solid #444;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  margin-top: -22px; /* Adjust if items have varying heights, or use top:50% with transform */
}
.phyfa-aparat-related-slider-wrapper .swiper-button-next:hover,
.phyfa-aparat-related-slider-wrapper .swiper-button-prev:hover {
  background-color: var(--phyfa-primary-color, #e65717);
  color: #fffcf2;
  border-color: var(--phyfa-primary-darker, #f89b29);
  transform: scale(1.1);
}
.phyfa-aparat-related-slider-wrapper .swiper-button-next { left: 5px; right: auto; }
.phyfa-aparat-related-slider-wrapper .swiper-button-prev { right: 5px; left: auto; }

.phyfa-aparat-related-slider-wrapper .swiper-button-next::after,
.phyfa-aparat-related-slider-wrapper .swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: bold;
}

.phyfa-aparat-related-slider-wrapper .swiper-pagination {
  bottom: 8px !important; /* Closer to bottom for sidebar */
}
.phyfa-aparat-related-slider-wrapper .swiper-pagination-bullet {
  background: #777;
  opacity: 0.5;
  width: 8px; /* Smaller bullets */
  height: 8px;
  margin: 0 4px !important;
}
.phyfa-aparat-related-slider-wrapper .swiper-pagination-bullet-active {
  background: var(--phyfa-primary-color, #e65717);
  opacity: 1;
  transform: scale(1.1);
}
/* --- END: Aparat Related Videos Slider Styles --- */

/* --- START: PhysX-Pulse (Video Quiz) Styles --- */

.phyfa-video-quiz-container {
    margin-top: 30px;
    padding: 25px;
    background: var(--phyfa-background-darker, #1e1e1e);
    border-radius: var(--phyfa-border-radius-large, 12px);
    border: 1px solid var(--phyfa-background-light, #333);
}

.phyfa-video-quiz-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    position: relative;
}
.phyfa-video-quiz-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--phyfa-primary-color, #e65717), transparent);
}

.phyfa-video-quiz-header h3 {
    font-family: var(--phyfa-font-primary);
    font-weight: 600;
    font-size: 1.5em;
    color: var(--phyfa-primary-color, #e65717);
    margin: 0 0 10px 0;
}

.phyfa-video-quiz-header p {
    font-family: var(--phyfa-font-primary);
    font-size: 1em;
    color: var(--phyfa-text-gray, #aaa);
    margin: 0;
}

/* Inherit quiz form styles from PhysX for consistency */
.phyfa-video-quiz-container .phyfa-form {
    padding: 0;
    background: none;
    border: none;
    margin-bottom: 0;
}

.phyfa-video-quiz-container .phyfa-questions {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

/* Individual question styling is inherited from PhysX core styles */
/* Ensure phyfa-physx-styles.css is loaded or copy relevant styles here if needed */
/* For example: .phyfa-question, .phyfa-question-title, .phyfa-options, .phyfa-option */

.phyfa-video-quiz-container .phyfa-submit-video-quiz {
    width: 100%;
    box-sizing: border-box;
}

.phyfa-video-quiz-login-prompt {
    text-align: center;
    padding: 20px;
    background-color: var(--phyfa-background-darker);
    border: 1px dashed var(--phyfa-background-light);
    color: var(--phyfa-text-gray);
    border-radius: var(--phyfa-border-radius-medium);
    margin-top: 30px;
}

/* --- END: PhysX-Pulse (Video Quiz) Styles --- */