/* =============================================
   Dashboard Sodyf - Forêt Magique des Cerfy
   Thème: Sakura & Forêt Enchantée
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Poppins:wght@300;400;500;600&display=swap');

:root {
    /* Couleurs principales - Forêt Magique */
    --bg-forest: linear-gradient(135deg, #1a1f2e 0%, #2d3a4f 50%, #1e2836 100%);
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar: linear-gradient(180deg, #1a1e2d 0%, #232a3c 100%);

    /* Couleurs Sakura */
    --sakura-light: #ffd6e0;
    --sakura: #ffb6c8;
    --sakura-dark: #ff8fab;
    --sakura-glow: rgba(255, 182, 200, 0.3);

    /* Couleurs Forêt */
    --forest-light: #a8e6cf;
    --forest: #7fcdbb;
    --forest-dark: #56b4a1;
    --forest-glow: rgba(127, 205, 187, 0.3);

    /* Couleurs Lavande (accent) */
    --lavender-light: #e8d5ff;
    --lavender: #c9a8ff;
    --lavender-dark: #a87fff;

    /* Couleurs Dorées */
    --gold: #ffd699;
    --gold-dark: #f5c058;

    /* Texte */
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #7a8b9f;

    /* Autres */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(255, 182, 200, 0.2);

    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Quicksand', sans-serif;
    background: var(--bg-forest);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Étoiles décoratives */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 214, 224, 0.2), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(168, 230, 207, 0.3), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(201, 168, 255, 0.2), transparent);
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

a {
    color: var(--sakura);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--sakura-light);
    text-decoration: none;
}

code {
    background: rgba(255, 182, 200, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--sakura);
}

/* =============================================
   Layout
   ============================================= */

.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================
   Sidebar - Forêt Enchantée
   ============================================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--sakura-glow), transparent, var(--forest-glow));
}

.sidebar-header {
    padding: 28px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255, 182, 200, 0.1) 0%, transparent 100%);
}

.sidebar-header h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--sakura) 0%, var(--lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    margin: 4px 12px;
    border-radius: 12px;
}

.nav-item:hover {
    background: rgba(255, 182, 200, 0.1);
    color: var(--sakura-light);
    text-decoration: none;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 182, 200, 0.15) 0%, rgba(168, 230, 207, 0.1) 100%);
    color: var(--sakura);
    border-left-color: var(--sakura);
    box-shadow: 0 4px 15px rgba(255, 182, 200, 0.1);
}

.nav-item .icon {
    width: 28px;
    margin-right: 14px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-item .icon i {
    color: var(--sakura);
}

.nav-item.active .icon i {
    color: var(--sakura-light);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sakura) 0%, var(--lavender) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1a1e2d;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 182, 200, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--sakura);
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--sakura);
    font-weight: 500;
}

.logout-btn {
    display: block;
    margin-top: 14px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff8a8a;
    text-decoration: none;
}

/* =============================================
   Main Content
   ============================================= */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 36px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 36px;
}

.page-header h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2 i {
    color: var(--sakura);
}

.page-header .description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =============================================
   Cards - Glassmorphism
   ============================================= */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--sakura);
}

/* =============================================
   Stats Grid - Enchanted Cards
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sakura), var(--forest));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.pink {
    background: linear-gradient(135deg, rgba(255, 182, 200, 0.25) 0%, rgba(255, 143, 171, 0.15) 100%);
    color: var(--sakura);
    box-shadow: 0 4px 20px rgba(255, 182, 200, 0.2);
}

.stat-icon.green {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.25) 0%, rgba(127, 205, 187, 0.15) 100%);
    color: var(--forest);
    box-shadow: 0 4px 20px rgba(168, 230, 207, 0.2);
}

.stat-icon.purple {
    background: linear-gradient(135deg, rgba(201, 168, 255, 0.25) 0%, rgba(168, 127, 255, 0.15) 100%);
    color: var(--lavender);
    box-shadow: 0 4px 20px rgba(201, 168, 255, 0.2);
}

.stat-icon.blue {
    background: linear-gradient(135deg, rgba(102, 178, 255, 0.25) 0%, rgba(82, 158, 235, 0.15) 100%);
    color: #66b2ff;
    box-shadow: 0 4px 20px rgba(102, 178, 255, 0.2);
}

.stat-value {
    font-family: 'Quicksand', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--sakura-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =============================================
   Tables - Elegant Style
   ============================================= */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 18px;
    text-align: left;
}

th {
    background: rgba(255, 182, 200, 0.08);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sakura);
    border-bottom: 1px solid var(--border-color);
}

tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

tr:hover {
    background: rgba(255, 182, 200, 0.05);
}

tr:last-child {
    border-bottom: none;
}

/* =============================================
   Buttons - Magical Style
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sakura) 0%, var(--sakura-dark) 100%);
    color: #1a1e2d;
    box-shadow: 0 4px 20px rgba(255, 182, 200, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(255, 182, 200, 0.4);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 182, 200, 0.1);
    border-color: var(--sakura);
    text-decoration: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.4);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-discord {
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: white;
    font-size: 1rem;
    padding: 16px 32px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(88, 101, 242, 0.4);
    text-decoration: none;
}

/* =============================================
   Forms - Enchanted Inputs
   ============================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--sakura);
    box-shadow: 0 0 0 3px var(--sakura-glow);
    background: rgba(255, 182, 200, 0.05);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Select dropdown fix */
select.form-control,
table select.form-control,
.edit-form select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.03);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23b8c5d6' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    color: var(--text-primary) !important;
}

select.form-control option,
table select option,
.edit-form select option {
    background-color: #1e2636 !important;
    color: #ffffff !important;
    padding: 10px;
}

/* =============================================
   Login Page - Magical Portal
   ============================================= */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-forest);
    position: relative;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-soft), 0 0 60px rgba(255, 182, 200, 0.1);
    position: relative;
    z-index: 1;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 20px rgba(255, 182, 200, 0.4));
}

.login-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--sakura) 0%, var(--lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.6;
}

.login-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* =============================================
   Badges - Sparkle Tags
   ============================================= */

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.2) 0%, rgba(127, 205, 187, 0.15) 100%);
    color: var(--forest-light);
    border: 1px solid rgba(168, 230, 207, 0.3);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ff8a8a;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge-info {
    background: rgba(102, 178, 255, 0.15);
    color: #88c8ff;
    border: 1px solid rgba(102, 178, 255, 0.3);
}

/* =============================================
   Modal - Enchanted Popup
   ============================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(180deg, #2a3245 0%, #1e2636 100%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft), 0 0 60px rgba(255, 182, 200, 0.1);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--sakura);
    background: rgba(255, 182, 200, 0.1);
}

/* =============================================
   Empty State - Peaceful Forest
   ============================================= */

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state p {
    line-height: 1.6;
}

/* =============================================
   Alerts - Magical Notifications
   ============================================= */

.alert {
    padding: 16px 22px;
    border-radius: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.15) 0%, rgba(127, 205, 187, 0.1) 100%);
    border: 1px solid rgba(168, 230, 207, 0.3);
    color: var(--forest-light);
}

.alert-error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
}

/* =============================================
   Config Table - Mystical Settings
   ============================================= */

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.config-key {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: var(--sakura);
    font-size: 0.9rem;
}

.config-value {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =============================================
   Scrollbar - Enchanted Style
   ============================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--sakura) 0%, var(--lavender) 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sakura-light);
}

/* =============================================
   Responsive - Mobile Magic
   ============================================= */

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 24px;
    }

    .layout {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }
}