/* ============================================================
   FSUN2 – STYLE.CSS
   Felles stilfil for hele prosjektet
   ------------------------------------------------------------
   NB! All stil samles foreløpig her for enkelhet og oversikt.
   Deles eventuelt opp i senere versjoner.
   ------------------------------------------------------------

   STRUKTUR:
   1. Grunnleggende stil (body, html, font)
   2. Navigasjon (header, nav)
   3. Skjemaer og input-felt
   4. Oppgavetabell og prosjektvisning
   5. Modal-vinduer
   6. Hjelpeikoner (help-icon)
   7. Diverse komponenter
   ============================================================
*/

/* === Global styling === */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f7f8fa;
    margin: 0;
    padding: 0;
    color: #333;
}

nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

nav a {
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  color: #007aff;
  font-weight: 600;
  font-size: 14px;
}

nav a:hover {
    text-decoration: underline;
}

main {
    padding: 40px;
    max-width: 1280px;
    margin: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* === Form elements === */
input, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #fff;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    padding: 10px 20px;
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #005ecb;
}

/* Sørger for at nedtrekkslister bruker riktig font */
/* Gjelder f.eks. "Bytt prosjekt"-dropdown i tasklist.html */
select {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

/* === Structure === */
h2, h3, h4 {
    color: #222;
    margin-top: 30px;
    font-family: 'Inter', sans-serif;
}

ul, li {
    font-family: 'Inter', sans-serif;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 30px 0;
}

.flash {
    color: red;
    background-color: #ffecec;
    padding: 10px;
    border: 1px solid #ffb3b3;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* === Oppgavetabell og prosjektvisning === */
table.task-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-top: 20px;
}

table.task-table td,
table.task-table th {
    padding: 6px 8px !important;
    border-left: none;
    border-right: none;
}

table.task-table th {
    background-color: #f4f4f4;
    color: #333;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

table.task-table tr:hover {
    background-color: #f9f9f9;
}


/* === Stil for dashboard-tabell === */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-top: 20px;
    background-color: white;
}

.dashboard-table th,
.dashboard-table td {
    padding: 6px 10px;
    border: none;
    text-align: center;
    vertical-align: middle;
}

.dashboard-table th:first-child,
.dashboard-table td:first-child {
    text-align: left;
}

.dashboard-table th {
    background-color: #f4f4f4;
    font-weight: 600;
    color: #333;
}

/* Hover-effekt med outline-lignende skygge */
.dashboard-table tr:hover {
    background-color: #f9f9f9;
}

/* === Modal-vinduer og checkboxer === */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007aff;
    cursor: pointer;
    transform: scale(1.1);
    margin: 0;
    vertical-align: middle;
}

.completed-task {
    text-decoration: line-through;
    color: #888;
}

.completed-task .task-title {
    color: #888;
    text-decoration: line-through;
}

.completed-task .task-description {
    color: #888;
}

.completed-task .eye-icon {
    color: inherit;
    text-decoration: none;
}

.completed-task-title {
    text-decoration: line-through;
    color: #888 !important;
}

.percent-display:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* === Modal-spesial: bredere modal for "Ny oppgave" i tasklist.html === */
.modal-content.new-task-modal {
  max-width: 600px;
  width: 95%;
}

/* === Modal stil (samlet fra alle filer) === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.modal input,
.modal textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 16px;
}

/* === Modal: aktivitet i task.html === */
/* Brukes for å vise modal for ny/rediger aktivitet, med større bredde */

.modal.activity-modal .modal-content {
  max-width: 800px;
}

.modal.activity-modal textarea {
  height: 300px;
}


/* === Knapper === */
.activity-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.activity-button:hover {
    background-color: #005ecb;
}

.icon-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    color: #007aff;
    margin-right: 4px;
}

.icon-button:hover {
    text-decoration: underline;
}

/* Minimal knapp med ramme – brukes til f.eks. 'Legg til' */
.button-outline {
  all: unset;
  display: inline-block;
  background-color: transparent;
  border: 1px solid #007bff;
  color: #007bff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
  text-align: center;
  transition: background-color 0.2s ease;
}

.button-outline:hover {
  background-color: #e6e6e6; /* Svak gråfarge */
}


/* === Oppgave- og subtask-stil === */
.task-title-link {
    color: #222;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.task-title-link:hover {
    text-decoration: underline;
}

.task-description-text {
    color: #222;
    cursor: pointer;
    text-decoration: none;
}

.task-description-text:hover {
    text-decoration: underline;
}

.subtask-title-link {
    color: #444;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-style: italic;
}

.subtask-title-link:hover {
    text-decoration: underline;
}

.subtask-description-text {
    color: #444;
    cursor: pointer;
    text-decoration: none;
}

.subtask-description-text:hover {
    text-decoration: underline;
}

.project-title-link {
    color: #007aff;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
}

.project-title-link:hover {
    text-decoration: underline;
}

/* === IKON-HOVER: symboler (⮞, ➕, 🔍) === */
.toggle-subtasks-icon,
.icon-button,
.filter-icon {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.filter-icon:hover {
    filter: brightness(1.5);
    transform: scale(1.5);
}

.toggle-subtasks-icon:hover {
    transform: scale(1.5);
    color: inherit;
}

.toggle-subtasks-icon.rotate-down {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

/* === Inline redigering (prosent og frist) === */
.editable-percent {
    cursor: pointer;
    text-decoration: underline dotted;
    color: #007aff;
}

.editable-percent:hover {
    background-color: #f0f8ff;
}

.edit-icon {
    display: none;
    font-size: 12px;
    margin-left: 4px;
    vertical-align: middle;
    color: #999;
}

.editable-percent:hover .edit-icon {
    display: inline;
}

.task-row:hover,
.subtask-row:hover {
    background-color: #f9f9f9;
    box-shadow: inset 0 0 0 1px #e0e0e0;
}

.deadline-display {
    font-weight: 400;
    color: #444;
    font-size: 12px;
}

.deadline-display:empty::before {
    content: "–";
    display: inline-block;
    color: #aaa;
}

.editable-deadline {
    position: relative;
    cursor: pointer;
}

.editable-deadline .edit-icon {
    display: none;
    margin-left: 5px;
    font-size: 13px;
    color: #888;
}

.editable-deadline:hover .edit-icon {
    display: inline;
    color: #007aff;
}

/* === Hjelpetekster (help-icon) === */
.help-icon {
    font-size: 18px;
    margin-left: 6px;
    cursor: pointer;
    color: #007aff;
    font-weight: normal;
}

.help-icon:hover {
    filter: brightness(1.3);
}

body .help-tip-box {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

/* === Diverse komponenter === */
footer.fsun-footer {
    background-color: #f7f8fa;
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 30px 10px 20px;
    font-family: 'Inter', sans-serif;
}

footer.fsun-footer a {
    color: #888;
    text-decoration: none;
}

.popup-content button.close-popup {
    margin-top: 1em;
}

.project-table td,
.project-table th {
    border: 1px solid #ddd;
}

label {
    font-family: 'Inter', sans-serif;
}
/* === Dropdown prosjektvelger i tasklist === */
#projectSwitcher.select-open {
  font-size: 1rem !important;
  font-weight: 400 !important;
}

/* === Søkefelter i tasklist === */
#task-filter,
#desc-filter {
  display: none;
  margin-bottom: 10px;
}

#task-filter.active,
#desc-filter.active {
  display: inline-block !important;
}


/* === POPUP-STIL: Kontakt / Om oss / Personvern === */
/* Flyttet fra base.html 2025-04-16 */

.popup-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: white;
  padding: 1.5em;
  border-radius: 8px;
  max-width: 300px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 14px;
}

/* === LOGIN-STIL: innloggingsboks, salgsbudskap og popup === */
/* Flyttet fra login.html 2025-04-14 */
/* Matcher produksjon 100% */
.login-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

form.login-form {
  background: #f8f8f8;
  padding: 30px;
  border-radius: 10px;
  max-width: 400px;
  margin: 0 auto 40px auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

form.login-form button {
  background-color: #007aff;
  color: white;
  font-size: 1rem;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.value-icons {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  margin-top: 40px;
  margin-bottom: 30px;
  text-align: center;
}

.value-item {
  max-width: 220px;
}

.value-icon {
  height: 48px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.cta-button {
  background-color: #007aff;
  color: white;
  font-size: 1.1rem;
  padding: 12px 26px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}
.login-page img.logo {
  height: 50px;
  margin-bottom: 30px;
}

.login-page h1 {
  font-size: 2.4rem;
  margin-bottom: 0.3em;
}

.login-page p.lead {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 2em;
}

form.login-form input[type="text"],
form.login-form input[type="password"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0 20px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.value-item h3 {
  font-size: 1.1rem;
  margin-top: 12px;
  margin-bottom: 8px;
  color: #222;
}

.value-item p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}
/* === ADMIN-STIL: brukertabell og modaler === */
/* Flyttet fra admin.html 2025-04-14 – OPPDATERT 2025-04-16 etter visuell kontroll */

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  margin-top: 15px;
}

.user-table th,
.user-table td {
  border: 1px solid #ddd;
  padding: 6px 10px;
  text-align: left;
}

.user-table th {
  background-color: #f4f4f4;
  font-weight: 600;
}

.user-table tr:hover {
  background-color: #f9f9f9;
}

.user-table button {
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 4px;
  font-size: 16px;
  line-height: 1;
}

.user-table td button:hover {
  text-decoration: underline;
}

/* Første rad (skjema for ny bruker) – lys bakgrunn */
.user-table tr:first-child {
  background-color: #f7f7f7;
}
/* Outline funksjon for nylig endrede rader
/* === RADMARKERING: nylig oppdatert rad – 20.04.2025 === */
/* Denne klassen legges til midlertidig når en rad er oppdatert */
/* Bakgrunn fader automatisk ut etter noen sekunder via JS */

.row-updated {
  background-color: #fffdee; /* Samme som inline-subtask-opprettelse */
  transition: background-color 1s ease;
}
