/* ============================================
 * BookConnect - Mes Recommandations
 * Styles pour la page de recommandations
 * ============================================ */

body {
    background-color: #f5f5f5;
}

.recommendations-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ---- Header ---- */
.recommendations-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.recommendations-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: bold;
}

.recommendations-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

.header-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-box {
    background: rgba(255,255,255,0.2);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* ---- Actions rapides ---- */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    background: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.action-btn i {
    font-size: 2rem;
}

.action-btn.recommend {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.action-btn.received {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.action-btn.given {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

/* ---- Types de recommandations ---- */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.type-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.type-card.active {
    border: 2px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.type-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1rem;
}

.type-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.type-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.type-count {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* ---- Section de contenu ---- */
.content-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-tab:hover {
    background: #e5e7eb;
}

.filter-tab.active {
    background: #667eea;
    color: white;
}

/* ---- Grille de recommandations ---- */
.recommendations-grid {
    display: grid;
    gap: 1.5rem;
}

/* ---- Carte de recommandation ---- */
.recommendation-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s;
    border-left: 4px solid;
}

.recommendation-card:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.recommendation-card.contacts { border-left-color: #3b82f6; }
.recommendation-card.competences { border-left-color: #8b5cf6; }
.recommendation-card.services { border-left-color: #10b981; }
.recommendation-card.articles { border-left-color: #f59e0b; }
.recommendation-card.publications { border-left-color: #ec4899; }

.recommendation-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.recommendation-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.recommendation-info {
    flex: 1;
}

.recommendation-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.recommendation-subtitle {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.recommendation-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.recommendation-content {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.recommendation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.recommendation-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.recommendation-meta {
    display: flex;
    gap: 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
}

.recommendation-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.recommendation-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    color: #374151;
}

.recommendation-btn:hover {
    background: #e5e7eb;
}

.recommendation-btn.primary {
    background: #667eea;
    color: white;
}

.recommendation-btn.primary:hover {
    background: #5568d3;
}

.recommendation-btn.liked {
    background: #ef4444;
    color: white;
}

.recommendation-btn.liked:hover {
    background: #dc2626;
}

.recommendation-btn.danger {
    color: #ef4444;
}

.recommendation-btn.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ---- Rating stars (affichage) ---- */
.recommendation-rating {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.recommendation-rating .star {
    color: #d1d5db;
    font-size: 0.9rem;
}

.recommendation-rating .star.filled {
    color: #f59e0b;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.empty-state-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.empty-state-btn:hover {
    transform: scale(1.05);
}

/* ---- Bouton flottant ---- */
.btn-add-recommendation {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.btn-add-recommendation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* ---- Load more ---- */
#loadMoreContainer {
    text-align: center;
    margin-top: 1.5rem;
}

/* ---- Skeleton loading ---- */
.reco-skeleton {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid #e5e7eb;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.reco-skeleton-line {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.reco-skeleton-line.short { width: 40%; }
.reco-skeleton-line.medium { width: 65%; }
.reco-skeleton-line.long { width: 90%; }

.reco-skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e5e7eb;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
 * Modal de création de recommandation
 * ============================================ */

.reco-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.reco-modal {
    background: white;
    border-radius: 15px;
    width: 95%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reco-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.reco-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reco-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.reco-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Steps indicator */
.reco-modal-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #f9fafb;
}

.reco-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.reco-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.reco-step.active .reco-step-number {
    background: #667eea;
    color: white;
}

.reco-step.active {
    color: #667eea;
    font-weight: 600;
}

.reco-step.completed .reco-step-number {
    background: #10b981;
    color: white;
}

.reco-step.completed {
    color: #10b981;
}

.reco-step-separator {
    width: 30px;
    height: 2px;
    background: #e5e7eb;
}

.reco-step-separator.completed {
    background: #10b981;
}

/* Modal body */
.reco-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal footer */
.reco-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 15px 15px;
}

.reco-modal-footer .btn-back,
.reco-modal-footer .btn-next,
.reco-modal-footer .btn-submit {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.reco-modal-footer .btn-back {
    background: #f3f4f6;
    color: #6b7280;
}

.reco-modal-footer .btn-back:hover {
    background: #e5e7eb;
}

.reco-modal-footer .btn-next {
    background: #667eea;
    color: white;
}

.reco-modal-footer .btn-next:hover {
    background: #5568d3;
}

.reco-modal-footer .btn-next:disabled,
.reco-modal-footer .btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reco-modal-footer .btn-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.reco-modal-footer .btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ---- Step 1: Type selection ---- */
.reco-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.reco-type-option {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: white;
}

.reco-type-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.reco-type-option.selected {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.reco-type-option-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 0.75rem;
}

.reco-type-option-label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.reco-type-option-desc {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ---- Step 2: Form fields ---- */
.reco-form-group {
    margin-bottom: 1.25rem;
}

.reco-form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.reco-form-group label .required {
    color: #ef4444;
}

.reco-form-input,
.reco-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.reco-form-input:focus,
.reco-form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.reco-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.reco-form-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* ---- Autocomplete dropdown ---- */
.reco-autocomplete-wrapper {
    position: relative;
}

.reco-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 4px;
}

.reco-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.reco-autocomplete-item:hover {
    background: #f3f4f6;
}

.reco-autocomplete-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.reco-autocomplete-item-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.reco-autocomplete-item-info {
    flex: 1;
    min-width: 0;
}

.reco-autocomplete-item-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.reco-autocomplete-item-detail {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reco-autocomplete-empty {
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ---- Selected user chip ---- */
.reco-selected-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #eef2ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.reco-selected-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.reco-selected-user-info {
    flex: 1;
}

.reco-selected-user-name {
    font-weight: 600;
    color: #1f2937;
}

.reco-selected-user-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
}

.reco-selected-user-remove:hover {
    color: #ef4444;
}

/* ---- Star rating input ---- */
.reco-star-rating {
    display: flex;
    gap: 0.25rem;
    direction: rtl;
    justify-content: flex-end;
}

.reco-star-rating input {
    display: none;
}

.reco-star-rating label {
    font-size: 1.75rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s;
}

.reco-star-rating label:hover,
.reco-star-rating label:hover ~ label,
.reco-star-rating input:checked ~ label {
    color: #f59e0b;
}

/* ---- Summary preview (step 3) ---- */
.reco-summary-preview {
    background: #f9fafb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid #667eea;
}

.reco-summary-preview-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.reco-summary-preview-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ---- Toast notification ---- */
.reco-toast {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 3000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    animation: toast-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reco-toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.reco-toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .recommendations-header h1 {
        font-size: 1.75rem;
    }

    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: 100%;
    }

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

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .reco-modal {
        width: 98%;
        max-height: 95vh;
        margin: 0.5rem;
    }

    .reco-type-grid {
        grid-template-columns: 1fr;
    }

    .reco-modal-body {
        padding: 1rem;
    }

    .recommendation-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}
