/* Variables globales */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-radius: 8px;
}

/* Styles généraux */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Cards */
.card:not(.stats-card) {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-radius: var(--border-radius);
}

.card:not(.stats-card):hover {
    transform: translateY(-5px);
}

.card-img-top {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    height: 200px;
    object-fit: cover;
}

/* Boutons */
.btn {
    border-radius: 20px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
    border-color: darken(var(--primary-color), 10%);
}

.category-filter {
    font-size: 0.9rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

.category-filter.active {
    background-color: var(--primary-color);
    color: white;
}

/* Cards de statistiques */
.stats-card {
    border: none;
    margin-bottom: 1rem;
}

.stats-card.bg-primary {
    background-color: #0d6efd !important;
}

.stats-card.bg-warning {
    background-color: #ffc107 !important;
}

.stats-card.bg-info {
    background-color: #0dcaf0 !important;
}

.stats-card.bg-success {
    background-color: #198754 !important;
}

.stats-card.bg-danger {
    background-color: #dc3545 !important;
}

.stats-card.bg-secondary {
    background-color: #6c757d !important;
}

.stats-card .card-title,
.stats-card .card-text {
    color: inherit !important;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .card-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stats-card .card-text {
    margin-bottom: 0;
    font-weight: bold;
}

.stats-card:hover {
    transform: none;
}

/* Footer */
footer {
    border-top: 1px solid #eee;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-color);
}

/* Styles pour les alertes */
#alert-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}

#alert-container .alert {
    max-width: 600px;
    width: 100%;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#alert-container .alert.fade {
    animation: slideUp 0.3s ease-in forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Styles pour la section JSON */
#json-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    min-height: 200px;
}

#jsonSection .card {
    border-top: 3px solid #6c757d;
}

#jsonSection .text-muted ul {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

#jsonSection .text-muted li {
    margin-bottom: 0.25rem;
}

/* Styles pour les cartes d'avatars */
.avatar-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.avatar-preview {
    position: relative;
    height: 300px;
    background-color: #f8f9fa;
    margin-bottom: 0;
}

.avatar-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.avatar-image-container:hover {
    overflow: visible;
}

.avatar-image-container:hover .avatar-image {
    transform: scale(2);
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    position: relative;
    z-index: 9999;
}

.card-body {
    flex: 0 0 auto;
    padding: 1rem;
    position: relative;
    background: white;
}

/* Style pour s'assurer que les modals restent au-dessus des images zoomées */
.modal {
    z-index: 10000;
}

/* Ajout d'un style pour gérer la superposition des cartes */
.col {
    position: relative;
    z-index: 1;
}

.col:hover {
    z-index: 2;
}

/* Styles pour les vidéos responsives */
.ratio {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.ratio iframe,
.ratio video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Styles pour les modals d'avatars */
.modal-body .ratio {
    padding-bottom: 56.25%;
}

.modal-body video {
    width: 100%;
    height: 100%;
}

.card-body .card-title {
    margin-bottom: 0.5rem;
}

.card-body .card-text small {
    font-size: 0.875rem;
}

.btn-primary.w-100 {
    width: 100%;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-content .modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-content .modal-header .modal-title {
    margin-bottom: 0;
}

.modal-content .modal-header .btn-close {
    margin: -1rem -1rem -1rem auto;
}

.modal-content .modal-body {
    padding: 1rem;
}

.modal-content .modal-body .ratio {
    padding-bottom: 56.25%;
}

.modal-content .modal-body video {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-img-top {
        height: 150px;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styles pour le menu déroulant des voix */
.avatar-thumbnail {
    width: 120px;
    height: 80px;
    margin-right: 10px;
    object-fit: cover;
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: auto !important;
    padding: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding: 0;
}

.select2-results__option {
    padding: 4px 8px !important;
    min-height: 60px;
}

.select2-option {
    display: flex;
    align-items: center;
    min-height: 50px;
}

.select2-option-text {
    margin-left: 10px;
    font-size: 14px;
}

/* Style pour l'option sélectionnée */
.select2-container--default .select2-selection--single {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    display: flex;
    align-items: center;
}

select option {
    padding: 4px;
    display: flex;
    align-items: center;
}

/* Styles pour les alertes */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.alert.alert-danger {
    background-color: #fff2f2;
    border: 1px solid #dc3545;
    color: #dc3545;
    font-family: monospace;
}

.alert.alert-success {
    background-color: #f2fff2;
    border: 1px solid #198754;
    color: #198754;
}

/* Styles pour les conteneurs de boutons */
.button-container {
    position: relative;
    width: 100%;
}

.action-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

#save-alert,
#order-alert {
    width: 100%;
    margin-top: 8px;
}