/**
 * Smoothbox 2026 - Stylisation moderne pour boîtes de dialogue/modale
 * Design cohérent avec SportPRO 2026
 */

/* Overlay de la modale */
.smoothboxOverlay,
#smoothboxOverlay,
#TB_overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    z-index: 9998 !important;
    animation: fadeIn 0.2s ease-out;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Container principal du smoothbox */
.smoothbox,
#smoothboxContent,
#TB_window {
    position: fixed !important;
    z-index: 9999 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 95vw !important;
    max-height: 95vh !important;
    overflow: visible !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: slideIn 0.3s ease-out;
    padding: 0 !important;
    padding-bottom: 20px !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -48%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* En-tête du smoothbox */
.smoothboxHeader,
.sb-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smoothboxHeader h2,
.sb-header h2,
.smoothboxHeader h3,
.sb-header h3 {
    margin: 0;
    padding: 0;
    color: #114b7a;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Bouton de fermeture */
.smoothboxClose,
.sb-close,
#smoothboxClose {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: #f0f6fb;
    border: 1px solid #d7e4ef;
    border-radius: 8px;
    color: #114b7a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 10;
}

.smoothboxClose:hover,
.sb-close:hover,
#smoothboxClose:hover {
    background: #114b7a;
    color: #ffffff;
    border-color: #114b7a;
}

/* Corps du smoothbox */
.smoothboxBody,
.sb-body {
    padding: 28px;
    color: #23384d;
    line-height: 1.6;
    max-height: calc(95vh - 120px);
    overflow-y: auto;
}

/* Pied du smoothbox */
.smoothboxFooter,
.sb-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Contenu du smoothbox */
.smoothboxContent,
.sb-content {
    padding: 0;
}

/* Tables dans le smoothbox */
.smoothboxBody table,
.sb-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.smoothboxBody table th,
.sb-body table th {
    background: #f0f6fb;
    color: #114b7a;
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid #d7e4ef;
}

.smoothboxBody table td,
.sb-body table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.smoothboxBody table tbody tr:hover,
.sb-body table tbody tr:hover {
    background: #f9fafb;
}

/* Listes dans le smoothbox */
.smoothboxBody ul,
.smoothboxBody ol,
.sb-body ul,
.sb-body ol {
    margin-bottom: 16px;
    margin-left: 24px;
}

.smoothboxBody li,
.sb-body li {
    margin-bottom: 8px;
    color: #374151;
}

/* Titres dans le smoothbox */
.smoothboxBody h2,
.smoothboxBody h3,
.smoothboxBody h4,
.sb-body h2,
.sb-body h3,
.sb-body h4 {
    color: #114b7a;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 700;
}

.smoothboxBody h2 {
    font-size: 1.5rem;
    margin-top: 24px;
}

.smoothboxBody h3 {
    font-size: 1.25rem;
}

.smoothboxBody h4 {
    font-size: 1.1rem;
}

/* Paragraphes */
.smoothboxBody p,
.sb-body p {
    margin-bottom: 12px;
    color: #23384d;
}

/* Boutons dans le smoothbox */
.smoothboxBody .sp2026-btn-primary,
.smoothboxBody .sp2026-btn-interne,
.sb-body .sp2026-btn-primary,
.sb-body .sp2026-btn-interne {
    display: inline-block;
    margin-right: 8px;
}

/* Info box */
.smoothboxBody .infoBox,
.sb-body .infoBox {
    padding: 16px;
    background: #e8f5ff;
    border-left: 4px solid #0f8bd8;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #063f67;
}

/* Alert box */
.smoothboxBody .alertBox,
.sb-body .alertBox {
    padding: 16px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #92400e;
}

/* Success box */
.smoothboxBody .successBox,
.sb-body .successBox {
    padding: 16px;
    background: #dcfce7;
    border-left: 4px solid #22c55e;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #166534;
}

/* Code block */
.smoothboxBody code,
.sb-body code {
    background: #f3f4f6;
    color: #374151;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.smoothboxBody pre,
.sb-body pre {
    background: #f3f4f6;
    color: #374151;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    line-height: 1.4;
}

.smoothboxBody pre code,
.sb-body pre code {
    background: transparent;
    padding: 0;
}

/* Scrollbar personnalisée */
.smoothboxBody::-webkit-scrollbar,
.sb-body::-webkit-scrollbar {
    width: 8px;
}

.smoothboxBody::-webkit-scrollbar-track,
.sb-body::-webkit-scrollbar-track {
    background: #f0f6fb;
}

.smoothboxBody::-webkit-scrollbar-thumb,
.sb-body::-webkit-scrollbar-thumb {
    background: #0f8bd8;
    border-radius: 4px;
}

.smoothboxBody::-webkit-scrollbar-thumb:hover,
.sb-body::-webkit-scrollbar-thumb:hover {
    background: #0a5fa3;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .smoothbox,
    #smoothboxContent {
        max-width: 90vw;
        max-height: 90vh;
        margin: auto;
    }
    
    .smoothboxHeader,
    .sb-header {
        padding: 20px 20px;
    }
    
    .smoothboxBody,
    .sb-body {
        padding: 20px;
        max-height: calc(90vh - 100px);
    }
    
    .smoothboxHeader h2,
    .sb-header h2,
    .smoothboxHeader h3,
    .sb-header h3 {
        font-size: 1.25rem;
    }
    
    .smoothboxClose,
    .sb-close,
    #smoothboxClose {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }
}

@media screen and (max-width: 480px) {
    .smoothbox,
    #smoothboxContent {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        transform: translate(-50%, 0);
    }
    
    .smoothboxBody,
    .sb-body {
        max-height: calc(100vh - 100px);
    }
}

/* Styles pour ThickBox (TB_*) - compatibilité avec l'ancien système */
#TB_HideSelect {
    position: fixed !important;
    z-index: 9997 !important;
    top: 0 !important;
    left: 0 !important;
}

#TB_load {
    position: fixed !important;
    z-index: 10000 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

#TB_window {
    background: #ffffff !important;
    color: #23384d !important;
    border: none !important;
    border-radius: 16px !important;
}

#TB_title {
    padding: 12px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

#TB_ajaxWindowTitle {
    color: #114b7a !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#TB_ajaxContent {
    color: #23384d !important;
    line-height: 1.6 !important;
    width:100% !important;
    height:100% !important;
    /*max-height: calc(95vh - 120px) !important;*/
    overflow-y: auto !important;
}

#TB_caption {
    padding: 12px 20px !important;
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    color: #374151 !important;
    font-size: 0.95rem !important;
}

#TB_closeWindow {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 10 !important;
}

#TB_closeWindowButton,
#TB_closeAjaxWindow a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: #f0f6fb !important;
    border: 1px solid #d7e4ef !important;
    border-radius: 8px !important;
    color: #114b7a !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-size: 24px !important;
    line-height: 1 !important;
}

#TB_closeWindowButton:hover,
#TB_closeAjaxWindow a:hover {
    background: #114b7a !important;
    color: #ffffff !important;
    border-color: #114b7a !important;
}

#TB_iframeContent {
    width:100% !important;
    height:100% !important;
    background: #ffffff !important;
    border: none !important;
}

/* Désactiver l'animation si préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .smoothbox,
    #smoothboxContent,
    .smoothboxOverlay,
    #smoothboxOverlay,
    #TB_overlay,
    #TB_window {
        animation: none;
    }
}
