/* --- CSS FOR PROJECTS AND ARTICLES --- */

/* --- FOLDABLE SECTIONS --- */
.accordion-section {
	width: 95%;
	max-width: 1500px;
	margin: 0 0;
	padding: 2rem 0.3rem;
}

.accordion-title {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	position: relative;
	cursor: pointer;
	margin: 2rem 0 2rem;
	padding-bottom: 0.3rem;
	font-size: 1.3rem;
	border-bottom: 2px solid var(--accent2);
	width: 100%;
	transition: color 0.2s;
}

.accordion-title:hover {
	color: var(--accent1);
}

.accordion-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s ease, opacity 0.3s ease;
	opacity: 0;
	padding-left: 0.5rem;
	color: var(--fg);
}

.accordion.open .accordion-content {
	max-height: 999999px;
	opacity: 1;
	margin-top: 1.2rem;
}

.accordion-title {
	position: relative;
	padding-right: 1.5rem; /* zostaw miejsce na strzałkę */
}

.accordion-title.arrow-added::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid var(--accent2); /* strzałka w dół */
	transform: translateY(-50%) rotate(0deg);
	transition: transform 0.3s ease;
}

.accordion.open .accordion-title.arrow-added::before {
	transform: translateY(-50%) rotate(-180deg); /* obrót w górę przy rozwinięciu */
}

/* --- BUTTONS --- */
.project-buttons {
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1.5rem 0;
	user-select: none;
}

.project-buttons .back-btn,
.project-buttons .git-btn {
	width: 20%;
	box-sizing: border-box;

	display: inline-block;
	text-align: center;

	background-color: #0ff;
	color: #000;
	border: 1px solid transparent;
	padding: 0.6rem 1.2rem;
	font-size: 1rem;
	font-family: 'IBM Plex Mono', monospace;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
}

.project-buttons .back-btn:hover,
.project-buttons .git-btn:hover {
	background-color: #f0f;
	border-color: #transparent;
	color: #000;
	box-shadow: 0 0 5px #f0f;
}

/* --- LISTS --- */
ul, ol {
	padding-left: 1rem;
	margin-top: 1rem;
	margin-bottom: 1rem;
	margin: 1.5rem 1rem;
/*	max-width: 750px;*/
}

li {
	margin-bottom: 0.4rem;
	line-height: 1.6;
}

/* --- TABLES --- */
table {
	border-collapse: collapse;
	width: 95%;
	max-width: 750px;
	margin: 1.5rem 0rem;
	background-color: #2a2a2a;
	border: 1px solid #444;
	border-radius: 5px;
	box-shadow: 0 0 5px #0008;
}

th, td {
	border: 1px solid #444;
	padding: 0.4rem;
	text-align: left;
}

th {
	background-color: #1e1e1e;
	color: var(--accent3);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

tr:nth-child(even) td {
	background-color: #262626;
}

tr:hover td {
	background-color: #333;
	/* font-weight: bold; */
}

td:hover {
	color: #0f0;
}

/* --- CODES --- */
.code-wrapper {
	position: relative;
	width: 90%;
	max-width: 750px;
	margin: 1.5rem 0rem;
}

.code-box {
	width: 100%;
	resize: none;
	overflow: auto;
	background-color: #111111;
	color: #dcdcdc;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.8rem;
	border: 1px solid #444;
	border-radius: 5px;
	padding-left: 10px;
	padding-top: 20px;
	padding-bottom: 20px;
	padding-right: 20px;
	box-sizing: border-box;
	white-space: pre;
}

.code-box:active {
	border: 1px solid #0f0;
}
.code-box:hover {
	border: 1px solid #4a4;
}

.code-box:focus,
.code-box:active {
	outline: none;
}

.copy-button {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	z-index: 99999;
	position: absolute;
	top: 7px;
	right: 15px;
	width: 30px;
	height: 30px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	background-color: #454545;
	border: none;
	border-radius: 3px;
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

.copy-button:hover {
	opacity: 1;
}

.copy-icon {
	width: 15px;
	height: 15px;
	display: block;
}

.inline-code {
	font-style: italic;
	color: #d2d2d2;
	background: #2d2d2d;
	border-radius: 5px 5px 5px 5px;
	border: 1px #444444 solid;
	padding: 0rem 0.4rem;
	font-size: 0.85rem;
	white-space: nowrap;
}

.inline-code.wrapable {
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
}

/* --- IMAGES --- */

.image-wrapper {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	width: 95%;
	max-width: 750px;
	margin: 1.5rem 0rem;
}

.image-wrapper img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 5px;
	box-shadow: 0 0 5px #0008;
}

/* --- VIDEOS --- */
.video-wrapper {
	user-select: none;
	width: 95%;
	max-width: 750px;
	max-height: 750px;
	border-radius: 5px;
	margin: 1.5rem 0rem;
	position: relative;
	background-color: #000;
	overflow: hidden;
}

.video-wrapper video {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 5px;
	box-shadow: 0 0 5px #0008;
	background: #000;
}

.video-thumbnail {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
	background-color: #000;
}

.video-controls {
	position: absolute;
	bottom: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(0, 0, 0, 0.4);
	padding: 5px 10px;
	border-radius: 5px;
	height: 40px;
	opacity: 1;
	transition: opacity 0.3s ease;
	pointer-events: auto;
}

.video-wrapper.hide-controls .video-controls {
	opacity: 0;
	pointer-events: none;
}

/* PLAY/PAUSE BUTTON */
.play-pause {
	width: 32px;
	height: 32px;
	position: relative;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.icon-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 12px solid #0f0;
	opacity: 1;
	transition: all 0.3s ease;
}

.icon-pause {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 14px;
	height: 16px;
	opacity: 0;
	transition: all 0.3s ease;
}

.icon-pause::before,
.icon-pause::after {
	content: "";
	position: absolute;
	top: 0;
	width: 4px;
	height: 100%;
	background: #ff0;
	transition: all 0.3s ease;
}

.icon-pause::before {
	left: 0;
}

.icon-pause::after {
	right: 0;
}

.play-pause.playing .icon-play {
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.6);
}

.play-pause.playing .icon-pause {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.play-pause.paused .icon-play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.play-pause.paused .icon-pause {
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.6);
}

/* PROGRESS BAR */
.progress-bar {
	height: 8px;
	background: #555;
	border-radius: 5px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	flex-grow: 1;
	flex-shrink: 1;
	flex-basis: 0;
}

.progress-filled {
	height: 100%;
	width: 0%;
	background: #0ff;
	border-radius: 5px;
	transition: width 0.2s linear;
}

/* VOLUME BAR */
.volume-bar {
	width: 100px;
	height: 8px;
	background: #555;
	border-radius: 5px;
	overflow: hidden;
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
}

.volume-filled {
	height: 100%;
	width: 60%;
	background: #ff0;
	border-radius: 5px;
	transition: width 0.2s linear;
}

/* FULLSCREEN */
.fullscreen-toggle {
	width: 20px;
	height: 20px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	margin-left: 12px;
}

.toggle-fullscreen-svg {
	display: block;
	width: 100%;
	height: 100%;
}

.toggle-fullscreen-svg path {
	stroke: #0f0;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.fullscreen-toggle.active .toggle-fullscreen-svg path {
	stroke: #ff0;
}

.icon-fullscreen-enter path {
	opacity: 1;
	transform: scale(1);
}

.icon-fullscreen-leave path {
	opacity: 0;
	transform: scale(0.7);
}

.fullscreen-toggle.active .icon-fullscreen-enter path {
	opacity: 0;
	transform: scale(0.7);
}

.fullscreen-toggle.active .icon-fullscreen-leave path {
	opacity: 1;
	transform: scale(1);
}

/* HOVERS */
.play-pause:hover {
	transform: scale(1.2) rotate(360deg);
	transition: transform 0.4s ease;
}

.play-pause:hover .icon-play {
	border-left-color: #f00;
	transition: border-color 0.3s ease;
}

.play-pause:hover .icon-pause::before,
.play-pause:hover .icon-pause::after {
	background: #f00;
	transition: background 0.3s ease;
}

.fullscreen-toggle:hover {
	transform: scale(1.2) rotate(360deg);
	transition: transform 0.4s ease;
}

.fullscreen-toggle:hover .toggle-fullscreen-svg path {
	stroke: #f00;
	transition: stroke 0.3s ease;
}

.play-pause:active {
	transform: scale(1.5) rotate(360deg);
	transition: transform 0.1s ease;
}

.play-pause:active .icon-play {
	border-left-color: #f0f;
	transition: border-color 0.1s ease;
}

.play-pause:active .icon-pause::before,
.play-pause:active .icon-pause::after {
	background: #f0f;
	transition: background 0.1s ease;
}

.fullscreen-toggle:active {
	transform: scale(1.5) rotate(360deg);
	transition: transform 0.1s ease;
}

.fullscreen-toggle:active .toggle-fullscreen-svg path {
	stroke: #f0f;
	transition: stroke 0.1s ease;
}q

.progress-bar:hover .progress-filled {
	background: #f0f;
	transition: background 0.3s ease;
}

.volume-bar:hover .volume-filled {
	background: #f0f;
	transition: background 0.3s ease;
}

/* --- ASCIINEMA PLAYER --- */
.asciinema-wrapper {
	/* user-select: none; */
    width: 100%;
    max-width: 650px;
    margin: 1.5rem 0rem;
    border: 1px solid #333;
    border-radius: 5px;
    overflow: hidden;
}

/* --- MEDIA --- */
@media (max-width: 767px) {
	.volume-bar {
		display: none;
	}
}
@media (min-width: 100px) and (max-width: 450px) {
	.project-buttons .back-btn,
	.project-buttons .git-btn {
		width: 100%;
	}
	.accordion-title {
		font-size: 1.3rem;
	}
	.accordion-content {
		font-size: 0.9rem;
	}
	table {
		width: 95%;
		font-size: 0.7rem;
	}

}
