/*
 * FantasyRealm Online - Styles principaux
 * PixelVerse Studios
 */

/* ===== Variables CSS ===== */
:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent-color: #f59e0b;
}

/* ===== Base Layout ===== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
}

main {
    flex: 1;
}

/* ===== Typography ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Buttons ===== */
.btn-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
    color: white;
}

.btn-hero-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-hero-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== Cards ===== */
.card-fantasy {
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card-fantasy:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

/* ===== Navigation ===== */
.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
}

.nav-link {
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ===== Components ===== */
.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    color: var(--primary-color);
}

.badge-primary {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary-color);
}

/* ===== Animations ===== */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Footer ===== */
.footer {
    background: rgba(15, 15, 35, 0.9);
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ===== Forms ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
}

/* ===== Bootstrap Overrides ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* ===== Star Rating ===== */
.star-rating .bi-star-fill {
    color: var(--accent-color);
}

.star-rating .bi-star {
    color: #6c757d;
}

/* ===== Character Preview (Create/Edit) ===== */
.character-preview-wrapper {
    text-align: center;
}

.preview-frame {
    display: inline-block;
    padding: 6px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

.preview-frame canvas {
    display: block;
    border-radius: 14px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 991.98px) {
    .preview-frame canvas {
        max-width: 280px;
        margin: 0 auto;
    }
}

/* ===== Character Detail Page ===== */
.sidebar-sticky {
    top: 100px;
    z-index: 1;
    position: relative;
}

.review-form {
    background: rgba(30, 30, 46, 0.5);
}

.review-item {
    background: rgba(30, 30, 46, 0.5);
}

.accessory-badge {
    background: rgba(139, 92, 246, 0.1);
}

.character-placeholder {
    height: 400px;
}

.character-thumbnail {
    height: 200px;
}

/* ===== Contact Page ===== */
.min-vh-75 {
    min-height: 75vh;
}

/* ===== Navigation ===== */
.navbar-fantasy {
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

/* Fix sticky header z-index */
header.sticky-top {
    z-index: 1040 !important;
}

/* Ensure navbar content is visible */
.navbar {
    overflow: visible !important;
}

.navbar-collapse {
    overflow: visible !important;
    z-index: 1045;
}

/* Navigation dropdowns - Fix z-index issues */
.navbar .dropdown {
    position: relative;
    z-index: 1050;
}

.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

.dropdown-menu.show {
    display: block !important;
    z-index: 9999 !important;
}

/* CSS Fallback: Force dropdown to show on hover if JS fails */
.navbar .dropdown:hover > .dropdown-menu,
.navbar .dropdown:focus-within > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure dropdown button keeps focus */
.navbar .dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
}

/* Fix for collapsible elements not overlapping dropdowns */
.collapse, .collapsing {
    z-index: 1 !important;
}

/* Ensure container doesn't clip dropdowns */
.navbar .container {
    overflow: visible !important;
}


/* ===== Footer ===== */
.footer-divider {
    border-color: rgba(139, 92, 246, 0.1);
}

/* ===== Auth Pages ===== */
.auth-icon {
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.1);
}

.auth-icon-lg {
    width: 80px;
    height: 80px;
    background: rgba(139, 92, 246, 0.1);
}

/* ===== Utility Classes ===== */
.max-w-600 {
    max-width: 600px;
}

.max-w-500 {
    max-width: 500px;
}

.w-fit {
    width: fit-content;
}

/* ===== Admin Page ===== */
.table-dark {
    --bs-table-bg: rgba(30, 30, 46, 0.5);
    --bs-table-border-color: rgba(139, 92, 246, 0.1);
}

.table-dark thead th {
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table-dark tbody tr {
    transition: background-color 0.2s ease;
}

.table-dark tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

/* ===== Form Styles ===== */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
}

/* ===== Tabs ===== */
.nav-tabs {
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.nav-tabs .nav-link {
    color: #9ca3af;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(139, 92, 246, 0.5);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

/* ===== Employee Page - User Management ===== */
/* Statistiques Cards */
.card.bg-success.bg-opacity-10 {
    background-color: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.bg-success.bg-opacity-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.card.bg-warning.bg-opacity-10 {
    background-color: rgba(234, 179, 8, 0.1) !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.bg-warning.bg-opacity-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

.card.bg-info.bg-opacity-10 {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.bg-info.bg-opacity-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* User Table Styling */
#users-panel .table {
    border-collapse: separate;
    border-spacing: 0;
    background-color: rgba(17, 24, 39, 0.8);
}

#users-panel .table thead th {
    position: sticky;
    top: 0;
    background-color: rgba(17, 24, 39, 0.98);
    z-index: 10;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

#users-panel .table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    background-color: rgba(17, 24, 39, 0.6);
}

#users-panel .table tbody tr {
    transition: all 0.3s ease;
    background-color: rgba(17, 24, 39, 0.6);
}

#users-panel .table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.15);
    transform: scale(1.01);
}

/* Suspended Users Row Highlight */
#users-panel .table tbody tr[data-suspended="true"] {
    background-color: rgba(17, 24, 39, 0.6) !important;
    border-left: 3px solid rgba(234, 179, 8, 0.5);
}

#users-panel .table tbody tr[data-suspended="true"]:hover {
    background-color: rgba(234, 179, 8, 0.08) !important;
    transform: scale(1.01);
}

#users-panel .table tbody tr[data-suspended="true"]:hover td {
    background-color: rgba(234, 179, 8, 0.08) !important;
}

/* User Badges */
#users-panel .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 0.375rem;
}

#users-panel .badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.9) !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

#users-panel .badge.bg-primary {
    background-color: rgba(139, 92, 246, 0.9) !important;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

#users-panel .badge.bg-secondary {
    background-color: rgba(107, 114, 128, 0.9) !important;
    border: 1px solid rgba(107, 114, 128, 0.3);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

#users-panel .badge.bg-info {
    background-color: rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

#users-panel .badge.bg-warning {
    background-color: rgba(234, 179, 8, 0.9) !important;
    color: #1e1e2e !important;
    border: 1px solid rgba(234, 179, 8, 0.3);
    box-shadow: 0 2px 4px rgba(234, 179, 8, 0.2);
}

/* Action Buttons */
#users-panel .btn-group-sm .btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#users-panel .btn-warning {
    background-color: rgba(234, 179, 8, 0.9);
    border-color: rgba(234, 179, 8, 0.9);
    color: #1e1e2e;
}

#users-panel .btn-warning:hover {
    background-color: #eab308;
    border-color: #eab308;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(234, 179, 8, 0.3);
}

#users-panel .btn-danger {
    background-color: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 0.9);
}

#users-panel .btn-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

#users-panel .btn-success {
    background-color: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.9);
}

#users-panel .btn-success:hover {
    background-color: #22c55e;
    border-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

/* Modal Styling */
#users-panel .modal-content.border-warning {
    border: 2px solid rgba(234, 179, 8, 0.5) !important;
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.2);
}

#users-panel .modal-content.border-danger {
    border: 2px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2);
}

#users-panel .modal-header.border-warning {
    border-bottom: 1px solid rgba(234, 179, 8, 0.3) !important;
}

#users-panel .modal-header.border-danger {
    border-bottom: 1px solid rgba(239, 68, 68, 0.3) !important;
}

#users-panel .modal-footer.border-secondary {
    border-top: 1px solid rgba(107, 114, 128, 0.3) !important;
}

/* User Icons */
#users-panel .bi-person-circle {
    font-size: 1.25rem;
}

#users-panel .card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #users-panel .table {
        font-size: 0.875rem;
    }

    #users-panel .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    #users-panel .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Empty State */
#users-panel .text-center.py-5 {
    padding: 3rem 1rem !important;
    color: rgba(156, 163, 175, 0.7);
}

#users-panel .text-center.py-5 i.bi {
    color: rgba(139, 92, 246, 0.3);
}

/* Table Hover Effects */
#users-panel .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: rgba(17, 24, 39, 0.8);
}

#users-panel .card-fantasy {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    background-color: rgba(17, 24, 39, 0.5);
}

#users-panel .card-fantasy .card-body {
    background-color: rgba(17, 24, 39, 0.3);
}

#users-panel .card-fantasy:hover {
    box-shadow: 0 8px 12px rgba(139, 92, 246, 0.15);
}

/* ===== MODAL FIXES ===== */
/* S'assurer que les modals sont positionnés correctement */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1055 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Le modal-dialog doit être centré */
.modal-dialog {
    position: relative !important;
    margin: 1.75rem auto !important;
    pointer-events: none !important;
}

/* Le modal-content doit capturer les clics */
.modal-content {
    position: relative !important;
    pointer-events: auto !important;
}

/* Centrer verticalement le modal */
.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 3.5rem) !important;
}

/* Backdrop doit être en dessous */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1050 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none !important; /* Cacher complètement le backdrop */
}

/* Ajouter une ombre au modal pour le faire ressortir sans backdrop */
.modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

/* ===== Toasts / Notifications ===== */
.toast-container {
    z-index: 99999 !important;
}

.toast {
    min-width: 350px;
    max-width: 500px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    border-left: 4px solid #ff4444;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    border-left: 4px solid #ffeb3b;
    color: #000 !important;
}

.toast.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border-left: 4px solid #4caf50;
}

.toast-body {
    font-size: 0.95rem;
    padding: 1rem;
}

.toast-body strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.toast-body p {
    line-height: 1.5;
    white-space: pre-line;
}

.toast-body hr {
    opacity: 0.3;
    margin: 0.75rem 0;
}

.toast-body small {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

