/* liste.css - Styles modernes pour la page de gestion des listes */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --background-light: #f1f5f9;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.2s ease-out;
    --transition-slow: 0.3s ease-out;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background decoratif */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

/* Header avec logo */
.header-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px 32px;
    background: var(--card-background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.header-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.logo {
    height: 64px;
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}

.logo-link:hover .logo {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.logo-link:active .logo {
    transform: scale(0.98);
}

.title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* Messages et loader */
.message-fixed {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 9999;
    max-width: 400px;
}

.famivest-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: flex;
    gap: 10px;
}

.famivest-loader .ball {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce 1.4s infinite ease-in-out both;
}

.famivest-loader .ball.yellow {
    background: var(--warning-color);
    animation-delay: -0.32s;
}

.famivest-loader .ball.green {
    background: var(--success-color);
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.is-hidden {
    display: none !important;
}

/* Carte de formulaire */
.form-card {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-base);
}

.form-card:hover {
    box-shadow: var(--shadow-lg);
}

.form-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.form-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Formulaire */
.form-row {
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: var(--card-background);
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Boutons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Section des items */
.items-section {
    margin-top: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Grille d'items */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.item-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.item-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.item-info {
    flex: 1;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    word-wrap: break-word;
}

.item-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.item-rang {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--success-color);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.item-comment {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 12px 0;
    line-height: 1.5;
    font-style: italic;
}

.item-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.btn-edit {
    flex: 1;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--warning-color), #f59e0b);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    flex: 1;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-background);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    margin-top: 20px;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header-container {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .title {
        font-size: 1.75rem;
    }

    .form-card {
        padding: 20px;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Scroll personnalisé */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-hover);
}

/* Focus amélioré pour accessibilité */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

