/* Theme toggle button */
.theme-toggle {
	position: relative;
	cursor: pointer;
	border: none;
	background: transparent;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.3s ease;
}

/* Global Transition Class for smooth theme switching */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
	transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
				color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
				border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
				box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
				fill 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
	transition-delay: 0 !important;
}

.theme_toggle_icon {
	display: inline-block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #ffaa00; /* Vibrant golden sun */
	box-shadow: 0 0 16px rgba(255, 170, 0, 0.6), inset -2px -2px 6px rgba(0,0,0,0.1);
	transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
	position: relative;
	overflow: hidden; /* Important for crescent moon cutout */
}

/* The moon creator (sweeps in from the side) */
.theme_toggle_icon::after {
	content: "";
	position: absolute;
	top: -10px;
	right: -10px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #161b22; /* Matches dark sidebar background exactly */
	transform: scale(0);
	transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle:hover .theme_toggle_icon {
	transform: scale(1.15) rotate(15deg);
	box-shadow: 0 0 24px rgba(255, 170, 0, 0.9), inset -2px -2px 6px rgba(0,0,0,0.1);
}

.theme-toggle:focus-visible {
	outline: none;
}

.theme-toggle.is-dark .theme_toggle_icon {
	background: #ff2a4b; /* Crimson moon */
	box-shadow: 0 0 16px rgba(255, 42, 75, 0.5);
	transform: rotate(-100deg);
}

.theme-toggle.is-dark:hover .theme_toggle_icon {
	transform: scale(1.15) rotate(-115deg);
	box-shadow: 0 0 24px rgba(255, 42, 75, 0.8);
}

.theme-toggle.is-dark .theme_toggle_icon::after {
	transform: scale(1);
	top: -4px;
	right: -4px;
}

/* Dark theme overrides */
html.dark-theme,
body.dark-theme {
	background-color: #0d1117;
}

body.dark-theme,
body.dark-theme select,
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme button {
	color: #e6edf3;
}

body.dark-theme .wrp {
	background: transparent;
}

body.dark-theme .body {
	background-color: #161b22;
	box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

body.dark-theme #body_left:before {
	border-right: 1px solid rgba(255,255,255,0.08);
	background-image: none;
	background: linear-gradient(to left, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
}

/* Fix mobile top navbar */
body.dark-theme .body_left_in {
	background-color: #161b22;
	box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

body.dark-theme #menu,
body.dark-theme .greenmenu {
	box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

body.dark-theme a {
	color: #c5d1de; /* Soft frosty gray-white instead of pink/blue */
	transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.dark-theme a:hover {
	color: #ff2a4b; /* Vibrant brand crimson on hover */
	text-shadow: 0 0 10px rgba(255, 42, 75, 0.4);
}

body.dark-theme .menu a {
	color: rgba(255,255,255,0.75);
	text-shadow: none;
}

body.dark-theme .menu a:hover {
	color: #fff;
}

body.dark-theme .head_drop {
	background-color: #242a36;
	color: #f1f5ff;
	box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

body.dark-theme .head_drop a {
	color: inherit;
}

body.dark-theme #menubtn .menu_toggle > i,
body.dark-theme .icon_close > i {
	background-color: #f5f5f5;
}

body.dark-theme .icon {
	fill: #e6edf3;
}

body.dark-theme #upper {
	box-shadow: 0 -1px 0 rgba(255,255,255,0.05), inset 0 1px 0 rgba(0,0,0,0.5);
}

body.dark-theme #upper .icon {
	fill: #8ab4f8;
}

body.dark-theme #breadcrumbs {
	background: linear-gradient(135deg, #1c212b 0%, #151a22 100%);
	color: #e6edf3;
	border-bottom: 1px solid rgba(255,255,255,0.05);
	box-shadow: inset 0 -10px 20px rgba(0,0,0,0.2);
}

body.dark-theme #breadcrumbs .speedbar {
	color: rgba(255,255,255,0.5);
}

body.dark-theme #breadcrumbs .speedbar a {
	color: #c5d1de;
	transition: color 0.3s ease;
}

body.dark-theme #breadcrumbs .speedbar a:hover {
	color: #ff2a4b;
	text-shadow: 0 0 10px rgba(255, 42, 75, 0.4);
}

body.dark-theme .rightside_bg {
	background: #161b22;
}

body.dark-theme .rightside_bg:before {
	background: rgba(255,255,255,0.06);
}

body.dark-theme .rightside_bg:after {
	background-image: none;
	background: #161b22;
}

body.dark-theme .comments_box {
	background-color: #0f131b;
}

body.dark-theme .comments_box_in {
	background-color: #1f2430;
	box-shadow: 0 15px 45px rgba(0,0,0,0.6);
}

body.dark-theme .comments_box_in:after {
	border-bottom-color: #1f2430;
}

body.dark-theme .block_tabs {
	background-image: none;
	background-color: #11151c;
	box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}

body.dark-theme .block_tabs > li > a {
	color: #6a7382;
	transition: color 0.3s ease;
}

body.dark-theme .block_tabs > li > a:hover {
	color: #e6edf3;
}

body.dark-theme .block_tabs > li.active > a {
	color: #e6edf3;
	background-image: none;
	background: linear-gradient(to bottom, #2a3040, #1f2430);
	box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.dark-theme .block_sep,
body.dark-theme hr {
	background: rgba(255,255,255,0.08);
	border-top-color: rgba(255,255,255,0.1);
}

body.dark-theme fieldset {
	border-color: rgba(255,255,255,0.15);
}

body.dark-theme .poll_block,
body.dark-theme .vote_result_btn,
body.dark-theme .story_line .image,
body.dark-theme .bignews .item,
body.dark-theme .ca > span,
body.dark-theme .soc_links > a {
	background-color: #1f2430;
}

body.dark-theme .poll_block_in,
body.dark-theme .comments_box_in {
	background-color: #1f2430;
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.dark-theme .comments_box {
	background-color: #1a1f2b;
}

body.dark-theme .comments_box_in:after {
	border-bottom-color: #1f2430;
}

body.dark-theme .vote_result_btn > span > i {
	background: #e6edf3;
}

body.dark-theme .soc_links > a {
	color: inherit;
}

body.dark-theme .ca > span > .icon {
	fill: #161b22;
}

body.dark-theme .foot_menu > li nav > a {
	color: #9aa0b4;
}

body.dark-theme .foot_menu > li nav > a:hover {
	color: #e6edf3;
}

body.dark-theme .footer,
body.dark-theme .foot {
	color: inherit;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="password"],
body.dark-theme input[type="email"],
body.dark-theme input[type="search"],
body.dark-theme input[type="tel"],
body.dark-theme input[type="url"],
body.dark-theme input[type="number"],
body.dark-theme textarea,
body.dark-theme select {
	background-color: #1f2430;
	border-color: #343c4c;
	color: #e6edf3;
}

body.dark-theme ::placeholder {
	color: #98a1b5;
	opacity: 1;
}

body.dark-theme .story_line .image:after {
	background-color: #161b22;
}

/* Image dampening in dark mode to prevent eye strain */
body.dark-theme .story .text img,
body.dark-theme .bignews .item img,
body.dark-theme .carousel-inner img,
body.dark-theme .file-preview-card img,
body.dark-theme .mediaupload-box img {
	filter: brightness(0.75) contrast(1.15) saturate(0.9);
	transition: filter 0.4s ease;
}

/* Specifically darken the top carousel cover background */
body.dark-theme .carousel-inner .cover {
	filter: brightness(0.4) contrast(1.2) saturate(0.8) !important;
	transition: filter 0.4s ease;
}

/* Smoothly restore brightness on hover for better view */
body.dark-theme .story .text img:hover,
body.dark-theme .bignews .item img:hover,
body.dark-theme .carousel-inner img:hover,
body.dark-theme .carousel-inner:hover .cover {
	filter: brightness(1) contrast(1) saturate(1) !important;
}

body.dark-theme .tag_list > span > a {
	background-color: #1f2430;
	color: #e6edf3;
}

body.dark-theme .tag_list > span > a:hover {
	background-color: #db143d;
	color: #fff;
	box-shadow: none;
}

body.dark-theme .tox,
body.dark-theme .tox .tox-toolbar,
body.dark-theme .tox .tox-toolbar__primary,
body.dark-theme .tox .tox-toolbar__overflow,
body.dark-theme .tox .tox-toolbar--scrolling,
body.dark-theme .tox .tox-editor-header,
body.dark-theme .tox .tox-sidebar,
body.dark-theme .tox .tox-statusbar {
	background-color: #161b22;
	border-color: #2a3040;
	color: #e6edf3;
}

body.dark-theme .tox .tox-toolbar,
body.dark-theme .tox .tox-toolbar__primary,
body.dark-theme .tox .tox-toolbar__overflow {
	box-shadow: none;
	background-image: none;
}

body.dark-theme .tox .tox-tbtn {
	color: #e6edf3;
}

body.dark-theme .tox .tox-tbtn:hover,
body.dark-theme .tox .tox-tbtn:focus {
	background-color: #2a3040;
}

body.dark-theme .tox .tox-tbtn svg path,
body.dark-theme .tox .tox-tbtn svg rect,
body.dark-theme .tox .tox-tbtn svg circle,
body.dark-theme .tox .tox-tbtn svg polygon,
body.dark-theme .tox .tox-icon svg path,
body.dark-theme .tox .tox-icon svg rect,
body.dark-theme .tox .tox-icon svg circle,
body.dark-theme .tox .tox-icon svg polygon {
	fill: currentColor;
}

body.dark-theme .tox .tox-toolbar__group:not(:last-child) {
	border-color: #2a3040;
}

body.dark-theme .tox .tox-edit-area__iframe,
body.dark-theme .tox .tox-sidebar-wrap {
	background-color: #0f131b;
}

body.dark-theme .change_skin {
	background-color: #1f2430;
	box-shadow: none;
}

body.dark-theme .change_skin:hover .arrow:after,
body.dark-theme .change_skin:hover .arrow:before {
	background: #e6edf3;
}

body.dark-theme .comments-image-uploader-area,
body.dark-theme .comments-image-uploader,
body.dark-theme .plupload_container,
body.dark-theme .plupload_header,
body.dark-theme .plupload_filelist_header,
body.dark-theme .plupload_filelist_footer,
body.dark-theme .plupload_filelist_content,
body.dark-theme .plupload_dropbox,
body.dark-theme .plupload_progress_container,
body.dark-theme .plupload_buttons .plupload_button,
body.dark-theme .ui-widget-content,
body.dark-theme .ui-widget-header {
	background-color: #161b22;
	border-color: #2a3040;
	color: #e6edf3;
}

body.dark-theme .plupload_button,
body.dark-theme .plupload_button:hover,
body.dark-theme .plupload_button:focus {
	background-image: none;
	color: #e6edf3;
}

body.dark-theme .plupload_dropbox {
	border: 1px dashed #2f3646;
}

body.dark-theme .plupload_droptext,
body.dark-theme .plupload_total_status,
body.dark-theme .plupload_total_file_size {
	color: #9aa0b4;
}

body.dark-theme .story_tools_in:before {
	border-color: rgba(255,255,255,0.15);
}

body.dark-theme .rate_like > a,
body.dark-theme .rate_like-dislike > a,
body.dark-theme .meta > li,
body.dark-theme .signature,
body.dark-theme .pages > * {
	color: #9aa0b4;
}

body.dark-theme .pages span {
	border-color: rgba(255,255,255,0.2);
}

body.dark-theme .pages a:hover {
	border-color: #db143d;
	color: #db143d;
}

body.dark-theme .plus_icon > span:before,
body.dark-theme .plus_icon > span:after {
	background-color: #e6edf3;
}

body.dark-theme .vote_list .vote > input + label:before,
body.dark-theme .vote_list .pollanswer > input + label:before {
	border-color: #4b5364;
	background-color: transparent;
}

body.dark-theme .more_icon > i {
	background-color: #e6edf3;
}

body.dark-theme .share a .ya-share2__badge {
	background-color: #1f2430;
}

body.dark-theme .share a:hover .ya-share2__badge {
	background-color: #db143d;
}

body.dark-theme .h_btn {
	box-shadow: 0 1px 0 0 rgba(0,0,0,0.6), inset 0 -1px 0 0 rgba(255,255,255,0.04);
}

body.dark-theme .bignews .item {
	color: #f1f5ff;
}

body.dark-theme .poll_block {
	color: inherit;
}

body.dark-theme .vote_result_btn {
	box-shadow: none;
}

body.dark-theme .green {
	color: #ff85a2;
}

body.dark-theme .grey {
	color: #9aa0b4;
}

body.dark-theme .grey a {
	color: inherit;
}

body.dark-theme .grey a:hover {
	color: #e6edf3;
}

body.dark-theme .com_info {
	border-color: #343c4c;
	background: #1f2430;
}

body.dark-theme .com_tools_links > a {
	color: #9aa0b4;
}

body.dark-theme .com_tools_links > a:hover {
	color: #e6edf3;
}

body.dark-theme .alert {
	background-color: rgba(255, 170, 0, 0.1);
	border: 1px solid rgba(255, 170, 0, 0.2);
	color: #ffb833;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .file-preview-card,
body.dark-theme .mediaupload-box {
	background-color: #1f2430;
	color: inherit;
}

body.dark-theme figure.image figcaption {
	background-color: #1f2430;
}

body.dark-theme .dle-popup-mediaupload .mediaupload-insert-params {
	background-color: #161b22 !important;
	border-top-color: #161b22 !important;
}

body.dark-theme .less {
	box-shadow: rgba(0, 0, 0, 0.35) 0 10px 25px -5px, rgba(0, 0, 0, 0.45) 0 0 0 1px;
}
