/* =========================================================
   BASE / RESET
========================================================= */

/* Allt med hidden-attribut ska aldrig visas */
[hidden] {
    display: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* =========================================================
   BODY / TYPOGRAFI
========================================================= */

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    background: var(--color-bg-muted);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Rubriker – enhetlig stil, finjusteras per komponent vid behov */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-main);
}

/* Brödtext / stycken */
p {
    margin: 0 0 0.75rem;
}

/* Listor */
ul,
ol {
    margin: 0 0 0.75rem 1.25rem;
    padding: 0;
}

/* Länkar */
a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Bilder */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
   FORMKOMPONENTER – gemensam look
========================================================= */

input,
textarea,
select,
button {
    font: inherit;
}

/* Bas-stil för inputs + textarea + select */
input,
textarea,
select {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 7px 10px; /* lite lägre men fortfarande luftigt */
    border-radius: var(--radius-md);
}

/* Gör så att fält fyller ut sin container i formulärfönster */
.field-group > input,
.field-group > textarea,
.field-group > select,
.window-card input,
.window-card textarea,
.window-card select {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Fokusstil */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-text-muted);
    box-shadow: none; /* ingen blå highlight */
    outline: none !important;
}

/* Select – gör den visuellt identisk med input + egen pil */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548L10 12.032l4.484-4.484L16 8.064l-6 6-6-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* meetingType – "Standard" som neutral standard, ej special-case placeholder längre */
#meetingType {
    color: var(--color-text-main);
}

/* Fältgrupper / etiketter / helper-text */
.field-group {
    margin-bottom: 14px; /* samma avstånd oavsett input/textarea/select */
}

.field-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.field-hint {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.field-error {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--color-danger);
}

/* =========================================================
   BUTTON — Neutral modern stil
========================================================= */

/* === Globala knappar: pill-form, grå, diskret hover === */
button {
    font: inherit;
    border-radius: 999px;
    border: none;
    background-color: transparent; /* samma bakgrund som omgivningen */
    color: var(--color-text-main);
    padding: 6px 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform 80ms ease;
}

button:hover:not(:disabled) {
    background-color: rgba(15, 23, 42, 0.03); /* väldigt diskret grå */
    border-color: var(--color-border-strong);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

/* Textlänkar (t.ex. små "Avbryt", "Läs mer") */
.link-button {
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 0; /* inte pill-form här */
    color: var(--color-text-main);
    font-weight: 500;
}

.link-button:hover:not(:disabled) {
    text-decoration: underline;
    background: transparent;
    box-shadow: none;
}

/* =========================================================
   APP-SKAL
========================================================= */

.memoro-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.memoro-app-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* så att app-main kan scrolla */
}

/* MAIN */
.app-main {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* När man drar splitter */
body.is-resizing {
    cursor: col-resize;
    user-select: none;
}

/* =========================================================
   UTILITY
========================================================= */

.hidden {
    display: none !important;
}

/* ============================================
   INFO-IKON (t.ex. vid "Sammanhang")
============================================ */

.info-icon {
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.info-icon-img {
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover .info-icon-img {
    opacity: 1;
}
