* { margin: 0px; padding: 0px; }
*:focus { outline: none; }

html, body {
	width: 100%;
	height: 100%;
}

body {
	font-family: Segoe, "Segoe UI", Arial;
	background-color: #262626;
	box-shadow: inset 0px 0px 100px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

#canvas_wrapper {
	width: 100%;
	height: 100%;
}

a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }

.buttons a {
	color: #FFF;
	font-size: 11px;
	text-shadow: 0px -1px #333;
	text-decoration: none;
	
	box-shadow: inset 0px 1px #777;
	background-color: #555;
	border: 2px solid #222;

	padding: 3px 6px;
	border-radius: 5px;
}

.buttons a:hover {
	background-color: #2881ab;
	box-shadow: inset 0px 1px #83d8ff;
	text-decoration: none;
}

.remove:hover {
	background-color: #900 !important;
	box-shadow: inset 0px 1px #C00 !important;
}

a span { padding-right: 2px; }

/* ============================ */
/* ====== LOADING SCREEN ====== */
/* ============================ */

#loading_screen {
	width: 100%;
	height: 100%;

	position: absolute;
	top: 0px; left: 0px;
	z-index: 9999;
	background-color: #EEE;
	display: table;
}

#loading_screen > div {
	display: table-cell;
	vertical-align: middle;
	position: relative;
	color: #FFF;
	font-weight: bold;
}

#loading_screen > div h1 {
	font-weight: normal;
	padding-top: 10px;
}

#loading_screen > div > div {
	width: 500px;
	margin: 0px auto;
	margin-top: -100px;
	padding: 20px;

	overflow: hidden;
	border-radius: 5px;

	border-bottom: 1px solid #FFF;
	background-color: #1d9fdb;
	box-shadow: inset 0px 0px 10px rgba(0,0,0,0.05);
}

#loading_screen h1 {
	font-size: 30px;
	margin-bottom: 10px;
}

#loading_screen span {
	color: #FFF;
	font-size: 100px;
	
	float: left;
	display: block;
	margin-left: 10px;
	margin-right: 35px;
}

/* ========================= */
/* ====== CONTEXTMENU ====== */
/* ========================= */

#contextmenu {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 99;

	border: 1px solid #000;
	list-style: none;
	border-radius: 3px;
}

#contextmenu li {
	padding: 2px 5px;

	color: #FFF;
	text-shadow: -1px 0px #333;
	font-size: 12px;

	background-color: #222;
	border-top: 1px solid #333;
	border-bottom: 1px solid #111;

	cursor: pointer;
}

#contextmenu li:hover {
	background-color: #2881ab;
	border-top: 1px solid #83d8ff;
}

#contextmenu li.remove:hover {
	border-top: 1px solid #C00;
	box-shadow: none;
}

#contextmenu > li:hover ul {
	position: absolute;
	left: 100%;
	margin-top: -19px;
}

#contextmenu li:first-child { border-radius: 2px 2px 0px 0px; }
#contextmenu li:last-child { border-radius: 0px 0px 2px 2px; border-bottom: 0px; }
#contextmenu > li > ul > li { display: none; }
#contextmenu > li:hover ul > li { display: block !important; }

/* ===================== */
/* ====== MENUBAR ====== */
/* ===================== */

#menubar {
	color: #999;
	font-size: 12px;
	text-shadow: 0px 1px #000;

	width: 100%;
	height: 25px;
	padding: 0px 10px;

	list-style: none;

	background-color: #222;
	border-bottom: 1px solid #000;
	box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);

	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 999;	
}

#menubar > li {
	height: 15px;
	padding: 7px 10px 3px 10px;
	float: left;
	padding-left: 10px;
	padding-right: 10px;
	border-left: 1px solid #111;
	border-right: 1px solid #333;
	cursor: pointer;
}

#menubar > li:hover,
#menubar > li.open {
	color: #CCC;
	background-color: #333;
}

#menubar > li span { padding-right: 5px; }
#menubar > li:first-child { border-left: none; }
#menubar > li:last-child { border-right: none; }
#menubar > li.open ul { display: block; }

#menubar li ul {
	position: absolute;
	top: 25px;
	display: none;
	list-style: none;
	margin-left: -11px;
}

#menubar li ul li {
	color: #999;
	font-size: 12px;
	padding: 5px 10px;
	background-color: #333;

	border: 1px solid #222;
	border-top: 1px solid #444;
}

#menubar li ul li:hover { color: #CCC; background-color: #444; }
#menubar li ul li:first-child { border-top: none; }
#menubar li ul li:last-child { border-radius: 0px 0px 3px 3px; }

/* ==================== */
/* ====== CANVAS ====== */
/* ==================== */

#canvas {
	position: absolute;
	z-index: 0;

	width: 800px;
	height: 608px;

	display: block;
	background-color: #FFF;
	overflow: hidden;
	box-shadow: 0px 0px 5px rgba(0,0,0,0.3);

	/* Not supported by chrome yet :( */
	image-rendering:-moz-crisp-edges;
	image-rendering: -o-crisp-edges;
	image-rendering:-webkit-optimize-contrast;
	-ms-interpolation-mode:nearest-neighbor;
	display: none;
}

#canvas.nogrid {
	background-image: none !important;
}

#canvas .selection {
	position: absolute;
	z-index: 99;
	opacity: 0.5;

	pointer-events: none;
}

.nobg {
	background-image: none !important;
}

#canvas .warning {
	position: absolute;
	top: 5%; left: 5%;
	z-index: 99;

	width: 90%;
	padding: 5px 10px;

	color: #FFC;
	font-size: 12px;
	background-color: #600;
	border: 2px solid #900;
	border-radius: 5px;
	opacity: 0.8;
	display: none;
}

#tiles .layer {
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: none !important;
}

#viewport {
	width: 736px;
	height: 544px;

	position: absolute;
	top: 32px;
	left: 32px;
	z-index: 2;

	background-color: transparent;
	box-shadow: inset 4px 4px 0px #06C, inset -4px -4px 0px #06C, 0px 0px 0px 2000px rgba(0,0,0,0.5);

	border: 1px solid rgba(0, 0, 0, 0.4);
	border-width: 0px;
}

/* ===================== */
/* ====== TOOLBAR ====== */
/* ===================== */

#toolbar {
	color: #CCC;
	font-size: 12px;
	text-shadow: 1px 1px 0px #000;

	width: 300px;
	height: 100%;

	padding: 10px;

	background-color: #464646;
	border-right: 3px double #282828;
	box-shadow: 0px 0px 100px rgba(0, 0, 0, 0.5);

	position: absolute;
	top: 26px;
	left: 0px;
	z-index: 99;
}

#toolbar section {
	background-color: #333;
	border-radius: 5px;

	margin-bottom: 10px;
	padding: 5px;
}

#toolbar .buttons { margin-top: 20px; }

#toolbar section > h2, .ui-dialog-titlebar {
	color: #FFF;
	font-family: "Source Sans Pro";
	text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
	font-size: 18px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: 0px;
	background-color: #1d9fdb;
	border-top: 1px solid #83d8ff;
	border-radius: 3px 3px 0px 0px;
	padding: 8px 10px;
}

#toolbar section > h2.collapsed {
	border-radius: 3px;
}

#toolbar section > div {
	position: relative;
	background-color: #333;
	border: 1px solid #222;
	border-top: 0px;

	box-shadow: inset 0px 0px 10px #222;
	padding: 12px 10px;
	border-radius: 0px 0px 3px 3px;

	overflow: hidden;
}

#tools {
	position: absolute;
	top: 0px; right: -38px;
	width: 29px;

	color: #999;
	font-size: 12px;
	text-align: center;
	text-shadow: 0px -1px #111;

	background-color: #464646;
	border-right: 1px solid #000;
	border-bottom: 1px solid #000;
	border-bottom-right-radius: 3px;
	padding: 4px 0px 0px 5px;
}

#tools span {
	display: block;
	width: 16px;
	height: 16px;

	margin-bottom: 5px;
	padding: 4px 2px 0px 3px;
	border: 1px solid #464646;
	border-radius: 3px;
	cursor: pointer;
}

#tools span:hover {
	color: #EEE;
	background-color: #555;
	border: 1px solid #404040;
	box-shadow: inset 0px 1px #666;
}

#tools span.active {
	color: #FFF;
	background-color: #555;
	border: 1px solid #333;
	box-shadow: inset 0px 1px #666;
}


#toolbar hr {
	height: 0px;
	border: 0px;
	border-top: 1px solid #333;
	border-bottom: 1px solid #666;
	margin: 20px 0px;
}

#note {
	color: #999;
	line-height: 16px;
	text-shadow: 0px -1px #000;

	padding: 10px;
	border-radius: 5px;
	background-color: #333;
}

/* ====================== */
/* ====== TILESETS ====== */
/* ====================== */

#tileset_container {
	position: relative;
}

#tilesets .selection {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.3);
	background-image: none !important;
	pointer-events: none;
}

.selection {
	box-shadow: inset 0px 0px 0px 1px #000;
}

#custom_select {
	width: 100%;
	height: 30px;
	overflow: hidden;

	text-shadow: 0px -1px #333;
	text-decoration: none;
	border-radius: 3px 3px 0px 0px;
	
	box-shadow: inset 0px 1px #777;
	background-color: #555;
	
	background-image: url("../img/icons/select_arrow.png");
	background-position: right;
	background-repeat: no-repeat;

}

#custom_select:hover { background-image: url("../img/icons/select_arrow_hover.png"); }

#tileset {
	background-color: #FFF;
	background-image: url("../img/icons/transparent.png");
	border: 5px solid #555;
	border-top: 0px;
	border-radius: 0px 0px 3px 3px;
}

#tilesets select[name=tileset_select] {
	width: 110%;
	padding: 5px 0px 0px 5px;
	color: #CCC;
	font-size: 14px;
	font-weight: bold;
	line-height: 16px;
	text-shadow: 0px -1px #322;
	border: 0px;
	background: transparent;
	-webkit-appearance: none;
}

#tilesets select[name=tileset_select] option {
	color: #000;
	text-shadow: none;
	background-color: #FFF;
}

#tileset { height: 250px; }
#tilesets select[name=tileset_select] option { color: #333; }

.loading {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 99;

	width: 100%;
	height: 100%;
	text-align: center;
	background-color: rgba(0, 0, 0, 0.5);
	border-radius: 5px;
}

.loading > img { padding-top: 100px; }

/* ==================== */
/* ====== LAYERS ====== */
/* ==================== */

ul#layerlist {
	border: 1px solid #282828;
	list-style: none;
}

ul#layerlist > li {
	height: 10px;

	color: #FFF;
	text-shadow: -1px -1px rgba(0, 0, 0, 0.5);
	font-size: 12px;
	line-height: 10px;

	padding: 5px 10px 10px 10px;
	background-color: #666;

	border-top: 1px solid #999;
	border-bottom: 1px solid #333;

	cursor: pointer;
}

#layerlist li span {
	color: #222;
	font-size: 14px;
	text-shadow: 0px 1px rgba(255, 255, 255, 0.5);
}

#layerlist li span:first-child { padding-right: 5px; }
#layerlist li span:last-child { float: right; }

ul#layerlist > li:last-child { border-bottom: 0px; }
ul#layerlist > li.active {
	background-color: #2881ab;
	border-top: 1px solid #83d8ff;
}

/* ======================= */
/* ====== JQUERY UI ====== */
/* ======================= */

.ui-dialog {
	width: auto !important;
}

.ui-dialog-titlebar-close {
	float: right;
	background-color: transparent;
	border: 0px;
}

.ui-button-text .icon-remove-sign {
	color: #111;
	font-size: 18px;
	margin-right: 10px;
	text-shadow: 0px 1px rgba(255, 255, 255, 0.5);
}

.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
	padding: 0em !important;
	text-indent: 0px !important;
}

.ui-widget-overlay {
	position: absolute;
	top: 0px;
	left: 0px;
	background-color: rgba(0, 0, 0, 0.5);
}

/* ================== */
/* ====== MISC ====== */
/* ================== */

#dialog {
	background-color: #EEE;
	padding: 20px;
	display: none;
	overflow: hidden;
}

#dialog hr {
	height: 0px;
	border: 0px;
	border-top: 1px solid #CCC;
	border-bottom: 1px solid #FFF;
	margin: 20px 0px;
}

#dialog table td {
	font-size: 12px;
	padding-right: 10px;
	padding-bottom: 10px;

	white-space: nowrap;
}

#dialog table tr:last-child td { padding-bottom: 0px; }

#dialog input[type=text], #dialog input[type=number], #dialog input[type=file]{
	width: 90px !important;
	height: 20px;
	padding: 2px 5px;
	overflow: hidden;
	border: 1px solid #999;
}

#dialog input[type=button] {
	height: 25px;
	padding: 2px 5px;
}

.stretch { width: 100%; }

#dialog #file_container { position: relative; }

#dialog input[name=file] {
	position: relative;
	height: 20px;
	opacity: 0;
	z-index: 9999;
}

#dialog input[name=file_overlay] {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 0;
}

.hint {
	cursor: help;
	border-bottom: 1px dotted #000;
}

.border-box {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-ms-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
}