/* Mina färger */
:root {
    --blue: #0d6efd;
    --gray: #6c757d;
    --green: #198754;
    --lightblue: #0dcaf0;
    --yellow: #ffc107;
    --red: #dc3545;
    --white: #f8f9fa;
    --black: #212529;
}

/* tar bort alla default-grejer */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* fixar body */
body {
    font-family: 'Arial', sans-serif;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* länkar */
a {
    color: #3498db;
    text-decoration: none;
}

/* hover-effekt för länkar */
a:hover {
    text-decoration: underline;
}

/* hur knapparna ser ut */
button {
    font-family: 'Arial', sans-serif;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    cursor: pointer;
}

/* hover för knapparna */
button:hover {
    background-color: #2ecc71; /* blir grönare när man hovrar */
}

/* ett container för att centrera grejer */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

/* gömmer saker */
.hidden {
    display: none;
}

/* för textutdrag som inte ska visa allt */
.text-preview {
    max-height: 10.5em; /* ca 10 rader */
    overflow: hidden;
    position: relative;
}

/* när man expanderar texten */
.big {
    max-height: none;
}

/* login-rutan */
.login-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 2em;
    border-radius: 0.5rem;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    max-width: 90%;
    width: 400px;
}

/* mörk bakgrund när login-rutan visas */
.dark-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* kort styling */
.card {
    border: none;
    border-radius: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important; /* snygg skugga */
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* tagg-stil */
.tag {
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #dee2e6;
}

/* bootstrap knappar men jag har fixat dom lite */
.btn {
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--blue);
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

/* nåt för att kunna fälla ihop saker */
.fold {
    position: relative;
}

/* container för sökresultat */
.results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* hur sökresultaten ser ut */
.result {
    padding: 1rem;
    margin-bottom: 0; 
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
    cursor: pointer;
    position: relative;
    display: block; 
    width: 100%; 
}

.result:hover {
    background-color: #f8f9fa;
}

.result h2 {
    color: var(--blue);
    margin-bottom: 0.75rem;
}

/* gör hela resultat-rutan klickbar */
.result .link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Så att knappar fortfarande funkar i resultaten */
.result button,
.result a {
    position: relative;
    z-index: 2;
}

.toggle {
    background-color: transparent;
    color: var(--blue);
    border: 1px solid var(--blue);
    padding: 0.25rem 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.toggle:hover {
    background-color: var(--blue);
    color: white;
}

/* kod-editorn */
#cr-editor {
    height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

#cr-output {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-family: monospace;
}

/* lista utan */
.simple-list {
    list-style-position: inside;
    padding-left: 0;
}

.simple-list li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.simple-list li:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.03); /* varannan rad är lite mörkare */
}