@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* === BASE GÉNÉRALE (DARK MODE) === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* === Global styles === */
body {
    padding: 0;
    background-color: #f4f6f8;
    color: 	#1e293b;
    font-family: "Inter", sans-serif;
}

a {
    text-decoration: none;
}

h1, h2, h3 {
    margin-bottom: 15px;
}
.section{
    padding:20px;
}
.desc{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}
.menu-icon{
    width: 18px;
    height: 18px;
    margin-right:10px;
}
.main-content {
    max-width: 100%;
    margin: 40px auto;
    margin-left: 250px;
    padding: 0 20px;
}
/* === Modales === */
.modale-new{
    background-color:rgba(0,0,0,0.5);
    position: absolute;
    width: 100vw;
    height: 100vh;
    top:0;
    left:0;
    display: none;
    align-items: center;
    justify-content: center;
}
.modale-new .mod-content{
    background-color: #ffffff;
    width: 500px;
    padding:20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.modale-new:target{
    display: flex;
}
/* === Log === */
.log-entry {
  background-color: #ffffff;
  border-left: 4px solid #2563eb;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.log-date {
  font-weight: bold;
  margin-bottom: 6px;
}

/* === Buttons === */
.btn, button {
    background-color: #2563eb;
    color: #f0f0f0;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin-top:10px;
}

button,.btn:hover {
    background-color: #1e40af;
}
.secondary{
    background:none;
    border: 2px solid #e0e7ff;
    text-align:center;
    padding:7px 20px;
    border-radius: 8px;
    width:100%;
    margin-top:10px;
    font-size: 1rem;
    color:#1e293b;
    transition:.2s;
}
.secondary:hover {
    background-color: #e0e7ff;
    color: #1e40af;
}

/* === Form styles === */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    width:100%;
}
label{
    font-weight: bold;
}

input, textarea, select {
    background-color: #f4f6f8;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    padding: 10px;
    resize: none;
}

input:focus,textarea:focus {
  outline: none;
  box-shadow: none; /* si nécessaire */
}

/* === Flash messages === */
.flash-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.flash-message.error {
    background-color: #a82c2c;
}

.flash-message.success {
    background-color: #2c9a4d;
}

/* === Card styles === */
.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-top:20px;
    position: relative;
    color:#1e293b;
}
.card.proj{
    max-width: 300px;
    min-width: 300px;
    transition: .1s;
    max-height: 100%;
}
.card.proj:hover{
    transform: translateY(-5px);
}
.card.task{
    min-width: 300px;
    max-width: 300px;
    height: 200px;
}
.card h4 {
    margin-top: 0;
    margin-bottom: 25px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

/* === Projets ===*/

.project-list{
    display: flex;
    flex-direction:column;
    align-items: baseline;
    gap:20px;
}
.project-list .proj{
    background-color: #ffffff;
    width: 100%;
    padding: 20px;
    border-radius:12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    color: #1e293b;
    transition:.2s;
}
.project-list .proj:hover{
    transform: scale(1.01);
}
.actions{
    position: absolute;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 9999;
    width: 160px;
    margin: auto;
    padding:10px;
    display: none;
    flex-direction:column;
    justify-content: center;
    gap:5px;
}
.actions a{
    color: #1e293b;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    transition: .2s;
    width:140px;
    border-radius: 4px;
}
.actions a:hover{
    background-color: #f1f5f9;
}
.actions a .modif-icon{
    width: 20px;
    height: 20px;
    margin-right: 15px;
}

/* Tasks */

.tasks-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:20px;
    align-items: start;
    justify-content: start;
}
.tasks-grid .task-card{
    background-color: #ffffff;
    max-width: 300px;
    width: 300px;
    padding: 20px;
    border-radius:12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    color: #1e293b;
    transition:.2s;
}
.tasks-grid .task-card h4{
    margin-bottom: 20px;
}

.tasks-grid .task-card .badge{
    margin-bottom: 20px;
}
.subtask-list {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
}
.subtask-item {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-bottom: 5px;
    max-height: 40px;
    transition:.2s;
    padding:5px;
    padding-left:10px;
}
.subtask-item:hover {
    background-color: #f4f6f8;
}
.subtask-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}
.subtask-item label .title{
    padding:0;
    margin-bottom:3px;
}
.subtask-item input[type="checkbox"] {
    accent-color: #2563eb;
    transform: scale(1.2);
    cursor: pointer;
}
/* Btn new */

.new{
    background-color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    width:50px;
    height: 50px;
    border-radius: 12px;
    position:absolute;
    bottom:40px;
    right:40px;
    color:#f0f0f0;
}
.delete-subtask-form{
    margin:0;
    padding:0;
    width:auto;
}

.right-bar{
    display: flex;
    flex-direction: column;
    position:fixed;
    right:40px;
    top:40px;
    gap:20px
}
.right-bar a{
    background-color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color:#f0f0f0;
    width: 50px;
    height: 50px;
    border-radius: 12px;
}
/* Poubelle cachée par défaut */
.subtask-delete-btn {
    background:none;
    border: none;
    cursor: pointer;
    opacity: 0;
    margin:0;
    padding:0;
    margin-right: 20px;
    transition:.2s;
    color:#1e293b;
}
.subtask-delete-btn .del-sub{
    width: 20px;
    height: 20px;
    margin-top:3px;
}

.subtask-item:hover .subtask-delete-btn {
    opacity: 1;
}

/* Formulaire d’ajout de sous-tâche */
.subtask-form {
    display: flex;
    gap: 1px;
    margin-top: 15px;
}

.subtask-form input[type="text"] {
    flex-grow: 1;
    background-color: #f4f6f8;
    border-radius: 6px;
    padding: 6px 10px;
    color: #1e293b;
    height:35px;
}

.subtask-form button {
    background-color: #2563eb;
    color: #f0f0f0;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subtask-form button:hover {
    background-color: #1e40af;
}
.task-card .cta{
    display: flex;
    gap:10px;
    align-items:center;
    margin-top: 20px;
}
.cta a{
    color: #f0f0f0;
    background-color: #2563eb;
    padding:3px 15px;
    padding-top:5px;
    border-radius: 6px;
    transition: .2s;
}
.cta a .modif-icon.setting{
    transition: ease-in-out .2s;
}
.cta a:hover .modif-icon.setting{
    transform: rotate(45deg);
}
.cta a.delete{
    background-color: #c42d2d;
}
.cta a:hover{
    background-color: #1e40af;
}
.cta a.delete:hover{
    background-color: #ad2b2b;
}
/* === Sidebar/Menu === */
.sidebar {
    margin-top:-40px;
    background-color: #ffffff;
    width: 250px;
    height: 100vh;
    padding: 15px;
    padding-top:50px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 30px;
}

.sidebar-logo {
    width: 100px;
    height: auto;
}

.sidebar-nav li {
    margin-bottom: 1rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 500;
    color: #1e293b;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: #e0e7ff;
    color: #1e40af;
}

.sidebar-nav a.active {
    background-color: #2563eb;
    color: #f0f0f0;
}

.logout-link {
    display: block;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #f0f0f0;
    background-color: #c42d2d;
    padding:10px;
    text-decoration: none;
    border-radius: 8px;
}

.logout-link:hover {
    text-decoration: underline;
}

.menu-icon {
    width: 18px;
    height: 18px;
}
.sidebar-toggle{
    display: none;
    
}
/* === Avatars === */
.avatar-group {
    display: flex;
    margin-top: 15px;
    margin-left: 10px;
    position: relative;
}

.avatar-group .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1c1c1c;
    margin-left: -10px;
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.avatar-group .avatar:hover {
    transform: scale(1.1);
    z-index: 10;
}

.avatar-group .tooltip {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: #2a2a2a;
    color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    visibility: hidden;
}

.avatar-group:hover .tooltip {
    visibility: visible;
}
/* === Calendar === */
.calendar {
    margin-top: 30px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-header {
    text-align: center;
    font-weight: bold;
    padding: 10px 0;
    background: #f0f0f0;
    border-radius: 6px;
}

.calendar-cell {
    background: #ffffff;
    padding: 8px;
    border-radius: 8px;
    height: 100px;
    max-height: 100px; /* Limite la hauteur de la case */
    position: relative;
    color: #1e293b;
    cursor: pointer;
    overflow: scroll;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.calendar-cell.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.date-number {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Conteneur scrollable dans la cellule */
.calendar-content {
    overflow-y: scroll;
    margin-top: 16px; /* Espace sous le numéro du jour */
    flex-grow: 1;
    height: 46px;
    scrollbar-width: none;
}

/* Lien tâche classique */
.task-link {
    display: block;
    font-size: 0.9rem;
    color: #f0f0f0;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Statuts couleurs */
.task-todo {
    background-color: #e2e8f0;
    color: #1e293b;
}

.task-progress {
    background-color: #2563eb;
    color: #f0f0f0;
}

.task-done {
    background-color: #16a34a;
    color: #f0f0f0;
}

.task-link:hover {
    opacity: 0.9;
}

/* Événement ponctuel */
.event-entry {
    display: block;
    font-size: 0.9rem;
    color: #1e293b;
    padding: 2px 4px;
    background:#e2e8f0;
    border-radius: 4px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    border-bottom: 2px solid #592a87;
}

/* === Status badge === */
.status-badge {
    display: inline-block;       /* CRUCIAL : éviter le display: inline */
    will-change: transform, opacity;  /* aide le navigateur à anticiper l’animation */
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    position:relative;
    top:20px;
}
.status-badge.todo {
    background-color: #e2e8f0;
    color: #1e293b;
}

.status-badge.progress {
    background-color: #2563eb;
    color: #f0f0f0;
}

.status-badge.done {
    background-color: #16a34a;
    color: #f0f0f0;
}

@keyframes statusFade {
    0% {
        opacity: 1; 
        transform: scale(1);
    }
    50% {
        opacity: 0.3; 
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.status-badge.animate {
    animation: statusFade 0.4s ease-in-out;
}

/*Side panel*/

.side-panel {
  position: fixed;
  top: 0;
  right: -400px; /* caché à droite */
  width: 400px;
  height: 100vh;
  background-color: #ffffff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: right 0.3s ease;
}

.side-panel.open {
  right: 0; /* affiché */
}

.side-panel-content {
  padding: 20px;
  color: #1e293b;
  overflow-y: auto;
  height: 100%;
  scrollbar-width: none;
}

.close-panel {
  background: none;
  border: none;
  font-size: 24px;
  color: #1e293b;
  cursor: pointer;
  position:absolute;
  top:10px;
  right:10px;
}
.member-list li, .member-card.creator{
    background-color: #f4f6f8;
    padding:10px;
    border-radius:8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.idea-list{
    display: flex;
    align-items: center;
    justify-content: start;
    gap:20px;
    flex-wrap: wrap;
}
.idea-card{
    background-color: #feff9c;
    width: 170px;
    height: 170px;
    border-radius: 8px;
    position: relative;
    transition:.2s;
    padding:10px;
}
.idea-card:hover{
    transform: scale(1.03);
}
.idea-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  border-width: 30px 30px 0px 0px;
  border-style: solid;
  border-color: white transparent transparent transparent;
  z-index: 1;
  transform: rotate(180deg);
}
.idea-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  border-width: 30px 30px 0 0;
  border-style: solid;
  border-color: #fff740 transparent transparent transparent;
  border-radius: 8px 0;
}
.idea-card p{
    text-align: center;
    font-weight: bold;
    font-style: italic;
    width:100%;
    height:130px;
    overflow: hidden;
}
.idea-card p::first-letter{
    text-transform: uppercase;
}
.idea-card a{
    position: absolute;
    bottom:10px;
    left:10px;
    color:red;
}
/* === Responsive Design === */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease-in-out;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        position: absolute;
        top: 20px;
        right: 20px;
        background-color: #592a87;
        color: #f0f0f0;
        border: none;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 1rem;
        z-index: 1100;
        cursor: pointer;
        visibility: visible;
    }

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

    .filter-box {
        width: 100%;
        border-radius: 0;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
    input, select, textarea {
        font-size: 1rem;
    }
}
