/* =========================================
   TOOL DETAIL PAGE - LAYOUT 30/70
========================================= */

.section-tool-detail {
    padding: 40px 0 60px;
    background: var(--gray-50);
    min-height: calc(100vh - 200px);
}

.container-full {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.tool-detail-grid {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 30px;
    align-items: start;
}

/* =========================================
   LEFT SIDEBAR - 30%
========================================= */

.tool-info-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 100px;
}

.tool-logo-container {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.tool-logo-container img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-md);
}

.tool-description {
    margin-bottom: 30px;
}

.tool-description h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tool-description p {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 1rem;
}

.tool-links {
    margin-bottom: 30px;
}

.tool-links .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    font-size: 1.05rem;
}

.tool-meta {
    border-top: 2px solid var(--gray-100);
    padding-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.meta-item i {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

/* =========================================
   RIGHT CONTENT AREA - 70%
========================================= */

.tool-content-main {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 600px;
}

#content-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
}

/* Loading State */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    padding: 60px 20px;
}

.loading-content .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-content p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   VIDEO CONTENT
========================================= */

.video-content {
    width: 100%;
    padding: 30px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================
   PDF CONTENT - SINGLE PAGE MODE
========================================= */

.pdf-content {
    width: 100%;
    padding: 30px;
}

.pdf-viewer-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pdf-controls-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: var(--gray-50);
    padding: 15px 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.pdf-controls-simple button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.pdf-controls-simple button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.pdf-controls-simple button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pdf-page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.pdf-page-info .current-page {
    color: var(--primary-blue);
    font-size: 20px;
}

.pdf-canvas-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
}

#pdf-canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Bouton son actif/inactif */
.pdf-controls-simple button.sound-active {
    background: #2ecc71;
}

.pdf-controls-simple button.sound-active:hover {
    background: #27ae60;
}

.pdf-controls-simple button:not(.sound-active) {
    background: #e74c3c;
}

.pdf-controls-simple button:not(.sound-active):hover {
    background: #c0392b;
}

/* =========================================
   IMAGE CONTENT - SCREENSHOT (RATIO 16:9 COMME VIDÉO)
========================================= */

.image-content {
    width: 100%;
    padding: 30px;
}

.image-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 comme les vidéos */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--gray-100);
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Contient l'image sans déformation */
    display: block;
    background: var(--white);
}

.image-caption {
    text-align: center;
    margin-top: 20px;
    color: var(--gray-600);
    font-size: 0.95rem;
    font-style: italic;
}
/* =========================================
   MODE PLEIN ÉCRAN - CORRECTION COMPLÈTE
========================================= */

.pdf-content.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background: #1a1a1a !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pdf-content.fullscreen-active .pdf-viewer-simple {
    width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.pdf-content.fullscreen-active .pdf-controls-simple {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.pdf-content.fullscreen-active .pdf-canvas-container {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: calc(100vh - 80px) !important;
    max-width: none !important;
    padding: 70px 20px 20px !important;
    overflow: hidden !important;
    background: #1a1a1a !important;
}

.pdf-content.fullscreen-active #pdf-canvas {
    max-width: 90% !important;
    max-height: 90% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8) !important;
}

/* =========================================
   RESPONSIVE - TABLET
========================================= */

@media (max-width: 1024px) {
    .tool-detail-grid {
        grid-template-columns: 35% 65%;
        gap: 20px;
    }

    .tool-info-sidebar {
        padding: 25px;
    }

    .tool-logo-container img {
        max-width: 150px;
    }
}

/* =========================================
   RESPONSIVE - MOBILE
========================================= */

@media (max-width: 768px) {
    .tool-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tool-info-sidebar {
        position: relative;
        top: 0;
        padding: 20px;
    }

    .tool-logo-container img {
        max-width: 120px;
    }

    .tool-content-main {
        min-height: 400px;
    }

    #content-container {
        min-height: 400px;
    }

    .video-content,
    .pdf-content,
    .image-content {
        padding: 15px;
    }

    .pdf-controls-simple {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 10px;
    }

    .pdf-controls-simple button {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* =========================================
   PAGE HEADER ADJUSTMENT
========================================= */

.page-header .btn {
    margin-top: 20px;
}