/**
 * Prompt Manager - Styles personnalisés
 * Design moderne et responsive
 */

/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #090e34;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ==================== BASE ==================== */
body {
    background-color: var(--light-bg);
    min-height: 100vh;
}

/* Container principal avec largeur max */
.container-fluid.py-4 {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

/* Titre principal en blanc sur fond sombre */
.container-fluid.py-4 h4 {
    color: #ffffff;
}

/* ==================== NAVBAR ==================== */
.navbar {
    box-shadow: var(--box-shadow-lg);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar .form-control {
    border-radius: 20px 0 0 20px;
}

.navbar .btn-light {
    border-radius: 0 20px 20px 0;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.prompt-card,
.category-card {
    background-color: #1D2144;
    border: 2px solid #FBAF40;
    color: #ffffff;
}

.prompt-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(251, 175, 64, 0.3);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(251, 175, 64, 0.3);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(251, 175, 64, 0.3);
}

.prompt-card .text-muted,
.category-card .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ==================== PROMPT CONTENT ==================== */
.prompt-content {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(251, 175, 64, 0.2);
    color: #ffffff;
}

.prompt-content::-webkit-scrollbar {
    width: 6px;
}

.prompt-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.prompt-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.prompt-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ==================== RATING STARS ==================== */
.rating-container {
    display: flex;
    align-items: center;
}

.rating-container .stars {
    display: inline-flex;
    gap: 2px;
}

.rating-container .star {
    color: var(--warning-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.rating-container .star:hover {
    transform: scale(1.2);
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.favori-btn {
    padding: 0.25rem;
    line-height: 1;
}

.favori-btn:hover {
    transform: scale(1.2);
}

/* ==================== SIDEBAR ==================== */
.sidebar .btn {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==================== COLOR PICKER ==================== */
.btn-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-color:hover {
    transform: scale(1.15);
}

.form-control-color {
    width: 50px;
    height: 38px;
    padding: 0.25rem;
}

/* ==================== BADGES ==================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* ==================== STATISTICS ==================== */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ==================== CHARTS ==================== */
.chart-container {
    position: relative;
    min-height: 300px;
}

/* ==================== MODAL ==================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--light-bg);
}

.modal-header .modal-title {
    color: #ffffff;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--light-bg);
}

/* ==================== TOAST ==================== */
.toast {
    border-radius: var(--border-radius);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991.98px) {
    .navbar .form-control {
        margin-top: 0.5rem;
    }

    .navbar .btn-success {
        margin-top: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .prompt-card .card-footer .d-flex {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .prompt-card .rating-container {
        justify-content: center;
    }

    .prompt-card .btn-group {
        width: 100%;
        justify-content: center;
    }

    .prompt-content {
        max-height: 150px;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.3s ease forwards;
}

/* ==================== EMPTY STATE ==================== */
.text-center.py-5 {
    color: var(--secondary-color);
}

.text-center.py-5 .display-1 {
    font-size: 5rem;
    opacity: 0.5;
}

/* ==================== SCROLLBAR GLOBAL ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ==================== FOCUS STATES ==================== */
.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .navbar,
    .btn,
    .toast-container,
    .modal {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .prompt-content {
        max-height: none;
        overflow: visible;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
}

/* ==================== OFFCANVAS SIDEBAR ==================== */
#sidebarOffcanvas {
    width: 320px;
    max-width: 85vw;
}

#sidebarOffcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebarOffcanvas .offcanvas-body {
    padding: 1.5rem;
}

#sidebarOffcanvas .btn {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#sidebarOffcanvas hr {
    margin: 1rem 0;
    opacity: 0.15;
}

/* Bouton Filtres dans la navbar */
.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Animation d'entrée pour les éléments du sidebar */
#sidebarOffcanvas.show .mb-4 {
    animation: slideInLeft 0.3s ease forwards;
}

#sidebarOffcanvas.show .mb-4:nth-child(2) {
    animation-delay: 0.1s;
}

#sidebarOffcanvas.show .mb-4:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
