/* ===== MEDIA WRAPPER ===== */
.media-wrapper {
    width: 320px;
    height: 350px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* AJOUT: pour permettre le positionnement absolu du lien */
}

/* Lien Cours sur l'image */
.cours-link {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cours-link:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===== VIDEO & IMAGES ===== */
video, img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Specific for quizzquestion page */
#quizContainer video,
#quizContainer img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== BUTTONS ===== */
.buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    gap: 12px;
    margin: auto;
}

button {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow);
    max-width: 380px;
    width: 250px;
    margin: auto;
}

button:hover {
    transform: translateY(-2px);
}

button.secondary {
    background: #e8ecf5;
    color: #333;
}

button.secondary:hover {
    background: #d9e0ee;
}

button.hidden {
    display: none !important;
}

button.pulse {
    animation: pulse 2s infinite;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(108, 100, 223, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(245, 87, 108, 0);
    }
}

/* ===== LOADING RING ===== */
.ring {
    background: #262626;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 3px solid #3c3c3c;
    border-radius: 50%;
    text-align: center;
    line-height: 150px;
    font-family: sans-serif;
    font-size: 20px;
    color: #fff000;
    letter-spacing: 4px;
    text-shadow: 0 0 10px #fff000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.ring:before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #fff000;
    border-right: 3px solid #fff000;
    border-radius: 50%;
    animation: animateC 2s linear infinite;
}

.waitring {
    display: block;
    position: absolute;
    top: calc(50% - 2px);
    left: 50%;
    width: 50%;
    height: 4px;
    background: transparent;
    transform-origin: left;
    animation: animate 2s linear infinite;
}

.waitring:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff000;
    top: -6px;
    right: -8px;
    box-shadow: 0 0 20px #fff000;
}

@keyframes animateC {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes animate {
    0% {
        transform: rotate(45deg);
    }
    100% {
        transform: rotate(405deg);
    }
}

/* ===== QUIZ CONTAINER ===== */
#quizContainer {
    width: 100%;
    max-width: 380px;
    padding: 25px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.question {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choices button:hover {
    background: #d9e0ee;
    transform: translateY(-2px);
}

.choices button.correct {
    background: #4CAF50 !important;
    color: white;
}

.choices button.wrong {
    background: #E53935 !important;
    color: white;
}

.feedback {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 700;
    min-height: 24px;
    text-align: center;
}

/* ===== NEXT BUTTON ===== */
#nextBtn {
    margin-top: 25px;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: none;
    box-shadow: var(--shadow);
    transition: 0.2s;
}

#nextBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== HOME BUTTON ===== */
#homeBtn {
    margin-top: 30px;
    margin-bottom: 10px;
    padding: 14px 20px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: #e8ecf5;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: 0.2s;
}

#homeBtn:hover {
    background: #d9e0ee;
    transform: translateY(-2px);
}

/* ===== SHARE BUTTON ===== */
#shareBtn {
    margin-top: 15px;
    width: 100%;
    max-width: 380px;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: 0.2s ease-in-out;
}

#shareBtn:hover {
    transform: translateY(-2px);
}

/* ===== POPUP ===== */
.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup-content {
    width: 100%;
    max-width: 340px;
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.popup-content h3 {
    margin-top: 0;
    color: var(--primary);
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.popup-buttons button,
.closePopup {
    padding: 12px;
    background: #e8ecf5;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: 0.15s ease-in-out;
}

.popup-buttons button:hover,
.closePopup:hover {
    background: #d9e0ee;
    transform: translateY(-2px);
}

.closePopup {
    margin-top: 15px;
}

/* ===== CATEGORIES ===== */
.categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 15px 0;
}

.category {
    background: #eee;
    padding: 4px 8px;
    font-size: 0.78rem;
    border-radius: 6px;
    color: #333;
}

/* ===== NUMBER OF QUESTIONS ===== */
.nbquestion {
    padding: 14px;
}

/* ===== SPLIT TEXT ANIMATION ===== */
.split-text-container {
    display: flex;
    padding: 5px;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    color: #000;
    overflow: hidden;
}

.text-part {
    display: inline-block;
    position: relative;
    transform: translateX(0);
    animation-duration: 2s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

.text-part.left {
    transform: translateX(-200%);
    animation-name: slide-in-left;
}

.text-part.right {
    transform: translateX(200%);
    animation-name: slide-in-right;
}

@keyframes slide-in-left {
    0% {
        transform: translateX(-200%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    0% {
        transform: translateX(200%);
    }
    100% {
        transform: translateX(0);
    }
}

/* ===== GALLERY (from getQuizzList) ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px;
}

.item-link {
    text-decoration: none !important;
    color: inherit;
}

a.item-link {
    text-decoration: none !important;
}

.item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding-bottom: 15px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.item img {
    width: 100%;
    height: auto;
    display: block;
}

.item h3 {
    font-size: 1.1rem;
    padding: 15px;
    margin: 0;
}

.item .date {
    font-size: 0.8rem;
    color: #777;
    padding: 10px 15px;
}

.item button {
    margin: 10px 15px 0;
    padding: 10px 15px;
    background: #007BFF;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.item button:hover {
    background: #005fcc;
}



        /* Overlay de la popup */
        .popup-overlay {
            display: none;
            position: fixed;
            top: 0;
            width: 90%;
            height: 100%;
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        
        .popup-overlay.active {
            display: flex;
        }
        
        /* Contenu de la popup */
        .popup-content {
            background: white;
            padding: 40px;
            border-radius: 16px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            text-align: center;
            position: relative;
            max-width: 400px;
            animation: slideIn 0.3s ease-out;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .close-button {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            font-size: 24px;
            color: #999;
            cursor: pointer;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.2s, color 0.2s;
        }
        
        .close-button:hover {
            background: #f0f0f0;
            color: #333;
        }
        
        .rating-title {
            font-size: 22px;
            color: #333;
            margin-bottom: 25px;
            font-weight: 500;
        }
        
        .stars {
            display: flex;
            gap: 10px;
            justify-content: center;
        }
        
        .star {
            font-size: 45px;
            cursor: pointer;
            color: #ddd;
            transition: color 0.2s, transform 0.2s;
            user-select: none;
        }
        
        .star:hover {
            transform: scale(1.15);
        }
        
        .star.active {
            color: #ffc107;
        }
        
        .star.hover {
            color: #ffc107;
        }

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-weight: bold;
  margin: auto;
}

/* Switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

/* Hide checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #888;
  transition: .4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

/* Checked = Public */
input:checked + .slider {
  background-color: #2ecc71;
}

input:checked + .slider:before {
  transform: translateX(24px);
}



.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: black;
}

.pageactive {
    background: var(--primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
}

/*

 <div class="ratings">
        <span class="rating-value"><?php echo number_format($item['ratings']['average_rating'], 1); ?>/5</span>
        <span class="rating-stars">
            <?php for ($i = 1; $i <= 5; $i++): ?>
                <span class="star <?php echo ($i <= round($item['ratings']['average'])) ? 'filled' : ''; ?>">★</span>
            <?php endfor; ?>
        </span>
        <span class="rating-count">(<?php echo $item['ratings']['ratings']; ?> votes)</span>
    </div>
*/

.ratings {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 0px 15px;
}
.rating-value {
    font-weight: 600;
    color: #333;
}
.rating-stars .star {
    color: #ccc;
    font-size: 16px;
}
.rating-stars .star.filled {
    color: #f39c12;
}
.rating-count {
    color: #777;
}

.authorquiz:before {
    content: "👤";
    margin-right: 6px;
}

.authorquiz {
    font-size: 0.8rem;
    color: black;
    padding: 0px 15px;
}

.authorquiz a {
    text-decoration: none !important;
    color: black;
}

 .intro { font-size: 1.1em; background: #f0f4ff; border-radius: 8px; padding: 20px 24px; margin: 20px 0; }
    .step { display: flex; gap: 16px; margin: 18px 0; }
    .step-num { font-size: 2em; font-weight: bold; color: #4f8ef7; min-width: 40px; }
    .step-content h3 { margin: 0 0 6px 0; }
    .faq-item { border-bottom: 1px solid #e0e0e0; padding: 16px 0; }
    .faq-item strong { display: block; margin-bottom: 6px; font-size: 1.05em; color: #16213e; }
    .use-case { background: #f8f9ff; border-radius: 8px; padding: 16px 20px; margin: 12px 0; }
    .use-case h3 { margin: 0 0 6px 0; color: #4f8ef7; }
    .subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
    .subject-tag { background: #eef2ff; border-radius: 6px; padding: 10px 14px; text-align: center; font-weight: bold; color: #3a5bd9; font-size: 0.95em; }
    .tip-box { background: #fffbe6; border-left: 4px solid #f5c518; padding: 14px 20px; border-radius: 4px; margin: 20px 0; }
    .cta-box { background: #4f8ef7; color: white; border-radius: 10px; padding: 28px; text-align: center; margin: 40px 0; }
    .cta-box h2 { color: white; border: none; padding: 0; }
    .cta-box p { font-size: 1.1em; margin: 10px 0 0 0; }
    table { width: 100%; border-collapse: collapse; margin: 20px 0; }
    th { background: #4f8ef7; color: white; padding: 12px; text-align: left; }
    td { padding: 11px 12px; border-bottom: 1px solid #e8e8e8; }
    tr:nth-child(even) td { background: #f6f8ff; }
    .section-divider { border: none; border-top: 2px solid #e8eaf6; margin: 40px 0; }
    blockquote { border-left: 4px solid #4f8ef7; margin: 20px 0; padding: 12px 20px; background: #f4f7ff; font-style: italic; color: #444; }

    /* Bouton + sticky mobile */
.search-button {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  background-color: #ff7b00;
  color: white;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  line-height: 56px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 9999;
  display: none;
  /* Ajout pour le positionnement du texte */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: 1;
  padding-top: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='22' y2='22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}



.bikub-share-container {
            position: fixed;
            bottom: 30px;
            left: 20px;
            z-index: 9999;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
        }

        .bikub-share-main-btn {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ff7b00 0%, #ff7b00 100%);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            position: relative;
        }

        .bikub-share-main-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        .bikub-share-main-btn.active {
            background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        }

        .bikub-share-icon {
            width: 24px;
            height: 24px;
            fill: white;
        }

        .bikub-share-menu {
            position: absolute;
            bottom: 140px;
            left: 0;
            display: flex;
            flex-direction: column;
            gap: 12px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: all 0.3s ease;
        }

        .bikub-share-menu.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .bikub-social-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            animation: bikubSlideIn 0.3s ease forwards;
            opacity: 0;
            position: relative;
        }

        @keyframes bikubSlideIn {
            to {
                opacity: 1;
            }
        }

        .bikub-social-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        }

        .bikub-social-btn.whatsapp {
            background-color: #25D366;
            animation-delay: 0.05s;
        }

        .bikub-social-btn.facebook {
            background-color: #1877F2;
            animation-delay: 0.1s;
        }

        .bikub-social-btn.twitter {
            background-color: #000000;
            animation-delay: 0.15s;
        }

        .bikub-social-btn.linkedin {
            background-color: #0A66C2;
            animation-delay: 0.2s;
        }

        .bikub-social-btn.telegram {
            background-color: #0088cc;
            animation-delay: 0.25s;
        }

        .bikub-social-btn.email {
            background-color: #EA4335;
            animation-delay: 0.3s;
        }

        .bikub-social-icon {
            width: 24px;
            height: 24px;
            fill: white;
        }

        .bikub-social-btn::before {
            content: attr(data-tooltip);
            position: absolute;
            left: 60px;
            background-color: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            white-space: nowrap;
            font-size: 14px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .bikub-social-btn:hover::before {
            opacity: 1;
        }

        @media (max-width: 768px) {
            .bikub-share-container {
                bottom: 20px;
                left: 20px;
            }
            
            .bikub-share-main-btn {
                width: 56px;
                height: 56px;
            }
            
            .bikub-social-btn {
                width: 45px;
                height: 45px;
            }
        }
