:root {
    /* Palette de couleurs - thème clair */
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
    --footer-bg: #f1f1f1;
    --hover-color: #f0f7ff;
    --status-dev: #ff9800;
    --status-review: #3498db;
    --status-ready: #2ecc71;
}

[data-theme="dark"] {
    /* Palette de couleurs - thème sombre */
    --primary-color: #4fa3e0;
    --secondary-color: #2ecc71;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --header-bg: #1a1a1a;
    --footer-bg: #1a1a1a;
    --hover-color: #2a2a2a;
    --status-dev: #ff9800;
    --status-review: #3498db;
    --status-ready: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 60px;
}

/* Thème sombre/clair toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#theme-switch {
    display: none;
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 50px;
    height: 26px;
    background-color: var(--card-background);
    border-radius: 100px;
    position: relative;
    padding: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.switch-label i {
    font-size: 14px;
}

.fa-sun {
    color: #f39c12;
}

.fa-moon {
    color: #9b59b6;
}

.switch-label:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: 0.3s;
}

#theme-switch:checked + .switch-label:after {
    left: calc(100% - 23px);
}

/* En-tête */
header {
    background-color: var(--header-bg);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 2rem;
}

.logo-container h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Barre de recherche et options de tri */
.search-container {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    display: flex;
    flex: 1;
    min-width: 250px;
}

#search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.2rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: #2980b9;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#sort-select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Sections de projets */
section {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

section h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Cartes de projet */
.project-card {
    background-color: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-color);
}

.project-status {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 1;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-text {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dev .status-indicator {
    background-color: var(--status-dev);
}

.status-review .status-indicator {
    background-color: var(--status-review);
}

.status-ready .status-indicator {
    background-color: var(--status-ready);
}

.project-thumbnail {
    height: 160px;
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.2rem;
    flex-grow: 1;
}

.project-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.project-actions {
    display: flex;
    padding: 0.8rem 1.2rem;
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
}

.project-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.project-link:hover {
    color: #2980b9;
}

.add-note-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.add-note-btn:hover {
    color: var(--primary-color);
}

.project-notes {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.project-notes textarea {
    width: 100%;
    height: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--card-background);
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.save-note-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.save-note-btn:hover {
    background-color: #27ae60;
}

/* Message "Aucun résultat" */
#no-results {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

#no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Pied de page */
footer {
    background-color: var(--footer-bg);
    padding: 1.5rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 10;
}

.system-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.system-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Utilitaires */
.hidden {
    display: none !important;
}

/* Media Queries pour la responsivité */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .system-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-card {
        min-height: auto;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    .logo-container h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-thumbnail {
        height: 140px;
    }
    
    .project-info {
        padding: 1rem;
    }
    
    .project-actions {
        padding: 0.8rem 1rem;
    }
    
    .logo-container h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
}
