/* Custom CSS for ShadowHeberg BotList - Thème Bleu Moderne */

/* Variables de couleur - Thème adaptatif */
:root {
    /* Couleurs principales (identiques pour tous les thèmes) */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #1e40af;
    --accent: #60a5fa;
    
    /* Couleurs de statut (identiques pour tous les thèmes) */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Effets */
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease-in-out;
}

/* Thème clair (défaut) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    /* Footer géré dans layout.ejs */
    
    /* Nuances de gris pour compatibilité */
    --dark: #0f172a;
    --dark-gray: #1e293b;
    --medium-gray: #334155;
    --light-gray: #e2e8f0;
    --light: #f8fafc;
}

/* Thème sombre */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    --border-color: #334155;
    /* Footer géré dans layout.ejs */
    
    /* Ombres adaptées au thème sombre */
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Réinitialisation et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* En-tête */
.navbar {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary) !important;
}

.navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem;
}

.navbar .nav-link:hover, .navbar .nav-link.active {
    color: var(--primary) !important;
    background-color: rgba(37, 99, 235, 0.1);
}

/* Boutons */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Cartes */
.card {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    color: var(--text-primary);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tableaux */
.table {
    width: 100%;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    color: var(--text-primary);
}

.table th {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    text-align: left;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Footer - Styles gérés dans layout.ejs pour éviter les conflits */

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

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

.rounded-lg {
    border-radius: 0.5rem;
}

.shadow {
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Bot cards responsive */
    .bot-card {
        margin-bottom: 1rem;
    }
    
    .bot-card .card-body {
        padding: 1rem;
    }
    
    .bot-card h5 {
        font-size: 1.1rem;
    }
    
    .bot-card p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    /* Bot details responsive */
    .bot-avatar {
        width: 80px !important;
        height: 80px !important;
    }
    
    .rating {
        font-size: 0.875rem;
    }
    
    /* Vote form responsive */
    .rating-input {
        justify-content: center;
        margin: 1rem 0;
    }
    
    .rating-input .star {
        font-size: 1.5rem;
        margin: 0 0.25rem;
    }
    
    /* Search responsive */
    .search-form .input-group {
        flex-direction: column;
    }
    
    .search-form .form-control {
        margin-bottom: 0.5rem;
        /* border-radius géré par les thèmes */
    }
    
    .search-form .btn {
        border-radius: 0.375rem !important;
    }
    
    /* Stats responsive */
    .stats-card {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card p {
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Animation de chargement */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
    margin-top: 50px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.bot-card {
    transition: all 0.3s ease;
}

.bot-card:hover {
    transform: translateY(-4px);
}

.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Bot Avatar */
.bot-avatar {
    border: 3px solid #fff;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.bot-avatar:hover {
    transform: scale(1.05);
}

/* Rating Stars */
.rating {
    display: inline-flex;
    align-items: center;
}

.rating .fa-star {
    font-size: 0.875rem;
    margin-right: 1px;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    cursor: pointer;
    padding: 0 2px;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.2s ease;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input[type="radio"]:checked ~ label {
    color: var(--warning-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 16px;
}

/* Stats */
.stat-item {
    padding: 1rem;
}

.stat-item h3, .stat-item h4 {
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.stat-small {
    padding: 0.5rem;
}

/* Forms - Règles déplacées vers les thèmes */
/* Les styles .form-control sont maintenant gérés dans theme-dark.css et theme-light.css */

/* .form-label styles moved to theme files */

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: rgba(23, 162, 184, 0.1);
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 2px solid transparent;
    color: var(--primary-color);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

/* Search Filters */
.search-filters {
    background-color: var(--light-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Activity Items */
.activity-item {
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
    border-radius: 50%;
}

/* Bot Description */
.bot-description {
    line-height: 1.7;
}

.bot-description h1, .bot-description h2, .bot-description h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.bot-description ul, .bot-description ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.bot-description code {
    background-color: var(--light-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.bot-description pre {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Review Items */
.review-item {
    transition: background-color 0.3s ease;
}

.review-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem;
}

/* Info Items */
.info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

/* Footer - Styles gérés dans layout.ejs */

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .stat-item h3, .stat-item h4 {
        font-size: 1.5rem;
    }
    
    .bot-avatar {
        width: 48px !important;
        height: 48px !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Très petits écrans - améliorations */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Bot cards très petits écrans */
    .bot-card .card-body {
        padding: 0.75rem;
    }
    
    .bot-card h5 {
        font-size: 1rem;
    }
    
    .bot-card p {
        font-size: 0.8rem;
    }
    
    /* Bot details très petits écrans */
    .bot-avatar {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Navigation très petits écrans */
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Formulaires très petits écrans - font-size géré par les thèmes */
    /* .form-control font-size maintenant dans theme-dark.css et theme-light.css */
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Tables responsive */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    /* Badges très petits écrans */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Rating très petits écrans */
    .rating-input .star {
        font-size: 1.25rem;
        margin: 0 0.15rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Hero Section Button Improvements */
.hero-section .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-section .btn {
    white-space: nowrap;
    min-width: fit-content;
    margin-bottom: 0.5rem;
}
/* Stats Section Improvements */
.stat-item {
    padding: 1rem 0.5rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-item .h3 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-item .text-muted {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer Improvements */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0 1rem;
}

.footer .text-muted {
    color: var(--text-muted) !important;
}

/* ===== PAGES ADMINISTRATEUR ===== */
/* Correction pour les pages admin avec structure complexe */
.admin-page {
    margin-top: 80px;
}

/* Navigation admin - forcer position relative (pas fixe) */
.admin-page .navbar {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
}

/* Section header admin - ajustement pour navbar fixe */
.admin-section-header {
    padding-top: 1.5rem;
}




@media (max-width: 991.98px) {
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    .stat-item p {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section .btn-lg {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.25rem;
    }
    
    .stat-item h3 {
        font-size: 1.25rem;
    }
}

/* Button group improvements */
.btn-group-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-group-responsive .btn {
    flex: 0 0 auto;
    margin: 0;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2d3748;
        --dark-color: #f7fafc;
    }
    
    body {
        background-color: #1a202c;
        color: #f7fafc;
    }
    
    .card {
        background-color: #2d3748;
        color: #f7fafc;
    }
    
    .bg-light {
        background-color: #2d3748 !important;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
}
