/* Réinitialisation et configuration de base */
:root {
    --bg-color: #f4f6f8;
    --sidebar-bg: #ffffff;
    --text-color: #333;
    --accent-color: #007bff;
    --border-color: #e0e0e0;
    --hover-bg: rgba(0, 123, 255, 0.1);
}

body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100%;
    overflow: hidden;
}

/* Structure principale de l'application */
.app-container {
    display: flex;
    height: 100vh;
}

/* Barre latérale */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.sidebar header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
}
.sidebar h1 { 
    font-size: 1.2em; 
    margin: 0; 
}
.sidebar nav {
    overflow-y: auto;
    flex-grow: 1;
    padding: 1em;
}

/* Panneau de liste d'articles */
.article-list-pane {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.article-list-pane header {
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0;
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}
#current-view-title {
    margin: 0;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.view-actions {
    display: flex;
    gap: 1em;
}

/* Panneau de lecture d'article */
.article-view-pane {
    width: 50%;
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    transition: width 0.3s ease, padding 0.3s ease;
    padding: 1.5em;
    box-sizing: border-box;
    background: white;
}
.article-view-pane.is-closed {
    width: 0;
    padding: 0;
    border-left: none;
    overflow: hidden;
}
.article-view-pane header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1em;
}
#article-content h1 { font-size: 1.5em; margin-bottom: 0.5em; line-height: 1.3; }
#article-content a { color: var(--accent-color); text-decoration: none; }
#article-content a:hover { text-decoration: underline; }
#article-content img { max-width: 100%; height: auto; border-radius: 4px; }
#article-content p { line-height: 1.6; }

/* Styles des listes et éléments interactifs */
#feeds-list, #articles-container, #global-filters {
    list-style: none;
    padding: 0;
    margin: 0;
}

#feeds-list li, #global-filters li, .folder summary {
    padding: 0.5em 0.75em;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#feeds-list li:hover, #global-filters li:hover, .folder summary:hover {
    background-color: var(--hover-bg);
}
#feeds-list li.active, #global-filters li.active, .folder summary.active {
    background-color: var(--accent-color);
    color: white;
}
.unread-count {
    background-color: #ccc;
    color: #333;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}
li.active .unread-count, summary.active .unread-count { 
    background-color: white; 
    color: var(--accent-color);
}

/* Styles des articles */
#articles-container li {
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}
#articles-container li.is-read { 
    opacity: 0.6; 
}
#articles-container li.is-read h3 {
    font-weight: normal;
}
#articles-container li:hover { 
    background-color: var(--hover-bg);
}
#articles-container li h3 { 
    margin: 0 0 0.3em 0; 
    font-size: 1em;
}
#articles-container li .meta { 
    font-size: 0.8em; 
    color: #888; 
}

/* Styles pour les dossiers */
.folder details {
    padding-left: 0;
}
.folder summary {
    font-weight: bold;
}
.folder summary::marker {
    content: '▶ ';
    font-size: 0.8em;
}
details[open] > summary::marker {
    content: '▼ ';
}
.feeds-in-folder {
    list-style: none;
    padding-left: 1.5em;
    margin-top: 0.5em;
}

/* Styles pour les formulaires */
.sidebar-section {
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
}
.add-feed-form, .add-folder-form {
    display: flex;
    gap: 0.5em;
    margin-bottom: 0.5em;
}
.add-feed-form input, .add-feed-form select, .add-folder-form input, #search-box {
    width: 100%;
    min-width: 0;
    padding: 0.5em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
}
button {
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.5em 0.8em;
    border-radius: 4px;
}
button:hover {
    border-color: #aaa;
    background: #f9f9f9;
}