/**
 * Premium Theme - Theme Settings Dynamic CSS
 * Styles pour les paramètres configurables du thème premium
 * Ces styles peuvent être activés/désactivés via la configuration du thème
 */

/* ============================================
   LAYOUT STYLES
   ============================================ */

/* Layout Wide */
.layout-wide .container {
    max-width: 1400px !important;
}

/* Layout Centered */
.layout-centered .container {
    max-width: 960px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Layout Compact */
.layout-compact .container {
    max-width: 960px !important;
}

/* ============================================
   NAVBAR STYLES
   ============================================ */

/* Navbar Glass */
.navbar-glass {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .navbar-glass {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Solid */
.navbar-solid {
    background: var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navbar Transparent */
.navbar-transparent {
    background: transparent !important;
    box-shadow: none !important;
}

.navbar-transparent .navbar-brand,
.navbar-transparent .nav-link {
    color: inherit !important;
}

/* ============================================
   CARD STYLES
   ============================================ */

/* Card Bordered */
.card-bordered {
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.card-bordered:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

html body.no-shadows .card-bordered:hover {
    box-shadow: none !important;
}

/* Card Elevated */
.card-elevated {
    border: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.card-elevated:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
}

html body.no-shadows .card-elevated,
html body.no-shadows .card-elevated:hover {
    box-shadow: none !important;
}

/* Card Minimal */
.card-minimal {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

.card-minimal .card-header,
.card-minimal .card-body {
    background: transparent !important;
    padding: 0.5rem;
}

/* ============================================
   FONT SIZE STYLES
   ============================================ */

.font-size-0-8x {
    font-size: 0.8rem !important;
}

.font-size-0-9x {
    font-size: 0.9rem !important;
}

.font-size-1x {
    font-size: 1rem !important;
}

.font-size-1-1x {
    font-size: 1.1rem !important;
}

.font-size-1-2x {
    font-size: 1.2rem !important;
}

.font-size-1-5x {
    font-size: 1.5rem !important;
}

/* ============================================
   BORDER RADIUS STYLES (Limité aux éléments spécifiés)
   ============================================ */

.border-radius-0-5x .badge,
.border-radius-0-5x .flatboard-tag,
.border-radius-0-5x #back-to-top,
.border-radius-0-5x .btn,
.border-radius-0-5x #header-search-input {
    border-radius: 0.25rem !important;
}

.border-radius-0-75x .badge,
.border-radius-0-75x .flatboard-tag,
.border-radius-0-75x #back-to-top,
.border-radius-0-75x .btn,
.border-radius-0-75x #header-search-input {
    border-radius: 0.375rem !important;
}

.border-radius-1x .badge,
.border-radius-1x .flatboard-tag,
.border-radius-1x #back-to-top,
.border-radius-1x .btn,
.border-radius-1x #header-search-input {
    border-radius: 0.5rem !important;
}

.border-radius-1-25x .badge,
.border-radius-1-25x .flatboard-tag,
.border-radius-1-25x #back-to-top,
.border-radius-1-25x .btn,
.border-radius-1-25x #header-search-input {
    border-radius: 0.5rem !important;
}

.border-radius-1-5x .badge,
.border-radius-1-5x .flatboard-tag,
.border-radius-1-5x #back-to-top,
.border-radius-1-5x .btn,
.border-radius-1-5x #header-search-input {
    border-radius: 0.75rem !important;
}

.border-radius-2x .badge,
.border-radius-2x .flatboard-tag,
.border-radius-2x #back-to-top,
.border-radius-2x .btn,
.border-radius-2x #header-search-input {
    border-radius: 50rem !important;
}

/* ============================================
   SPACING STYLES
   ============================================ */

.spacing-0-8x {
    --spacing-xs: 0.2rem;
    --spacing-sm: 0.4rem;
    --spacing-md: 0.8rem;
    --spacing-lg: 1.2rem;
    --spacing-xl: 1.6rem;
}

.spacing-0-9x {
    --spacing-xs: 0.225rem;
    --spacing-sm: 0.45rem;
    --spacing-md: 0.9rem;
    --spacing-lg: 1.35rem;
    --spacing-xl: 1.8rem;
}

.spacing-1x {
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

.spacing-1-1x {
    --spacing-xs: 0.275rem;
    --spacing-sm: 0.55rem;
    --spacing-md: 1.1rem;
    --spacing-lg: 1.65rem;
    --spacing-xl: 2.2rem;
}

.spacing-1-2x {
    --spacing-xs: 0.3rem;
    --spacing-sm: 0.6rem;
    --spacing-md: 1.2rem;
    --spacing-lg: 1.8rem;
    --spacing-xl: 2.4rem;
}

.spacing-1-5x {
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.25rem;
    --spacing-xl: 3rem;
}

/* ============================================
   GRADIENT STYLES
   ============================================ */

.enable-gradients .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
}

.enable-gradients .card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.enable-gradients .flatboard-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.enable-gradients .navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Désactiver gradients quand no-gradients est actif */
body.no-gradients .btn-primary,
body.no-gradients .btn-secondary,
body.no-gradients .badge.bg-primary,
body.no-gradients .badge.bg-secondary,
body.no-gradients .navbar,
body.no-gradients .flatboard-banner,
body.no-gradients .card-header,
body.no-gradients #back-to-top {
    background: var(--bs-primary) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ============================================
   SHADOW STYLES
   ============================================ */

.enable-shadows .card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.enable-shadows .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.enable-shadows .flatboard-discussion-item {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Styles pour disable_shadows - Version avec haute spécificité */
html body.no-shadows,
.no-shadows .card,
.no-shadows .btn,
.no-shadows .flatboard-discussion-item,
.no-shadows .post-item,
.no-shadows .navbar,
.no-shadows .flatboard-actions-card,
.no-shadows .post-navigation-flatboard,
.no-shadows .posts-list-flatboard,
.no-shadows .reply-form-flatboard,
.no-shadows .discussion-actions,
.no-shadows .flatboard-start-discussion,
.no-shadows .category-card,
.no-shadows .category-item,
.no-shadows .flatboard-sidebar-stats,
.no-shadows .flatboard-banner,
.no-shadows #back-to-top,
.no-shadows .modal-content,
.no-shadows .dropdown-menu,
.no-shadows .alert,
.no-shadows .nav-tabs .nav-link,
.no-shadows .pagination .page-link,
.no-shadows .flatboard-user-tooltip,
.no-shadows .flatboard-tooltip-content,
.no-shadows .PostQuote,
.no-shadows .reaction-users-tooltip,
.no-shadows .mention-suggestions-dropdown,
.no-shadows .flatboard-tag,
.no-shadows .flatboard-tag-banner,
.no-shadows .tag-btn,
.no-shadows .new-discussion-btn,
.no-shadows .btn-new-discussion,
.no-shadows .theme-toggle,
.no-shadows .btn-theme,
.no-shadows [data-bs-theme],
.no-shadows .navbar .btn,
.no-shadows .navbar .nav-link,
.no-shadows .theme-switch-wrapper,
.no-shadows .theme-switch-input,
.no-shadows #header-search-input,
.no-shadows #search-results-dropdown,
.no-shadows #notification-dropdown-menu,
.no-shadows .badge,
.no-shadows .toast,
.no-shadows .popover,
.no-shadows .table,
.no-shadows .progress,
.no-shadows .reaction-btn,
.no-shadows .list-group-item,
.no-shadows .form-control,
.no-shadows .form-select,
.no-shadows .post {
    box-shadow: none !important;
}

html body.no-shadows .card:hover,
html body.no-shadows .btn:hover,
html body.no-shadows .category-card:hover,
html body.no-shadows .flatboard-start-discussion:hover,
html body.no-shadows .reaction-btn:hover,
html body.no-shadows .flatboard-discussion-item:hover,
html body.no-shadows .list-group-item:hover,
html body.no-shadows .nav-tabs .nav-link:hover,
html body.no-shadows .pagination .page-link:hover,
html body.no-shadows .dropdown-item:hover,
html body.no-shadows .form-control:focus,
html body.no-shadows .form-select:focus,
html body.no-shadows #back-to-top:hover,
html body.no-shadows .flatboard-tag:hover,
html body.no-shadows .tag-btn:hover,
html body.no-shadows .new-discussion-btn:hover,
html body.no-shadows .btn-new-discussion:hover,
html body.no-shadows .theme-toggle:hover,
html body.no-shadows .btn-theme:hover,
html body.no-shadows .theme-switch-wrapper:hover,
html body.no-shadows .navbar .btn:hover,
html body.no-shadows .navbar .nav-link:hover,
html body.no-shadows .post-actions-members .btn:hover,
html body.no-shadows .post-actions-moderation .btn:hover {
    box-shadow: none !important;
    transform: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Animations des discussions */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.enable-animations .flatboard-discussion-item {
    animation: slideInFromLeft 0.3s ease-out;
}

/* ============================================
   HEADER SEARCH STYLES
   ============================================ */

#header-search-form {
    position: relative;
    width: 100%;
    max-width: 300px;
}

#header-search-input {
    padding-right: 2.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--bs-body-color);
    transition: all 0.3s ease;
}

#header-search-input:focus {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

#header-search-input::placeholder {
    color: rgba(var(--bs-body-color-rgb), 0.6);
}

[data-theme="dark"] #header-search-input {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #header-search-input:focus {
    background-color: var(--bs-dark);
}

#header-search-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

#header-search-button:hover {
    color: var(--bs-primary);
}

#search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

#search-results-dropdown.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bs-secondary-bg);
}

.search-result-title {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.search-result-excerpt {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--bs-tertiary-color);
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

/* ============================================
   BADGE DE NOTIFICATION
   ============================================ */

/* Position et style de base du badge */
#notification-count,
#notification-count.badge {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 6px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    border-radius: 10px !important;
    background-color: var(--bs-danger, #dc3545) !important;
    color: var(--bs-white, #fff) !important;
    border: 2px solid var(--bs-body-bg, #fff) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease-in-out !important;
    z-index: 1001 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Affiche le badge quand il a du contenu */
#notification-count:not(:empty),
#notification-count.badge:not(:empty) {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Style amélioré pour le badge en mode sombre */
[data-bs-theme="dark"] #notification-count,
[data-bs-theme="dark"] #notification-count.badge {
    border-color: var(--bs-dark, #212529) !important;
}

/* ============================================
   ANIMATIONS DE NOTIFICATION
   ============================================ */

/* 1. ANIMATION PULSE - Pulsation douce et élégante (effet de respiration) */
@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.75;
    }
}

/* 2. ANIMATION BOUNCE - Rebond dynamique */
@keyframes notification-bounce {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    10% {
        transform: scaleX(1.1) scaleY(0.9) translateY(0);
    }
    30% {
        transform: scaleX(0.9) scaleY(1.1) translateY(-12px);
    }
    50% {
        transform: scaleX(1.05) scaleY(0.95) translateY(0);
    }
    65% {
        transform: scale(1) translateY(-6px);
    }
    80% {
        transform: scale(1) translateY(0);
    }
}

/* 3. ANIMATION SHAKE - Tremblement TRÈS visible */
@keyframes notification-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    5% {
        transform: rotate(-10deg);
    }
    15% {
        transform: rotate(10deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    35% {
        transform: rotate(10deg);
    }
    45% {
        transform: rotate(-10deg);
    }
    55% {
        transform: rotate(10deg);
    }
    65% {
        transform: rotate(-8deg);
    }
    75% {
        transform: rotate(8deg);
    }
    85% {
        transform: rotate(-4deg);
    }
    95% {
        transform: rotate(4deg);
    }
}

/* 4. ANIMATION GLOW - Lueur pulsante intense avec halo lumineux */
@keyframes notification-glow {
    0%, 100% {
        box-shadow: 
            0 0 8px 2px rgba(var(--bs-danger-rgb, 220, 53, 69), 0.6),
            0 0 0 0 rgba(var(--bs-danger-rgb, 220, 53, 69), 0.4),
            inset 0 0 8px rgba(255, 255, 255, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 
            0 0 25px 8px rgba(var(--bs-danger-rgb, 220, 53, 69), 1),
            0 0 0 15px rgba(var(--bs-danger-rgb, 220, 53, 69), 0),
            inset 0 0 12px rgba(255, 255, 255, 0.5);
        filter: brightness(1.2);
    }
}

/* ============================================
   CLASSES D'ANIMATION APPLIQUÉES PAR JS
   ============================================ */

/* Animation Pulse - Durée basée sur le niveau d'animation avec timing fluide */
#notification-count.notification-animation-pulse,
#notification-count.badge.notification-animation-pulse {
    animation: notification-pulse var(--notification-animation-duration) cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

/* Animation Bounce - Durée basée sur le niveau d'animation */
#notification-count.notification-animation-bounce,
#notification-count.badge.notification-animation-bounce {
    animation: notification-bounce calc(var(--notification-animation-duration) * 0.8) ease-in-out infinite !important;
}

/* Animation Shake - Durée basée sur le niveau d'animation */
#notification-count.notification-animation-shake,
#notification-count.badge.notification-animation-shake {
    animation: notification-shake calc(var(--notification-animation-duration) * 0.5) ease-in-out infinite !important;
    transform-origin: center center !important;
}

/* Animation Glow - Durée basée sur le niveau d'animation avec timing dynamique */
#notification-count.notification-animation-glow,
#notification-count.badge.notification-animation-glow {
    animation: notification-glow var(--notification-animation-duration) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite !important;
}

/* Aucune animation */
#notification-count.notification-animation-none,
#notification-count.badge.notification-animation-none {
    animation: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* ============================================
   ANIMATIONS AU SURVOL
   ============================================ */

/* Animation de l'icône bell au survol */
@keyframes ring-bell {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-15deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(15deg);
    }
}

#notificationDropdown:hover .fa-bell {
    animation: ring-bell 0.6s ease-in-out !important;
}

/* Effet hover sur le badge - Légère mise en valeur */
#notificationDropdown:hover #notification-count:not(:empty),
#notificationDropdown:hover #notification-count.badge:not(:empty) {
    box-shadow: 0 0 15px rgba(var(--bs-danger-rgb, 220, 53, 69), 0.8) !important;
}

/* ============================================
   RESPONSIVE & ACCESSIBILITÉ
   ============================================ */

/* Ajustements pour petits écrans */
@media (max-width: 576px) {
    #notification-count,
    #notification-count.badge {
        min-width: 18px !important;
        height: 18px !important;
        font-size: 0.6rem !important;
        padding: 0 4px !important;
    }
}

/* Réduction des animations si l'utilisateur préfère moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    #notification-count,
    #notification-count.badge {
        animation: none !important;
    }
    
    #notificationDropdown:hover .fa-bell {
        animation: none !important;
    }
    
    #footer-heart {
        animation: none !important;
    }
}

/* ============================================
   ANIMATION D'APPARITION DE NOUVELLES NOTIFICATIONS
   ============================================ */

/* Classe appliquée temporairement quand le nombre augmente */
@keyframes notification-pop {
    0% {
        transform: scale(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#notification-count.notification-new,
#notification-count.badge.notification-new {
    animation: notification-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ============================================
   THÈME CLAIR/SOMBRE
   ============================================ */

/* Mode sombre - Ajustements de la lueur */
[data-bs-theme="dark"] #notification-count.notification-animation-glow:not(:empty),
[data-bs-theme="dark"] #notification-count.badge.notification-animation-glow:not(:empty) {
    box-shadow: 
        0 0 8px 0 rgba(var(--bs-danger-rgb, 220, 53, 69), 0.6),
        0 0 0 0 rgba(var(--bs-danger-rgb, 220, 53, 69), 0.5);
}

/* Mode clair - Border plus visible */
[data-bs-theme="light"] #notification-count,
[data-bs-theme="light"] #notification-count.badge {
    border-width: 2px;
    border-color: var(--bs-body-bg, #fff);
}

/* ============================================
   ANIMATION DU CŒUR DANS LE FOOTER
   ============================================ */

/* Animation de battement de cœur */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.1);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.15);
    }
    40% {
        transform: scale(1);
    }
}

/* Application de l'animation au cœur avec durée basée sur le niveau d'animation */
#footer-heart {
    display: inline-block;
    color: var(--bs-danger, #dc3545) !important;
    animation: heartbeat calc(var(--notification-animation-duration) * 0.8) ease-in-out infinite;
}

/* Aucune animation si le niveau est "none" */
body.animation-none #footer-heart {
    animation: none !important;
}

/* Réduction des animations si l'utilisateur préfère moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    #footer-heart {
        animation: none !important;
    }
}
