/*
 * General style overrides of Bootstrap.
 */
body {
  margin: 0;
}

dd {
  /* Yes, this is a bit ragged, but IMO it's easier to understand this way. */
  margin-left: 10px;
}

/*
 * Styles for the top menubar.
 */

#querkiBar { margin: 0 0 0 0; }

/*
 * Disable the hardcoded sizing in Bootstrap's navbar container. This is having the result that
 * we are kicking into two lines of navbar when the size is between 750 and 992 px, pretty
 * arbitrarily. By disabling this, we don't *entirely* prevent that effect, but we make it
 * only happens when we completely run out of room.
 */
@media (min-width:768px) {
  .navbar .container {
    width: auto;
  }
}

/*
 * Workaround for what seems to be a bug in Bootstrap's theming: this is the text color for the
 * links in the collapsed menus. Bootstrap produces this as grayDark, and I can't figure out how
 * to make it right. 
 */
.nav-collapse .nav > li > a, 
.nav-collapse .dropdown-menu a {
  color: #ffffff;
}
.nav-collapse .dropdown-menu > .disabled > a {
  color: #999999;
}

.navbar-brand {
  padding-top: 5px;
  padding-bottom: 5px;
}

.guts {
  margin: 8px;
}

._menuSection {
  color: white;
}

/*
 * Miscellaneous style tweaks.
 */
 
.btn-primary {
  background-color: #37A807;
}
.btn-primary.active {
  background-color: #0B5703;
}

.querki-icon-button {
  margin-left: 5px;
}

/*
 * Our standard "paragraph" style. We use divs of this instead of <p>, to work around
 * idiosyncracies of nesting forms inside of <p>. These choices are taken from inspection
 * of how Chrome handles <p>, but aren't sacred.
 */

.para {
    margin-top: 0px;
    margin-bottom: 10px;
}

.well .para:last-child {
  margin-bottom: 0px;
}

/*
 * Tweak for Manifest -- make the width of the Manifest itself always fill the box you give
 * it. Then we can use {{}} operators to control that box.
 */
.para .mf_container {
  width: 100%;
}

._instanceEditor .mf_container {
  width: 100%;
}

/*
 * Ape the highlighting we used to get from Bootstrap, which I rather liked.
 */
.mf_input {
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
 
.mf_input:focus {
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(82, 168, 236, .6);
}

.mp_list {
  list-style-type: none;
  padding-left: 0;
}

/*
 * Menu tweaks for Querki. The existing menubar doesn't work quite right in our theme, so
 * I have a few modifications to make it look correct.
 *
 * By default, we want the menu items to show with the "soft" background. If we don't
 * give a background, they show with the default content -- which makes the white text
 * almost invisible. When focused, we switch to the hard background instead.
 */
 
.ui-menu-item {
	background: #4eb305 url(images/ui-bg_highlight-soft_50_4eb305_1x100.png) 50% 50% repeat-x;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
}

.ui-menu-item .ui-state-focus{
	background: #285c00 url(images/ui-bg_highlight-hard_30_285c00_1x100.png) 50% 50% repeat-x;
}

/*
 * Bullet lists are tightly packed, and paragraphs shouldn't mess that up.
 */

._bullet > .para:last-of-type {
  margin-bottom: 0px;
}

/*
 * Buttonset hack.
 *
 * There are well-known horrible conflicts between jQuery UI and Bootstrap. One of them causes
 * a buttonset in a span (which is how we prefer to show optional YesNo buttons) to break, showing
 * one button per line.
 *
 * I haven't yet nailed down the root cause, but the fact that .ui-helper-hidden-accessible is set
 * to position: absolute has something to do with it. So we do this instead. It's a tad dangerous,
 * and may break accessibility for these buttons, but for now we'll cope. Note that we're being
 * deliberately minimalist here, and only making this change inside our buttonsets.
 *
 * TODO: revisit this, and figure out how to make the display not suck while being accessible.
 */
.buttonset .ui-helper-hidden-accessible {
  display: none;
}

/*
 * jQuery, by default, generates preposterously large icon buttons, despite the fact that the
 * icons themselves are only 16 x 16. So we'll simply slam our icon buttons to the size we want.
 */
._iconButton {
   width: 16px !important;
   height: 16px !important;
   padding: 0px !important;
}

/*
 * Getting Lists of Text to a decent width. Bit of a hack -- could use more thought.
 */
.sortableList {
  width: 100%;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.sortableList > li {
  width: auto;
  margin: 0 3px 7px 3px;
  padding-left: 21px;
}

.sortableList > li input[type="text"] {
  width: 80%;
}

.sortableList > li .glyphicon-move { 
  margin-left: -1.3em;
  margin-right: 3px;
}


/*
 * Styles for the default Instance Editor view.
 */

._instanceEditor {
  background-color: #f3f3f3;
  width: auto;
  padding: 8px;
  margin-bottom: 10px;
  position: relative;
}

._instanceEditor ._propTitle {
  margin-top: 0px;
  margin-bottom: 0px;
  font-size: x-small;
}

._instanceEditor .para {
  margin-bottom: 0px;
}

._instanceEditor textarea {
  width: 100%;
  box-sizing: border-box;
}

._instanceEditor text {
  width: 100%;
  box-sizing: border-box;
}

._instanceEditor input {
  width: 100%;
  height: 26px;
  box-sizing: border-box;
  padding-left: 3px;
}

._instanceEditor ._deleteInstanceButton {
  position: absolute;
  right: 10px;
  line-height: 14px;
  background-color: lightpink;
  width: 18px;
  height: 20px;
  padding: 0px;
  text-align: center;
  border: 1px solid;
  cursor: pointer;
  z-index:100;
}

._instanceEditor ._deleteInstanceButton {
  display: none;
}

._instanceEditor:hover ._deleteInstanceButton {
  display: inherit;
}

._instanceEditor ._deleteInstanceButton .btn-xs {
  padding: 0px;
  top: 0;
}

._instanceEditor ._advancedEditButton {
  position: absolute;
  right: 35px;
  line-height: 14px;
  background-color: lightgreen;
  width: 18px;
  height: 20px;
  text-align: center;
  border: 1px solid;
  cursor: pointer;
  padding: 0px;
  z-index: 1000;
}

._instanceEditor ._advancedEditButton {
  display: none;
}

._instanceEditor:hover ._advancedEditButton {
  display: inherit;
}

._instanceEditor ._advancedEditButton .btn-xs {
  padding: 0px;
  top: 0;
}

/*
 * Styles for the Advanced Editor / Model Designer page.
 */
 
._advancedEditor ._propertySection {
  margin: 0;
  padding: 0;
}

._advancedEditor ._propPrompt {
  font-weight: bold;
  text-align: right;
  padding-right: 0;
  padding-top: 3px;
}

._advancedEditor ._propListItem {
  list-style-type: none;
  margin-bottom: 20px;
}

/*
 * We hardcode the height of the Type Description, so the Create Property box's size
 * doesn't jump up and down when you change Types.
 */
._advancedEditor ._typeDescription {
  height: 200px;
  overflow: auto;
}

._propValueGuts {
  width: 100%;
}

/*
 * Styles used in major Querki screens.
 */
 
.indent {
  margin-left: 30px;
}

._thingTree .para {
  margin-top: 0px;
  margin-bottom: 0px;
}

._modelInTree {
  font-weight: bold;
  font-size: larger;
  line-height: 24px;
  vertical-align: middle;
}

._unknownName a {
  color: #bf5615;
}

._defaultTitle {
  margin-top: 0px;
  margin-bottom: 0px;
}

._smallSubtitle {
  margin-top: 0px;
  font-size: x-small;
}

._spaceLink {
  margin-top: 10px;
  margin-bottom: 0px;
}

.page-header {
  margin-top: 0px;
}

._mainFooter {
  margin-top: 0px;
  width: 100%;
  font-size: x-small;
  text-align: center;
}

._warning {
  font-weight: bold;
  background-color: #FAD2DF;
}

._rating {
  /* Ratings are div's, but we often want them inline: */
  display: inline;
}

._ratingTargetWrapper {
  display: inline;
  padding-left: 8px;
}

._ratingTarget {
  display: inline;
  height: 15px;
}

._ratingAvg {
  font-size: xx-small;
}

/********************************
 * Default Histogram styles
 */
 
.generatedHistogram {
  font-size: xx-small;
  border-spacing: 0px;
  line-height: 14px;
}

.histoName {
  text-align: right;
  padding: 0px 7px 0px 0px;
}

.histoScore {
  text-align: center;
  padding: 0px 2px 0px 0px;
}

.histoBar {
  height: 14px;
  padding: 0px;
}

.histoBar-0 { background-color:#06C906; }
.histoBar-1 { background-color:#A309DB; }
.histoBar-2 { background-color:#0959DB; }
.histoBar-3 { background-color:#DBA309; }
.histoBar-4 { background-color:#DB3909; }

/*******************************
 * Photo styles
 */

#photo-full-header {
  padding: 2px 15px;
}
 
#photo-full-header .close {
  margin-top: 0px;
}
 
#photo-full-header p {
  margin-bottom: 0px;
} 
 
._photoThumbnailFrame {
  display: inline-block;
  width: 110px;
  height: 108px;
  padding: 2px;
  border-style: solid;
  border-color: #37A807;
  border-width: 1px;
  border-radius: 4px;
  margin: 2px;
  text-align: center;
  vertical-align: middle;
}

/**
 * This "helper" forces the vertical alignment within a thumbnail frame. For an explanation, see:
 * http://stackoverflow.com/questions/7273338/how-to-vertically-align-an-image-inside-div
 */
._photoThumbnailHelper {
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

._photoThumbnail {
  vertical-align: middle;
}

._photoAddButton {
  color: #37A807;
  background-color: #dddddd;
  cursor: pointer;
}

._addPhotoIcon {
  vertical-align: middle;
}

._photoInputElem {
  position: absolute;
  clip: rect(0px 0px 0px 0px);
}

/** Fix the color of anchors used as captions */
.carousel-caption a {
  color: inherit;
}

/*******************************
 * Status styles
 */
 
#statusLine {
  width: 100px;
  position: fixed;
  right: 10px;
  top: 50px;
  z-index: 100;
  color: green;
  text-align: right;
}
 
#statusText {
  display: none;
}

@media (max-width: 480px) {
  #statusLine {
    top: 55px;
  }
}

/*******************************
 * Search styles
 */

.searchResultHighlight {
  font-weight: bold;
  background-color: #FAD2DF;
}

._searchPropName {
  margin-bottom: 0px;
}

/*******************************
 * Explorer styles
 */

#_exploreQueryRow {
  height: 100px;
}
  
#_exploreThingName {
  width: 100%;
}
  
._exploreSurround {
  position: relative;
  top: 40px;
  color: #999999;
}
  
#_exploreQlInputDiv {
  height: 100%;
}
  
#_exploreQlInput {
  height: 100%;
}

/******************************
 * Pick List styles
 */
 
 ._pickList ._listContent {
   list-style-type: none;
 }
 
 ._pickName {
   display: inline-block;
   min-height: 20px;
 }
 
._pickName ._deleteInstanceButton {
  margin-left: 4px;
  line-height: 14px;
  background-color: lightpink;
  width: 18px;
  height: 18px;
  padding-top: 2px;
  text-align: center;
  border: 1px solid;
  cursor: pointer;
  z-index:100;
}

._pickName ._deleteInstanceButton {
  display: none;
}

._pickName:hover ._deleteInstanceButton {
  display: inherit;
}

._checklist ._listContent {
  list-style-type: none;
}

._checkOption {
  vertical-align: top;
}

/****************************
 * Error styles
 */
 
._validationError {
  display: inline-block;
  padding: 5px;
  background: #dddddd;
  border-radius: 4px;
}

._validationError p {
  color: red;
  font-size: x-small;
  margin-left: 10px;
  margin-bottom: 0px;
}

._validationError input {
  margin-bottom: 0px;
}

/****************************
 * Sharing page styles
 */
 
._chooseRole {
  cursor: pointer;
}

/****************************
 * Datepicker tweaks
 */
 
.datepicker table {
  background-color: #ffffff;
}

/****************************
 * The sections of the default Space Root view
 */
._root-well h3 {
  margin-top: 0;
}

._querkiDialog ._guts {
  margin: 10px;
}

/****************************
 * The Security Page
 */
._permrow {
  margin-bottom: 8px;
  padding-bottom: 8px;
  margin-left: 0;
  margin-right: 0;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  border-bottom-color: #dddddd;
}

._permname {
  text-align: right;
}

/***************************
 * The Login, SignUp and ValidateSignUp Pages
 */
._loginError {
  color: #ff0000;
  font-weight: bold;
}

._signupGood {
  color: #328a32;
}

._signupTosHeading {
  font-size: x-large;
}

._signupTosBody {
  height: 150px; 
  overflow-y: scroll;
}

._signupTosBody h1 {
  margin-top: 0px;
}

/***************************
 * The Edit Space Info page
 */
._editSpaceTitle {
  margin-top: 15px;
  margin-bottom: 3px;
}

._editSpaceSubtitle {
  margin-top: 0px;
  font-size: x-small;
}

._editSpaceShim {
  height: 10px;
}

/**************************
 * The Unsubscribe page
 */
._unsubItem {
  vertical-align: middle;
}


/**************************
 * The Console page
 *
 * The heights here are pretty questionable and arbitrary, but they're a starting point.
 *
 * TODO: get a serious CSS hacker to opine on how to do this right.
 */

._console {
}

._consoleOutput {
  height: 50vh;
  border: 1px solid;
  font: monospace;
  font-size: 16px;
  font-family: Courier New;
  background-color: black;
  color: white;
  border-radius: 10px;
  overflow: auto;
}

._consoleInput {
  margin-top: 5px;
  height: 15vh;
  border: 1px solid;
  font: monospace;
  font-size: 16px;
  font-family: Courier New;
  background-color: black;
  color: white;
  border-radius: 10px;
}

._consoleInput:focus {
  outline: none;
}

._consoleOutCmd {
  color: #dddddd;
}

._consoleOutErr {
  color: #ffaaaa;
}

._consoleOutMsg {
  color: #ffffff;
}
