/* ==========================================================================
   portfolio.css - Styles spécifiques pour le lecteur RSS Portefolio
   ========================================================================== */

.portfolio-main {
    background-color: #f5f7f9;
    min-height: 100vh;
    padding-bottom: 4rem;
    padding-top: 120px; /* Espace pour le fixed header */
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'MedievalSharp', cursive;
    color: #1a1a1a;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.last-updated {
    color: #666;
    font-size: 0.9rem;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Card Design (Minimalist Premium)
   ========================================================================== */
.rss-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 5px solid transparent; /* Défini par les classes de sentiment */
    cursor: pointer;
    overflow: hidden;
}

.rss-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.rss-card.article-read {
    opacity: 0.65;
    filter: grayscale(40%);
}

.rss-card.article-read:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* Content */
.card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    
    /* Clamp à 3 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer / Meta */
.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.card-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.card-source i {
    color: #3b82f6; /* Couleur par défaut icône */
}

/* Actions */
.card-actions {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rss-card:hover .card-actions, 
.card-actions:focus-within {
    opacity: 1;
}

.action-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.action-btn.btn-read.is-read {
    color: #10b981;
}

/* ==========================================================================
   Sentiments (Bordures gauches)
   ========================================================================== */
.border-sentiment-positive {
    border-left-color: #28a745; /* Vert */
}

.border-sentiment-negative {
    border-left-color: #dc3545; /* Rouge */
}

.border-sentiment-institution {
    border-left-color: #007bff; /* Bleu */
}

.border-sentiment-neutral {
    border-left-color: #6c757d; /* Gris */
}

/* ==========================================================================
   Badges Ticker (Entreprises)
   ========================================================================== */
.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Définitions des couleurs par entreprise (Texte + Fond transparent 10-15%) */
.badge-v { color: #002278; background-color: rgba(0, 34, 120, 0.1); }
.badge-msft { color: #4F4F4F; background-color: rgba(79, 79, 79, 0.1); }
.badge-googl { color: #DB4437; background-color: rgba(219, 68, 55, 0.1); }
.badge-brk-b { color: #800020; background-color: rgba(128, 0, 32, 0.1); }
.badge-tsm { color: #6A0DAD; background-color: rgba(106, 13, 173, 0.1); }
.badge-rsg { color: #00875A; background-color: rgba(0, 135, 90, 0.1); }
.badge-ai-pa { color: #009999; background-color: rgba(0, 255, 255, 0.15); /* Ajusté pour lisibilité */ }
.badge-baba { color: #FF8C00; background-color: rgba(255, 140, 0, 0.1); }
.badge-tte-pa { color: #D80073; background-color: rgba(216, 0, 115, 0.1); }
/* Default / Autres */
.badge-default { color: #444; background-color: rgba(68, 68, 68, 0.1); }

/* ==========================================================================
   Filter Controls
   ========================================================================== */
.filter-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 0 20px;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* ==========================================================================
   Mode "Lecture Seule" (Modal)
   ========================================================================== */
.reader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.reader-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.reader-content {
    background: #ffffff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.reader-modal.hidden .reader-content {
    transform: translateY(20px);
}

.close-reader {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
}

.close-reader:hover {
    color: #0f172a;
}

.reader-header {
    padding: 30px 40px 20px;
    border-bottom: 1px solid #f1f5f9;
}

#reader-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 15px;
    margin-top: 10px;
}

.reader-meta {
    display: flex;
    gap: 20px;
    color: #64748b;
    font-size: 0.9rem;
}

.reader-body {
    padding: 30px 40px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #334155;
}

.reader-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.reader-body p {
    margin-bottom: 1.5rem;
}

.reader-body a {
    color: #3b82f6;
    text-decoration: underline;
}

.reader-footer {
    padding: 20px 40px;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

.read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0f172a;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.read-more-btn:hover {
    background: #1e293b;
}

/* Scrollbar for modal */
.reader-body::-webkit-scrollbar {
    width: 8px;
}
.reader-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.reader-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
