/* ==========================================================================
   Figure Schedule — Frontend Calendar
   ========================================================================== */

.fs-calendar-wrap * {
	font-family: inherit;
	box-sizing: border-box;
}

/* --- Toolbar --- */
.fs-cal-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px;
	background: #f6f6f6;
	border-radius: 8px;
	margin-bottom: 24px;
	flex-wrap: nowrap;
}
.fs-cal-toolbar-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-cal-toolbar-right { display: flex; align-items: center; gap: 6px; }

/* Gruppfilter */
.fs-group-filter-wrap { position: relative; }

.fs-group-filter-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border: 1px solid #555 !important;
	border-radius: 6px;
	background: #fff !important;
	cursor: pointer;
	font-size: 16px;
	font-weight: 700;
	white-space: nowrap;
	font-family: inherit;
	color: #000 !important;
	transition: none;
}
.fs-group-filter-btn:hover,
.fs-group-filter-btn.is-open {
	background: #fff !important;
	color: #000 !important;
	border-color: #555 !important;
}
.fs-group-filter-btn .fs-chevron { font-size: 10px; transition: transform .2s; }
.fs-group-filter-btn.is-open .fs-chevron { transform: rotate(180deg); }
.fs-group-filter-btn:focus-visible,
.fs-filter-clear:focus-visible {
	outline: 2px solid var(--fs-cal-accent, #1B9AF7);
	outline-offset: 2px;
}

.fs-group-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 200;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,.1);
	min-width: 200px;
	padding: 8px 0;
}
.fs-group-dropdown.is-open { display: block; }

.fs-group-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 16px;
	transition: background .1s;
	font-family: inherit;
}
.fs-group-option:hover { background: #f5f5f5; }
.fs-group-option input[type="checkbox"] { margin: 0; cursor: pointer; }



/* Vyväljare */
.fs-view-tabs { display: flex; }
.fs-view-tab {
	padding: 7px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	background: #fff !important;
	border: 1px solid #ddd;
	border-right: none;
	transition: none;
	white-space: nowrap;
	font-family: inherit;
	color: #404040 !important;
	letter-spacing: .02em;
}
@media (max-width: 480px) {
	.fs-view-tab { padding: 7px 10px; }
}
.fs-view-tab:first-child { border-radius: 6px 0 0 6px; }
.fs-view-tab:last-child  { border-radius: 0 6px 6px 0; border-right: 1px solid #ddd; }
.fs-view-tab.is-active {
	background: var(--fs-cal-accent, #1B9AF7) !important;
	color: #fff !important;
	border-color: var(--fs-cal-accent, #1B9AF7);
}
.fs-view-tab:hover:not(.is-active) {
	background: #f8f8f8 !important;
	color: var(--fs-cal-accent, #1B9AF7) !important;
}
.fs-view-tab:focus-visible {
	outline: 2px solid var(--fs-cal-accent, #1B9AF7);
	outline-offset: -2px;
}

/* --- Layout --- */
.fs-cal-main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: start;
}
@media (max-width: 768px) {
	.fs-cal-main { grid-template-columns: 1fr; gap: 22px; }
}

/* --- Månadsvy: Navigering --- */
.fs-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.fs-cal-title-wrap { flex: 1; text-align: center; }
.fs-cal-nav-btn {
	background: none !important;
	border: none;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	color: var(--fs-cal-accent, #1B9AF7) !important;
	padding: 4px 8px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
	white-space: nowrap;
}
.fs-cal-nav-btn:hover { background: none !important; }
.fs-cal-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .02em;
}

/* Grid — utan borders */
.fs-cal-grid { width: 100%; border-collapse: collapse; }
.fs-cal-grid th {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	padding: 12px 0;
	letter-spacing: .06em;
	vertical-align: middle;
	background: #e4e4e4;
}
.fs-cal-grid td {
	text-align: center;
	padding: 3px 0;
	vertical-align: top;
	background: transparent;
	border: none;
}

.fs-cal-day {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	width: 40px;
	cursor: default;
}
.fs-cal-day.has-sessions { cursor: pointer; }
.fs-cal-day.has-sessions:hover .fs-day-num { background: #f0f0f0; }

.fs-day-num {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 16px;
	font-weight: 500;
	transition: background .15s;
	color: #333;
}
.fs-cal-day.is-today .fs-day-num {
	background: var(--fs-cal-accent, #1B9AF7);
	color: #fff;
	font-weight: 700;
}
.fs-cal-day.is-selected:not(.is-today) .fs-day-num {
	background: rgba(27,154,247,.12);
	color: var(--fs-cal-accent, #1B9AF7);
	font-weight: 700;
}
.fs-cal-day.is-other-month .fs-day-num { color: #ccc; }

/* Prickar — EN accentfärgad prick per dag med pass */
.fs-day-dots { display: flex; gap: 3px; justify-content: center; min-height: 7px; margin-top: -1px; margin-bottom: 10px; }
.fs-day-dot  { width: 6px; height: 6px; border-radius: 50%; }

/* --- Höger panel (dag) --- */
.fs-day-panel {
	background: transparent;
	border: none;
}
.fs-day-panel-header {
	padding: 0 0 20px 0;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #55595f;
	text-align: center;
	border-bottom: 1px solid #bfbfbf;
}
.fs-day-panel-body { padding: 0; }

.fs-session-card {
	padding: 14px 0;
	border-bottom: 1px dashed #cecece;
}
.fs-session-card:last-child { border-bottom: none; }

.fs-session-time {
	font-size: 14px;
	font-weight: 600;
	color: #1a1a1a;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 5px;
}
.fs-clock-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	opacity: .85;
}
.fs-session-title {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}
.fs-session-color-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.fs-session-meta { font-size: 14px; color: #535353; }
.fs-day-panel-empty {
	padding: 32px 0;
	text-align: center;
	color: #bbb;
	font-size: 16px;
	font-style: italic;
}

/* --- Veckovy --- */
.fs-week-view {}
.fs-week-day-block { margin-bottom: 10px; }
.fs-week-day-header {
	font-size: 16px;
	font-weight: 700;
	color: #555;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: 12px;
	background: #f5f5f5;
	border-bottom: none;
	margin-bottom: 8px;
	display: block;
}
@media (max-width: 768px) {
	.fs-week-day-header { font-size: 13px; }
}
.fs-week-date-num {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}
.fs-week-day-header.is-today {
	background: #e9f0f5;
	border-left: 3px solid #1b9af7;
}
.fs-week-session { padding: 8px 0 8px 12px; border-bottom: 1px dashed #cecece; }
.fs-week-session:last-child { border-bottom: none; }
.fs-week-empty { font-size: 16px; color: #808080; font-style: italic; padding: 4px 0 8px; }

/* --- Dagvy --- */
.fs-day-view-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.fs-day-view-title { font-size: 18px; font-weight: 700; }
.fs-day-view-btn {
	background: none;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	color: var(--fs-cal-accent, #1B9AF7);
	font-family: inherit;
}
.fs-day-view-btn:hover { background: #f5f5f5; }

/* Spinner */
.fs-cal-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(0,0,0,.1);
	border-top-color: var(--fs-cal-accent, #1B9AF7);
	border-radius: 50%;
	animation: fs-cal-spin .6s linear infinite;
	vertical-align: middle;
}
@keyframes fs-cal-spin { to { transform: rotate(360deg); } }

/* --- Rensa filter (utanför dropdown, bredvid selectbox) --- */
.fs-filter-clear {
	display: none;
	padding: 7px 14px;
	background: none;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 400;
	cursor: pointer;
	color: #404040;
	font-family: inherit;
	white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}
.fs-filter-clear:hover {
	background: var(--fs-cal-accent, #1B9AF7);
	color: #fff;
	border-color: var(--fs-cal-accent, #1B9AF7);
}

/* --- Session-kort klickbart --- */
.fs-session-card { cursor: pointer; }
.fs-week-session.fs-session-clickable { cursor: pointer; }
.fs-week-session.fs-session-clickable:hover { background: #f7f7f7; border-radius: 4px; }
.fs-session-card:hover { background: #fafafa; border-radius: 6px; }
.fs-session-clickable { text-decoration: none; }

/* --- Modal --- */
.fs-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.45);
	z-index: 9999;
	align-items: center;
	justify-content: center;
}
.fs-modal-overlay.is-open { display: flex; }

body.fs-modal-open { overflow: hidden; }

.fs-modal-box {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 32px;
	width: 640px;
	max-width: 90vw;
	box-shadow: 0 8px 40px rgba(0,0,0,.18);
	animation: fs-modal-in .18s ease;
}
@media (max-width: 768px) {
	.fs-modal-box {
		width: 90%;
		padding: 20px;
	}
}
@keyframes fs-modal-in {
	from { opacity: 0; transform: translateY(12px) scale(.97); }
	to   { opacity: 1; transform: none; }
}

.fs-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 4px 8px;
	border-radius: 4px;
	font-family: inherit;
}
.fs-modal-close:hover { color: #333; background: #f5f5f5; }

.fs-modal-title {
	font-size: 20px !important;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 30px 0;
	padding-right: 24px;
}

.fs-modal-moments {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fs-modal-moments li {
	padding: 10px 0;
	border-bottom: 1px dashed #cecece;
	font-size: 15px;
	color: #333;
	line-height: 1.5;
}
.fs-modal-moments li:last-child { border-bottom: none; }

.fs-modal-time {
	font-weight: 600;
	color: #1a1a1a;
}
.fs-modal-moment-name { font-weight: 600; }
.fs-modal-location { color: #888; font-size: 16px; }

/* Modal extra information */
.fs-modal-extra {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #f0f0f0;
	font-size: 16px;
	color: #555;
	line-height: 1.7;
}
.fs-modal-extra p { margin: 0 0 8px; }
.fs-modal-extra p:last-child { margin-bottom: 0; }

/* --- Day panel slide-up animation --- */
@keyframes fs-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
.fs-day-panel-body.fs-animate .fs-session-card,
.fs-day-panel-body.fs-animate .fs-day-panel-empty {
	animation: fs-slide-up .25s ease both;
}
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(1) { animation-delay: 0ms; }
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(2) { animation-delay: 50ms; }
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(3) { animation-delay: 100ms; }
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(4) { animation-delay: 150ms; }
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(5) { animation-delay: 200ms; }
.fs-day-panel-body.fs-animate .fs-session-card:nth-child(6) { animation-delay: 250ms; }

/* --- Desktop: tidangivelse 15px (override mobilens 14px) --- */
@media (min-width: 769px) {
	.fs-session-time { font-size: 15px; }
}

/* --- Today shortcode --- */
.fs-today-wrap .fs-session-card:first-child { padding-top: 0; }
.fs-today-empty { color: #505050; font-size: 16px; font-style: italic; margin: 0; }

/* --- Skeleton loading (figure_schedule_today) --- */
.fs-today-skeleton { padding: 4px 0; }
.fs-skel-block {
	background: linear-gradient(90deg, #ececec 25%, #f5f5f5 50%, #ececec 75%);
	background-size: 200% 100%;
	animation: fs-skel-shimmer 1.4s infinite;
	border-radius: 4px;
	margin-bottom: 8px;
}
@keyframes fs-skel-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
.fs-skel-time  { height: 13px; width: 110px; }
.fs-skel-title { height: 16px; width: 80%; margin-bottom: 6px; }
.fs-skel-title--short { width: 50%; }
.fs-skel-meta  { height: 13px; width: 60%; margin-bottom: 0; }
