/* ====================================================================
   ESTILS GENERALS – Notes i Tasques
===================================================================== */

body {
  font-family: 'Inter', Arial, sans-serif;
  background: #f4f6f9;
  margin: 0;
  padding: 0;
}

h1 {
  margin: 20px;
  font-size: 1.8rem;
  color: #1a237e;
  font-weight: 700;
}

.btn-new {
  margin: 20px;
  padding: 10px 20px;
  background: #1a237e;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: 0.2s ease;
  white-space: nowrap;
}

.btn-new:hover {
  background: #0d1652;
}


/* ====================================================================
   CONTENIDORS NOTES / TASQUES
===================================================================== */

.notes-container,
.tasks-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  padding: 20px;
}

.tasks-section-title {
  margin: 32px 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a237e;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Punt visual suau a l'esquerra */
.tasks-section-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a237e;
  opacity: .6;
}

/* Versió acabades: més discreta */
.tasks-section-title.completed {
  margin-top: 48px;
  color: #777;
}

.tasks-section-title.completed::before {
  background: #999;
  opacity: .4;
}

/* Wrapper de tasques acabades */
#completedTasks {
  transition: opacity .25s ease, transform .25s ease;
}

#completedTasks.hidden {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

#completedTasks.visible {
  opacity: 1;
  transform: translateY(0);
}



body {
  overflow-y: auto;
  padding-bottom: 90px; /* ← espai per no quedar sota el dock */
}

.tasks-container {
  overflow: visible;
}

.tasks-page {
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 20px;
}

.tasks-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 24px;
}

.tasks-section-title {
  margin: 32px 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a237e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-section-title::before {
  content: "•";
  color: #d4af37;
  font-size: 1.4rem;
}






/* ====================================================================
   TARGETES NOTES
===================================================================== */

.note-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  position: relative;
  border-left: 4px solid #1a237e;
  transition: 0.2s ease;
}

.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.note-card h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #1a1a1a;
  font-weight: 700;
}

.note-card p {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #555;
  white-space: pre-wrap;
  line-height: 1.4;
}


/* ====================================================================
   TARGETES TASQUES
===================================================================== */

.task-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;   /* <-- AFEGIT */
  min-height: 160px;        /* <-- AFEGIT */
  gap: 15px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-left: 4px solid #d4af37;
  transition: 0.2s ease;
}

.task-info {
  flex: 1;                  /* <-- AFEGIT */
}


.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Checkbox personalitzat */
.task-check {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #1a237e;
}

.task-info {
  flex: 1;
}

.task-info.checked h3,
.task-info.checked p {
  text-decoration: line-through;
  opacity: 0.55;
}

.task-info h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #1a1a1a;
  font-weight: 600;
}

.task-info p {
  margin: 4px 0 8px 0;
  font-size: 0.94rem;
  color: #555;
}

.task-date {
  background: #e8ecff;
  color: #283593;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap; /* per seguretat en pantalles petites */
}



/* ====================================================================
   BOTONS PETITS
===================================================================== */

.btn-edit, .btn-delete, .btn-convert {
  font-size: .85rem;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-edit {
  background: #1976d2;
  color: white;
}

.btn-edit:hover {
  background: #0f4c8c;
}

.btn-delete {
  background: #c62828;
  color: white;
}

.btn-delete:hover {
  background: #8e1e1e;
}

.btn-convert {
  background: #ff8f00;
  color: white;
}

.btn-convert:hover {
  background: #cc7400;
}

/* BOTÓ: Veure tasca (blau corporatiu) */
.btn-view-task {
  background: #1a237e;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-view-task:hover {
  background: #0f1755;
  transform: translateY(-1px);
}


/* ====================================================================
   MODALS
===================================================================== */

#noteModal,
#taskModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 25px;
  width: 94%;
  max-width: 480px;

  /* 🔥 Solució per evitar que ocupi massa pantalla */
  max-height: 85vh;       /* Mai més alt que la pantalla */
  overflow-y: auto;       /* Scroll intern quan s'omple */
  overscroll-behavior: contain; /* Evita scroll al body */

  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.15);
  animation: fadeIn 0.25s ease;
}


/* Inputs */
.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 80%;
  margin-top: 12px;
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #ccc;
}

/* Accions modal */
.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
}

/* Modal subtasques */
#subtaskModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.subtasks-list {
  margin-top: 15px;
  border-left: 3px solid #d4af37;
  padding-left: 20px;
}

.subtask-item {
  margin-bottom: 22px;
  position: relative;
  cursor: pointer;
  padding-left: 5px;
}

.subtask-item::before {
  content: "";
  width: 14px;
  height: 14px;
  background: white;
  border: 2px solid #1a237e;
  border-radius: 50%;
  position: absolute;
  left: -28px;
  top: 3px;
  transition: 0.2s ease;
}

.subtask-item.checked::before {
  background: #4caf50;
  border-color: #4caf50;
}

.subtask-title {
  font-size: 1rem;
  font-weight: 600;
}

.subtask-title.checked {
  color: #888;
  text-decoration: line-through;
}

.subtask-deadline {
  font-size: 0.83rem;
  color: #555;
  margin-top: 3px;
}

.step-del {
  background: none;
  border: none;
  color: #c00;
  font-size: 1rem;
  cursor: pointer;
  position: absolute;
  right: -10px;
  top: 3px;
}




/* Contenidor de subtasques dins targeta */
/* ==============================
   SUBTASKS PREVIEW (targetes)
============================== */
/* CONTENIDOR */
.subtasks-preview {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #eee;
}

/* UNA SUBTASCA A LA TARGETA */
.mini-subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  line-height: 1.25;
}

/* RODONETA */
.circle {
  width: 14px;
  height: 14px;
  border: 2px solid #1a237e;
  border-radius: 50%;
  flex-shrink: 0;
}

.circle.checked {
  background: #4caf50;
  border-color: #4caf50;
}


/* TEXT */
.subtask-text {
  font-size: 0.92rem;
  color: #222;
}

/* TEXT QUAN ESTÀ FET */

.mini-subtask.done .subtask-text {
  text-decoration: line-through;
  opacity: .55;
}


/* DATA */
.mini-date {
  font-size: 0.78rem;
  color: #777;
  margin-left: 4px;
}

.go-tasks-btn {
  background: #1a237e;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.go-tasks-btn:hover {
  background: #0f1755;
}




/* MODAL DE VERITAT */


/* Classe per ocultar */
.hidden {
  display: none !important;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====================================================================
TOASTS
===================================================================== */

/* ====== TOAST CORPORATIU BD ====== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1a237e;
  color: white;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(30px);
  transition: 0.35s ease;
  z-index: 99999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.eines-countdown-banner {
  background: #f0f4ff;
  border-left: 4px solid #1a237e;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: #1a237e;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#countdown {
  font-weight: bold;
  min-width: 155px;
  text-align: right;
}

.modal-content, 
.modal-content * {
  box-sizing: border-box;
  max-width: 100%;
}

#dayModal .modal-content {
  background: white;
  padding: 18px;           /* més compacte */
  width: 90%;
  max-width: 380px;
  border-radius: 12px;

  max-height: 80vh;        /* evita que sigui massa alt */
  overflow-y: auto;
}

/* Títol */
#dayModal .modal-content h2 {
  font-size: 1.15rem;       /* més petit */
  line-height: 1.18;
  margin-bottom: 8px;
}

/* Subtítols dins modal */
#dayModal .modal-content h3,
#dayModal .modal-content h4 {
  font-size: 1rem;
  margin: 10px 0 6px;
}

/* Text “No hi ha tasques” */
#dayModal p {
  margin: 4px 0 10px;
  font-size: 0.92rem;
}

/* Inputs més petits i compactes */
#dayModal .modal-content input,
#dayModal .modal-content textarea {
  padding: 10px;             /* menys altura */
  margin-top: 8px;
  font-size: 0.95rem;
}

/* Botons més compactes */
#dayModal .modal-actions button {
  padding: 6px 14px;
  font-size: 0.9rem;
}

/*Eines dock*/

.eines-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 9999;
}

.eines-dock .dock-item {
  text-decoration: none;
  color: #1a237e;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.6;
  transition: opacity .2s;
}

.eines-dock .dock-item:hover {
  opacity: 1;
}

.eines-dock .dock-item.active {
  opacity: 1;
  font-weight: 700;
}

.eines-dock span {
  font-size: 0.75rem;
}

/*Eines banner 7 days trial*/

.eines-status{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 999999;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  padding: 10px 16px;
  font-weight: 800;
  font-size: 14px;

  border-bottom: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
}

/* per centrar contingut en ample màxim */
.eines-status__wrap{
  width: min(1200px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eines-status__thanks{
  opacity: .7;
  font-weight: 700;
}



.eines-status.hidden{ display:none; }

.eines-status--trial{
  background: rgba(255, 214, 102, 0.20);
}

/* FIX calendari: no deixis que el CSS global de button afecti el banner */
.eines-status button{
  margin-top: 0 !important;
}

.eines-status--premium{
  background: rgba(0, 255, 140, 0.12);
}



/* Assegurem layout topbar */
.eines-status__btn{
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  background: #1a237e;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}
.eines-status__btn:hover{
  opacity: .9;
}


body{
  padding-top: 56px; /* altura del banner */
}


.hidden { display: none; }


/* boto comprovant google calendar connect rodonetes */

.gcal-btn{
  display:flex;
  align-items:center;
  gap:10px;
  white-space: nowrap;
  margin-left: auto;            /* ✅ empenta google a la dreta */
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e3e6ef;
  background: white;
  cursor: pointer;
  font-weight: 600;
}

.gcal-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: #1a237e; /*blau per defecte*/
}

.gcal-btn.is-connected{
  background: rgba(0, 180, 90, 0.12);
  color: #0b5;
  border: 1px solid rgba(0, 180, 90, 0.25);
}

.gcal-btn.is-disconnected{
  background: rgba(255, 75, 75, 0.10);
  color: #c62828;
  border: 1px solid rgba(255, 75, 75, 0.20);
}

.gcal-btn.is-loading{
  background: rgba(26,35,126,0.10);
  color: #1a237e;
  border: 1px solid rgba(26,35,126,0.15);
}


.gcal-badge{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:13px;

  background:#dff6e7;
  border:1px solid #b6e7c8;
  color:#0b7a38;
}

.gcal-btn.is-connected .gcal-dot{
  animation: gcalPulse 2.4s ease-in-out infinite;
}


@keyframes gcalPulse{
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  60%  { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}


/*barra horitzontal a tasques*/

.tasks-topbar{
  display:flex;
  align-items:center;
  gap:14px;
  margin: 14px 0 18px;
  flex-wrap: wrap;              /* ✅ per mòbil */
}

.tasks-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 0 6px;
  font-size: 0.95rem;
  opacity: 0.9;
  white-space: nowrap;
}


/*Selector tasques acabades*/

/* ====================================================================
   SLIDER TOGGLE - Tasques acabades (lock selector)
===================================================================== */

.tasks-toggle--slider{
  gap: 0;             /* el slider ja ocupa tot */
  opacity: 1;         /* evitem el 0.9 que tenies */
}

/* amaguem input real però mantenim l'accessibilitat */
.tasks-toggle--slider input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* "pill" principal */
.slider-toggle{
  position: relative;
  height: 42px;
  width: 270px;
  border-radius: 999px;

  background: rgba(17, 24, 39, 0.045);  /* ✅ més suau */
  border: 1px solid rgba(17, 24, 39, 0.08); /* ✅ més prim visual */
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); /* ✅ shadow interior, no “gros” */

  cursor: pointer;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* thumb que llisca */
.slider-toggle__thumb{
  position: absolute;
  top: 4px;
  left: 4px;
  height: 34px;
  width: calc(50% - 6px);
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 10px 22px rgba(17,24,39,0.22);
  transition: transform .22s cubic-bezier(.2,.9,.2,1);
}


/* labels */
.slider-toggle__label{
  position: relative;
  width: 50%;
  text-align: center;
  z-index: 2;

  font-weight: 800;
  font-size: 13px;
  letter-spacing: .1px;
  transition: color .18s ease, opacity .18s ease;
  user-select: none;
}

.slider-toggle__label--left{
  color: #fff;
}

.slider-toggle__label--right{
  color: #111827;
  opacity: .72;
}

.slider-toggle:hover{
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

.slider-toggle:active{
  transform: translateY(0px) scale(0.99);
}


/* ✅ hover suau */
.tasks-toggle--slider:hover .slider-toggle{
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  border-color: rgba(26,35,126,0.22);
}

/* ✅ quan està checked, thumb cap a la dreta */
#toggleCompleted:checked + .slider-toggle .slider-toggle__thumb{
  transform: translateX(100%);
}

/* ✅ colors quan ON */
#toggleCompleted:checked + .slider-toggle .slider-toggle__label--left{
  color: #111827;
  opacity: .72;
}
#toggleCompleted:checked + .slider-toggle .slider-toggle__label--right{
  color: #fff;
  opacity: 1;
}

/* ✅ focus visible (teclat) */
.tasks-toggle--slider:focus-within .slider-toggle{
  box-shadow: 0 0 0 4px rgba(255,200,0,0.22), 0 10px 22px rgba(0,0,0,0.10);
  border-color: rgba(255,200,0,0.35);
}


/*Calendar day view boto event daurat*/

.day-cta{
  margin: 16px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.add-event-btn{
  background: linear-gradient(90deg,#d4af37,#f3d88b);
  color:#111827;
  border:none;
  padding:10px 14px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  transition:.2s ease;
}

.add-event-btn:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.add-event-btn{
  border: 1px solid rgba(17,24,39,0.15);
}

.day-section-title{
  margin: 0 0 10px;
  color:#1a237e;
  font-weight: 800;
  font-size: 1.05rem;
}



@media (max-width: 700px){
  .gcal-btn{
    margin-left: 0;             /* ✅ en mòbil baixa a sota */
    width: 100%;
    justify-content: center;
  }
}

