/**
 * Styles pour le gestionnaire CRUD
 * Interface discrète et moderne pour gérer les collections
 */

/* Bouton d'ouverture du CRUD */
.crud-toggle-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.crud-toggle-btn:hover {
    background: var(--surface-light);
    color: var(--text);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

/* Panneau CRUD */
.crud-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #1a1a2e;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.crud-panel-open {
    right: 0;
}

/* Header du panneau */
.crud-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #16213e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.crud-panel-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.crud-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s ease;
}

.crud-close-btn:hover {
    transform: scale(1.2);
}

/* Contenu du panneau */
.crud-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Formulaire */
.crud-form-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.crud-form-container h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
}

.crud-form-group {
    margin-bottom: 16px;
}

.crud-form-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.crud-form-group input[type="text"],
.crud-form-group input[type="url"],
.crud-form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.crud-form-group input:focus,
.crud-form-group select:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.15);
}

.crud-form-group-checkbox {
    display: flex;
    align-items: center;
}

.crud-form-group-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.crud-form-group-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Actions du formulaire */
.crud-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.crud-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crud-btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #fff;
}

.crud-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.crud-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.crud-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.crud-btn-icon {
    font-size: 16px;
}

/* Liste des éléments */
.crud-list-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.crud-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.crud-list-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.crud-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.crud-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crud-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.crud-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.crud-list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crud-list-item-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.crud-list-item-category {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.crud-list-item-actions {
    display: flex;
    gap: 8px;
}

.crud-action-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.crud-action-btn:hover {
    transform: scale(1.2);
    opacity: 1;
}

.crud-favorite-btn:hover {
    filter: drop-shadow(0 0 4px gold);
}

.crud-edit-btn:hover {
    filter: drop-shadow(0 0 4px #00d4ff);
}

.crud-delete-btn:hover {
    filter: drop-shadow(0 0 4px #ff4444);
}

/* États de chargement et vides */
.crud-loading,
.crud-empty,
.crud-error {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.crud-error {
    color: #ff4444;
}

/* Notifications */
.crud-notification {
    position: fixed;
    bottom: -100px;
    right: 20px;
    padding: 16px 24px;
    background: #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    transition: bottom 0.3s ease;
}

.crud-notification-show {
    bottom: 20px;
}

.crud-notification-success {
    border-left: 4px solid #00d4ff;
}

.crud-notification-error {
    border-left: 4px solid #ff4444;
}

/* Responsive */
@media (max-width: 768px) {
    .crud-panel {
        width: 100%;
        right: -100%;
    }
    
    .crud-toggle-btn {
        padding: 0.4rem 0.8rem;
        font-size: 16px;
    }
}

/* Scrollbar personnalisée */
.crud-panel-content::-webkit-scrollbar {
    width: 8px;
}

.crud-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.crud-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.crud-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
