/* IMPORTING WEBFONTS */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,800,300);
/* @import url(https://fonts.googleapis.com/css?family=Patrick+Hand); */
@import url(https://fonts.googleapis.com/css?family=Londrina+Solid:400,900&display=swap);

@font-face {
    font-family: 'OpenDyslexic3';
    src: url('../fonts/OpenDyslexic3-Regular.woff2') format('woff2'),
        url('../fonts/OpenDyslexic3-Regular.woff') format('woff'),
				url('../fonts/OpenDyslexic3-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Patrick Hand';
    src: url('../fonts/PatrickHand-Regular.woff2') format('woff2'),
        url('../fonts/PatrickHand-Regular.woff') format('woff'),
        url('../fonts/PatrickHand-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* RESET
----------------------------------------------- */
*, html, body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, label, fieldset, input, p, blockquote, th, td { margin:0; padding:0; outline:none;}
fieldset, img { border:0 }
address, caption, cite, code, dfn, em, strong, th, var { font-style:normal; font-weight:normal }
ol, ul, li { list-style:none }
caption, th { text-align:left }
h1, h2, h3, h4, h5, h6 { font-size:100%; font-weight:normal }
q:before, q:after { content:''}

strong {font-weight:bold;}
em {font-style:italic;}
a img {border:none;}

/* HTML PREDEFINED TAGS
----------------------------------------------- */
html {
  scrollbar-width: thin;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
}

body {
	background: #ece4e7;
	color:#444;
	font-family:'Open Sans', sans-serif;
	font-size:14px;
	line-height:18px;
	margin:0 auto;
	padding:0;
}

/* HEADINGS */
h1, h2, h3, h4, h5, h6{color:#666; font-family:'Open Sans', sans-serif; font-weight:300;}
h1, h2, h3{margin-bottom:10px;}
h4, h5, h6{margin-bottom:15px;}
h1 {font-size:30px; line-height:32px;}
h2 {font-size:28px; line-height:28px;}
h3 {font-size:20px; line-height:22px;}
h4 {font-size:16px; line-height:20px;}
h5 {font-size:14px; line-height:18px;}
h6 {font-size:11px; line-height:16px;}

/* LINKS */
a {color:#0099cc; font-weight:normal; text-decoration:none;}
a:hover {color:#237dac; text-decoration:none;}
a img {border:none}

/* LISTS, BLOCKQUOTES AND PARAGRAPHS */
p, ul, ol, blockquote {margin-bottom:10px;}
body p:last-child{margin-bottom:0;}
ul {margin:10px 0 20px 0px;}
ol {margin:10px 0 20px 25px;}

/* CLEAR */
.clear {clear:both; float:none!important;}

/* PAGE STRUCTURE
----------------------------------------------- */
/* WRAPPER */
.wrapper {margin:0 auto; max-width:1170px; width:90%;}

/* header */
#header-bg {
	background: #7cd1f9;
	border-bottom: 1px solid #63C9F8;
	box-shadow: 1px 1px 2px rgba(50, 50, 50, 0.2);
	display: block;
	height: 100px;
	position: fixed;
	left:0;
	right: 0;
}

header {
	display:flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 0;
	height: 100%;
}

header h1 {
  color: #fff;
  font-family: 'Londrina Solid', sans-serif;
  font-size: 48px;
  font-weight: 400;
  text-shadow: 1px 1px rgba(50, 50, 50, 0.2);
}

header h1 a {color: #fff;}

header ul li {
	display:inline-block;
	margin-right: 8px;
}

header ul li button {
	background: #63C9F8;
	border-top-left-radius: 8px;
	border-bottom-right-radius: 8px;
	border: 0;
	box-shadow: 2px 2px #37B9F6;
	color:#fff;
	font-family:'Open Sans', sans-serif;
	font-size: 16px;
	padding: 10px 14px;
	cursor: pointer;
	display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
header ul li button:active {box-shadow: none; position: relative; top: 2px; left: 2px;}

/* toolbar */
.toolbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
}

#tool-header {
  background-color: #63C9F8;
  border-bottom: 1px solid #0BAAF4;
  background-color: #6AD19E; /* ljus mintgrön */
  border-bottom: 1px solid #27AE60; /* klarare grön */
  background-color: #F9C784; /* varm ljusorange */
  border-bottom: 1px solid #F48C06; /* klar orange */
  background-color: #A4D0F5; /* ljus blågrå ton */
  border-bottom: 1px solid #1E90FF; /* dodger blue */
	background-color: #BFA2DB; /* pastellila */
  border-bottom: 1px solid #8E44AD; /* djup lila */

  background-color: #9967e6;
  border-bottom: 4px solid #874BE2;
	box-shadow: 1px 1px 2px rgba(100, 100, 100, 0.2);
  padding: 4px 10px;
	font-family: 'Londrina Solid', sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.tool-title {
  font-size: 26px;
  font-weight: 400;
  color: #fff;
	display: flex;
	align-items: center;
	gap: 5px;
}

.tool-title a {color: #fff;}

.tool-title img {
	width: 20px;
	height: auto;
}

.tool-buttons {
  display: flex;
  gap: 10px;
}

.tool-buttons button {
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 20px;
  color: #fff;
  padding: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

/* Gäller bara om användaren har en riktig mus */
@media (hover: hover) and (pointer: fine) {
  .tool-buttons button:hover {
    background-color: #874BE2;
  }
}

.tool-buttons button:active {
  background-color: #6D24DB;
}

.icon-speaking {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* footer */
#footer-bg {
    background: #f5f5f5;
    border-top: 1px solid #dddcdb;
    display: block;
    height: 20px;
    position: fixed;
    left:0;
    right: 0;
    bottom: 0;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 100%;
    margin: 0;
    padding: 0;
		flex-wrap: wrap;
}

footer ul {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 16px;
}

footer ul li {
	color: #777;
	font-size: 10px;
}

footer p {
    color: #777;
    margin: 0;
    padding: 0;
		font-size: 10px;
}

/* TEXTAREA */
#text-area {
  line-height: 38px;
  padding: 6.3333333333px 10px 6.3333333333px 10px;
	border: 1px solid rgba(50, 50, 50, 0.2);
  border-radius: 8px;
	box-shadow: 5px 5px rgba(50, 50, 50, 0.1);
	font-family: var(--text-font, 'Patrick Hand'), sans-serif;
 	font-size: var(--font-size);
	height: 115vh;
	resize: none;
	display: block;
	margin: 0 auto;
	margin-top: 85px;
	margin-bottom: 40px;
	width: 68%;
	z-index: 999;
}

.lines {
	background-attachment: local;
  background-image: linear-gradient(to right, #FFF, #FFF 10px, transparent 10px), linear-gradient(to left, #FFF, #FFF 10px, transparent 10px), repeating-linear-gradient(#FFF, #FFF 36px, #f1f1f1 36px, #f1f1f1 38px);
}

#print-helper {
  display: none;
}

/* SWEET-ALERT */
.swal-modal {
  background-color:#fff;
	border:1px solid #d8d8d8;
	border-radius: 4px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.swal-button {background-color: #9967E6; transition: background 0.2s ease;}
.swal-button:hover {background-color: #874BE2 !important;}
.swal-button--cancel {background-color: #efefef;}
.swal-button--cancel:hover {background-color: #dfdfdf !important;}
.swal-button:focus {box-shadow:none;}

/* Scroll container styling (applied to wrapper) */
.swal-content > div {
  scrollbar-width: thin;
  scrollbar-color: #aaa #f1f1f1;
}

.swal-content > div ul li {
  list-style-type: disc;
}

/* Chrome/Edge scrollbar styling */
.swal-content > div::-webkit-scrollbar {
  width: 8px;
}
.swal-content > div::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.swal-content > div::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 4px;
}

.settings-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 16px;
}

.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 0 16px 0;
  border-bottom: 1px solid #eee;
}

.setting:last-child {
  border-bottom: none;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grundstil */
#rateSlider {
  -webkit-appearance: none;
  width: 150px;
  height: 6px;
  background: #ddd;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s;
}

#rateSlider:hover {
  background: #ccc;
}

/* WebKit (Chrome, Safari, Edge) */
#rateSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #9967E6;
  border-radius: 50%;
  border: 2px solid #874BE2;
  cursor: pointer;
  transition: background 0.3s;
}

#rateSlider::-webkit-slider-thumb:hover {
  background: #874BE2;
}

/* Firefox */
#rateSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #9967E6;
  border-radius: 50%;
  border: 2px solid #874BE2;
  cursor: pointer;
	transition: background 0.3s;
}

#rateSlider::-moz-range-thumb:hover {
  background: #874BE2;
}

#rateSlider::-moz-range-track {
  background: #ddd;
  height: 6px;
  border-radius: 5px;
	transition: background 0.3s;
}

#rateSlider::-moz-range-track:hover {
  background: #ccc;
}

#rateValue {
  font-weight: bold;
  min-width: 35px;
  text-align: right;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #9967E6;
}

.switch input:checked + .slider:before {
  transform: translateX(21px);
}

/* CUSTOM CLASSES
----------------------------------------------- */
.right {float:right;}
.left {float:left;}
.bold {font-weight:bold;}
.italic {font-style:italic;}
.underline {border-bottom:1px solid #d8d8d8; padding-bottom:5px;}
.center {text-align:center;}
img.center {display:block; margin-left:auto; margin-right:auto;}

/* SPACER */
div.spacer {clear:both; display:block; height:10px;}

/* @media print {
  @page {margin: 0; size: A4 portrait;}
  body, #header-bg, #header, .lines {visibility: hidden; background:none;}
  #text-area {border: none; box-shadow: none; width: 100%; height: 842px; visibility: visible; -webkit-print-color-adjust: exact;}
} */

@media print {
	#print-helper {
    display: block;
    overflow: visible;
		font-family: var(--text-font, 'Patrick Hand'), sans-serif;
		font-size: 28px;
    line-height: 40px;
    white-space: pre;
    white-space: pre-wrap;
	}

	body {
		background: none;
	}

	#text-area, #tool-header, #footer-bg {
	  display: none;
	}
}

/* @media print {
	@page:first {
		size: A4 portrait;
		 margin-top: 0mm;
	 }

	 @page {
		 size: A4 portrait;
		 margin-top: 20mm;
		 margin-bottom: 20mm;
		 margin-left: 15mm;
		 margin-right: 15mm;
	 }

	 body, #header-bg, #header, .lines {
     visibility: hidden;
     background: none;
   }

   #text-area {
     border: none;
     box-shadow: none;
     width: 100%;
     height: auto;
     visibility: visible;
     -webkit-print-color-adjust: exact;

     page-break-inside: auto;
     page-break-before: auto;
     page-break-after: auto;
     overflow: visible;
   }
} */

/* Media query för iPad i portrait-läge */
@media only screen
  and (min-device-width: 768px)
  and (max-device-width: 1024px)
  and (orientation: portrait) {

	#text-area {
		height: 85vh;
		width: 95%;
	}
}

/* ipad i landscape-läge */
@media only screen
  and (min-device-width: 810px)
  and (max-device-width: 1080px)
  and (orientation: landscape) {

  #text-area {
    width: 80%;
  }
}

/* Mobilvänlig styling */
@media (max-width: 600px) {
	#text-area {
		width: 90%;
		height: 80vh;
	}

  #footer-bg, .tool-title {
    display: none;
  }

	#rateSlider {
		width: 100px;
	}
}

/* === Dark Mode === */
body.dark-mode {
  background-color: #201a27; /* varm mörklila istället för svart */
  color: #f6f3ff; /* nästan vit, men med lite lila ton */
}

/* Header */
body.dark-mode #tool-header {
  background-color: #352b46; /* mörk lavendel-lila */
  border-bottom: 4px solid #201a27; /* accentlila */
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Textarea */
body.dark-mode #text-area {
  background-color: #2a2236; /* djup violett bakgrund */
  color: #f3eaff;
  border-color: #4a3e63;
  box-shadow: 4px 4px rgba(0,0,0,0.4);
}

/* Linjer i textarea */
body.dark-mode #text-area.lines {
  background-image:
    linear-gradient(to right, #2a2236, #2a2236 10px, transparent 10px),
    linear-gradient(to left, #2a2236, #2a2236 10px, transparent 10px),
    repeating-linear-gradient(#2a2236, #2a2236 36px, #3b3250 36px, #3b3250 38px);
}

/* SweetAlert */
body.dark-mode .swal-modal {
  background-color: #352b46 !important;
  color: #f3eaff !important;
  border: 1px solid #5c4b7e !important;
}

body.dark-mode .setting {
  border-bottom: 1px solid #2a2236;
}

body.dark-mode .swal-title,
body.dark-mode .swal-text {
  color: #f3eaff;
}

/* Footer */
body.dark-mode #footer-bg {
  background-color: #2a2236;
  border-top: 1px solid #4a3e63;
  color: #d7cfff;
}

/* Buttons */
body.dark-mode .tool-buttons button {
  color: #f3eaff;
}

body.dark-mode .tool-buttons button:hover {
  background-color: #4a3e63; /* mjuk lila hover */
  border-radius: 4px;
}

body.dark-mode .tool-buttons button:active {
  background-color: #6b4fc3;
}

/* Scrollbar (för att matcha stilen på iPad/mac) */
body.dark-mode ::-webkit-scrollbar-thumb {
  background-color: #6b4fc3;
  border-radius: 6px;
}
body.dark-mode ::-webkit-scrollbar-track {
  background-color: #2a2236;
}


/*
https://codepen.io/fivera/pen/RPyReX
https://codepen.io/lachieh/pen/GEQrow
*/
