/**
 * Bundle Feed Shell — Navbar top + profil pour pages authentifiees (header_feed.php)
 * Sources : navbar_top + profile + edit-profile + pagination
 * Sprint 4 — Consolidation CSS
 */

/* ============================================================
 * SOURCE: navbar_top.css
 * ============================================================ */
/**
 * Nom du fichier : navbar_top.css
 * Description    : Styles pour la barre de navigation principale
 * Auteur         : Renaldo Galofaro
 * Framework      : Bootstrap 5 + customisations LivreConnect
 */

:root {
    --primary-blue: #7c3aed;
    --secondary-blue: #a855f7;
    --accent-blue: #c084fc;
    --dark-gray: #374151;
    --light-gray: #f8fafc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --white: #ffffff;
}

/* Navbar principale */
.navbar {
    background: linear-gradient(to right, #7c3aed 0%, #ffffff 100%) !important;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 4rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

/* Brand */
.navbar-brand {
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
}

.navbar-brand img {
    max-height: 80px !important;
    height: 80px;
    width: auto;
    margin-right: 0.5rem;
}

/* Toggler (burger menu mobile) */
.navbar-toggler {
    color: var(--white) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: transparent;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Nav items */
.navbar .nav-link {
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 2px;
}

.navbar .nav-link.text-white {
    color: var(--white) !important;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
    transform: translateY(-1px);
}

.navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar .nav-link i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* Navbar-nav ms-auto : elements cote droit (fond blanc du degrade) */
.navbar-nav.ms-auto .nav-link,
.navbar-nav.ms-auto .nav-item .nav-link {
    color: #7c3aed !important;
}

.navbar-nav.ms-auto .nav-link:hover,
.navbar-nav.ms-auto .nav-item .nav-link:hover {
    background: rgba(124, 58, 237, 0.1) !important;
    color: #5b21b6 !important;
}

.navbar-nav.ms-auto .nav-link.active {
    background: rgba(124, 58, 237, 0.15) !important;
    color: #5b21b6 !important;
}

.navbar-nav.ms-auto .user-name,
.navbar-nav.ms-auto .user-email,
.navbar-nav.ms-auto .user-role,
.navbar-nav.ms-auto .user-subscription {
    color: #7c3aed !important;
}

.navbar-nav.ms-auto .user-email {
    opacity: 0.7;
}

.navbar-nav.ms-auto .btn.btn-light {
    background: rgba(124, 58, 237, 0.1) !important;
    color: #7c3aed !important;
    border-color: #7c3aed !important;
}

.navbar-nav.ms-auto .btn.btn-light:hover {
    background: #7c3aed !important;
    color: #fff !important;
}

/* Zone d'informations utilisateur */
.nav-item.user-info {
    padding: 0.5rem 1rem;
    border-right: 1px solid rgba(124, 58, 237, 0.2);
    margin-right: 0.5rem;
    display: flex !important;
    align-items: center;
}

.user-details {
    text-align: right;
    line-height: 1.2;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.125rem;
}

.user-email {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.125rem;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.9;
}

.user-level {
    font-weight: 500;
}

.user-subscription {
    font-size: 0.75rem;
    opacity: 0.95;
    margin-top: 0.125rem;
}

.user-subscription i.fa-crown {
    color: #fbbf24;
}

.subscription-expiry {
    font-weight: 500;
}

.subscription-expiry.expiring-soon {
    color: #fbbf24;
    font-weight: 600;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Menu utilisateur */
.user-menu-trigger {
    padding: 0.75rem 0.5rem !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: rotate(90deg);
}

/* Dropdown */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-toggle {
    color: var(--white) !important;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
}

.navbar-nav.ms-auto .nav-item.dropdown .dropdown-toggle {
    color: #7c3aed !important;
}

.nav-item.dropdown .dropdown-toggle:hover {
    background: rgba(124, 58, 237, 0.1) !important;
    color: #5b21b6 !important;
}

/* Fleche du dropdown Bootstrap */
.navbar-nav.ms-auto .nav-item.dropdown .dropdown-toggle::after {
    border-top-color: #7c3aed !important;
}

.user-dropdown-header {
    padding: 1rem !important;
    background: var(--light-gray);
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-user-name strong {
    color: var(--primary-blue) !important;
    font-size: 0.95rem;
    font-weight: 600;
}

.dropdown-user-email small {
    font-size: 0.8rem;
    color: #6b7280 !important;
}

.dropdown-user-role small {
    font-size: 0.75rem;
    color: var(--secondary-blue) !important;
    font-weight: 500;
}

.dropdown-menu {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
    min-width: 220px;
}

.dropdown-menu .dropdown-item {
    color: var(--dark-gray) !important;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background: var(--light-gray) !important;
    color: var(--primary-blue) !important;
    transform: none;
}

.dropdown-menu .dropdown-divider {
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Boutons d'action */
.navbar-nav.ms-auto .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar-nav.ms-auto .btn.btn-light {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-blue);
    border-color: transparent;
}

.navbar-nav.ms-auto .btn.btn-light:hover {
    background: var(--white);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar-nav.ms-auto .btn i {
    margin-right: 0.5rem;
}

/* Responsive */
@media screen and (max-width: 991.98px) {
    .navbar-collapse {
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 12px 12px;
        margin-top: 1px;
        padding: 0.5rem;
    }

    .nav-item {
        margin: 2px 8px;
        border-radius: 8px;
    }

    .navbar .nav-link {
        color: var(--white) !important;
    }

    .dropdown-menu {
        position: static !important;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin: 0.5rem 0;
    }

    .dropdown-menu .dropdown-item {
        color: var(--white) !important;
        padding-left: 2rem;
    }

    .dropdown-menu .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: var(--white) !important;
    }

    .navbar-nav.ms-auto {
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1rem;
    }

    .navbar-nav.ms-auto .nav-link,
    .navbar-nav.ms-auto .nav-item .nav-link {
        color: var(--white) !important;
    }

    .navbar-nav.ms-auto .btn.btn-light {
        background: rgba(255, 255, 255, 0.2) !important;
        color: var(--white) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }

    /* Zone utilisateur en mobile */
    .nav-item.user-info {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding-bottom: 1rem;
    }

    .nav-item.user-info .user-name,
    .nav-item.user-info .user-email,
    .nav-item.user-info .user-role,
    .nav-item.user-info .user-subscription {
        color: var(--white) !important;
    }

    .user-details {
        text-align: left;
    }

    .user-dropdown-header {
        background: rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .dropdown-user-name strong {
        color: var(--white) !important;
    }

    .dropdown-user-email small {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .dropdown-user-role small {
        color: var(--accent-blue) !important;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    animation: fadeInDown 0.3s ease-out;
}

/* Etats speciaux */
.nav-item.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badges et notifications */
.nav-item .badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 1.25rem;
    text-align: center;
    line-height: 1;
}

/* Accessibilite */
.navbar .nav-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Mode sombre (si necessaire) */
@media (prefers-color-scheme: dark) {
    .dropdown-menu {
        background: var(--dark-gray);
        border-color: #4b5563;
    }

    .dropdown-menu .dropdown-item {
        color: var(--white) !important;
    }

    .dropdown-menu .dropdown-item:hover {
        background: #4b5563 !important;
    }
}

/* Print styles */
@media print {
    .navbar {
        display: none !important;
    }
}

/* ============================================================
 * SOURCE: pages/profile.css
 * ============================================================ */
/* Styles pour la page de profil */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 160px 2rem 2rem 2rem; /* Ajusté à 160px pour navbar 140px + marge */
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.profile-avatar .avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.profile-info {
    flex-grow: 1;
}

.profile-info h1 {
    margin: 0 0 0.5rem 0;
}

.profile-info .role {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-content {
    display: grid;
    gap: 2rem;
}

.profile-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-section h2 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.list-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.item-title {
    margin: 0;
}

.item-meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.manuscript-stats-banner {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.manuscript-stats-banner .stat-value {
    font-size: 1.75rem;
}


@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stats {
        justify-content: center;
    }

    .profile-actions {
        margin-top: 1.5rem;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

}

/* ============================================================
 * SOURCE: pages/edit-profile.css
 * ============================================================ */
.edit-profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 160px 2rem 2rem 2rem; /* Ajusté à 160px pour navbar 140px + marge */
}

.form-group {
    margin-bottom: 1.5rem;
}

.current-photo .avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================================
 * SOURCE: components/pagination.css
 * ============================================================ */
/**
 * Pagination Component Styles
 * Utilisé par PaginationHelper::renderHtml() et le bouton "Charger plus"
 */

/* Override Bootstrap pagination pour cohérence BookConnect */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    color: #495057;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.pagination .page-link:hover {
    background-color: #f0f4ff;
    border-color: #667eea;
    color: #667eea;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton "Charger plus" (feed) */
.btn-load-more {
    border-radius: 25px;
    padding: 0.6rem 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-load-more:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
    }
    .pagination .page-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
}
