* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Thème Lunaire - Noir, Gris, Blanc */
    --moon-light: #ffffff;
    --moon-gray-light: #e5e7eb;
    --moon-gray: #9ca3af;
    --moon-gray-dark: #6b7280;
    --moon-dark: #374151;
    --moon-black: #111827;
    --moon-black-dark: #000000;
    
    --primary-color: var(--moon-light);
    --primary-dark: var(--moon-gray);
    --secondary-color: var(--moon-gray-light);
    --success-color: var(--moon-gray-light);
    --error-color: #dc2626;
    --warning-color: var(--moon-gray);
    --bg-color: var(--moon-black-dark);
    --bg-secondary: var(--moon-black);
    --bg-tertiary: var(--moon-dark);
    --text-primary: var(--moon-light);
    --text-secondary: var(--moon-gray-light);
    --border-color: var(--moon-dark);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--moon-black-dark);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

/* Animation de pluie de météores */
@keyframes meteor {
    0% {
        transform: translateY(-100px) translateX(0) rotate(-45deg);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(-300px) rotate(-45deg);
        opacity: 0;
    }
}

.meteor {
    position: fixed;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
    animation: meteor linear;
    pointer-events: none;
    z-index: 0;
}

.meteor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 2px;
    height: 150px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 30%,
        rgba(255, 255, 255, 0.3) 60%,
        transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Navbar */
.navbar {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--moon-dark);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5rem;
    color: var(--moon-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    position: relative;
}

/* Logo Lune stylisé pour navbar avec cratères */
.navbar h1::before {
    content: '';
    width: 40px;
    height: 40px;
    display: inline-block;
    position: relative;
    background: var(--moon-light);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        inset -10px 0 0 rgba(0, 0, 0, 0.1),
        /* Cratères */
        inset 8px 12px 3px rgba(0, 0, 0, 0.15),
        inset -5px -8px 2px rgba(0, 0, 0, 0.1),
        inset 15px -10px 2px rgba(0, 0, 0, 0.12),
        inset -12px 15px 2px rgba(0, 0, 0, 0.1);
    margin-right: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--moon-light);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-links strong {
    color: var(--moon-light);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-box {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--moon-dark);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-box h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--moon-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

/* Lune stylisée pour auth-box */
.auth-box h1 {
    position: relative;
}

.auth-box h1::before {
    content: '';
    width: 60px;
    height: 60px;
    display: inline-block;
    position: relative;
    background: var(--moon-light);
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.6),
        inset -15px 0 0 rgba(0, 0, 0, 0.15),
        /* Cratères réalistes */
        inset 12px 18px 4px rgba(0, 0, 0, 0.2),
        inset -8px -12px 3px rgba(0, 0, 0, 0.15),
        inset 22px -15px 3px rgba(0, 0, 0, 0.18),
        inset -18px 22px 3px rgba(0, 0, 0, 0.15),
        inset 30px 8px 2px rgba(0, 0, 0, 0.12),
        inset -25px -5px 2px rgba(0, 0, 0, 0.1);
    margin-right: 0.75rem;
    z-index: 2;
}

.auth-box h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--moon-gray-light);
    position: relative;
    z-index: 1;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--moon-light);
    text-decoration: none;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.auth-link a:hover {
    text-decoration: underline;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    border-color: var(--error-color);
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.2);
}

.alert-success {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--moon-gray-light);
    color: var(--moon-light);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.alert-success a {
    color: var(--success-color);
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--moon-gray-light);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--moon-gray-light), var(--moon-light));
    color: var(--moon-black);
    width: 100%;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--moon-light), var(--moon-gray-light));
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--moon-dark);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-card h2 {
    margin-bottom: 1rem;
    color: var(--moon-light);
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* Tables */
.scripts-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.scripts-table th,
.admin-table th {
    background: var(--moon-dark);
    padding: 1rem;
    text-align: left;
    color: var(--moon-light);
    font-weight: 600;
    border-bottom: 2px solid var(--moon-gray-dark);
}

.scripts-table td,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.scripts-table tr:hover,
.admin-table tr:hover {
    background: rgba(55, 65, 81, 0.5);
}

.link-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    cursor: text;
}

/* Onglets d'upload */
.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--moon-dark);
}

.upload-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--moon-gray);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.upload-tab:hover {
    color: var(--moon-light);
}

.upload-tab.active {
    color: var(--moon-light);
    border-bottom-color: var(--moon-light);
}

.upload-section {
    margin-top: 1rem;
}

/* Élément de lune décoratif pour les pages */
.moon-decoration {
    position: fixed;
    top: 10%;
    right: 5%;
    width: 200px;
    height: 200px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.1;
}

.moon-decoration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: var(--moon-light);
    border-radius: 50%;
    box-shadow: 
        0 0 60px rgba(255, 255, 255, 0.3),
        inset -50px 0 0 rgba(0, 0, 0, 0.2),
        /* Cratères réalistes */
        inset 40px 60px 12px rgba(0, 0, 0, 0.25),
        inset -30px -40px 10px rgba(0, 0, 0, 0.2),
        inset 70px -50px 10px rgba(0, 0, 0, 0.22),
        inset -60px 70px 10px rgba(0, 0, 0, 0.2),
        inset 100px 30px 8px rgba(0, 0, 0, 0.18),
        inset -80px -20px 8px rgba(0, 0, 0, 0.15),
        inset 120px -30px 6px rgba(0, 0, 0, 0.12),
        inset -100px 50px 6px rgba(0, 0, 0, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .scripts-table,
    .admin-table {
        font-size: 0.875rem;
    }
    
    .scripts-table th,
    .scripts-table td,
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
    
    .moon-decoration {
        width: 150px;
        height: 150px;
        top: 5%;
        right: 2%;
    }
    
    .moon-decoration::before {
        width: 150px;
        height: 150px;
    }
    
}

