/*
 * Copyright 2012 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
  Style sheet used on ui=light.

  Note that some feature phones don't support CSS anyway.
*/

/* All pages */

body {
  background: #f2f0f0;
  font-family: arial, sans-serif;
  font-size: 13px;
  margin: 0;
}

/* Do not apply the max width constraint for admin pages. */
body.admin {
  max-width: none;
}

img {
  max-width: 100%;
}

a img {
  border: none;
}

h1 {
  margin-top: 0.5em;
  font-size: 18px;
  font-weight: normal;
}

h2 {
  font-size: 15px;
  margin: 2em 0 1em;
}

h3 {
  font-size: 13px;
  font-weight: bold;
  margin: 0;
}

.header a {
  text-decoration: none;
}

.container {
  clear: both;
}

/* outer-container contains everything
    except for the header and the side bar */
.outer-container {
  max-width: 900px;
  padding: 5px;
  margin: auto;
}

.hidden {
  display: none;
}

.warning {
  color: red;
  font-weight: bold;
}

.header-notification {
  color: #f00;
  padding: 2em;
  margin: 2em auto;
  border: 1px solid #f00;
  background: #ffe;
  font-weight: bold;
  text-align: center;
}

.end-multi-columns {
  clear: both;
}

var {  /* variables in sample code or URLs */
  color: #c00;
}

pre {  /* code samples */
  background: #f4f4f4;
  border: 1px solid #dadada;
  margin: 0 2em;
  padding: 1em;
  overflow: auto;
  font-size: 12px;
}

.button input {
  border-style: none;
  color: white;
  display: block;
  font-size: 16px;
  padding: 5px 15px;
  border-radius: 2px;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  -webkit-appearance: none;  /* for ios button */
}

.button input:disabled {
  background: #9e9e9e;
}

.button-blue input {
  background: #4285f4;
}

.button-red input {
  background: #db4437;
}

.button-box {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
  margin-right: -10px;
}

.button-box .button {
  margin-left: 10px;
  margin-right: 10px;
}

/* A line for separating No searching results
  and search results without location */
.under-line {
  border-bottom: 2px solid #e6e6e6
}

/* Title bar */

.title-bar {
  font-size: 20px;
  color: white;
  background-color: #616161;
  height: 64px;
  line-height: 64px;  /* Vertically center the text */

  /* Shows ellipsis when the title doesn't fit in a single line. */
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.title-bar-button {
  height: 24px;
  width: 24px;
  float: left;
  padding: 20px;
}

.title-bar-button-container {
  height: 24px;
  width: 24px;
  display: inline;
  float: left;
  padding: 20px;
  line-height: 0px;
}

div.subtitle-bar {
  font-size: 20px;
  font-weight: normal;
  box-shadow: 0 2px 1px -1px #a0a0a0;
  background-color: #616161;
  padding: 20px;
  color: white;
}

/* Language menu */

div.languages {
  text-decoration: none;
  color: black;
  text-align: right;
  margin-top: 5px;
  margin-right: 5px;
}

div.languages img {
  vertical-align: middle;
}

div.languages select {
  background: white;
  vertical-align: middle;
}

/* Repository menu */

ul.repo-menu {
  margin: 0 0 1em 0;
  padding: 0;
  list-style-type: none;
}

/* Forms */

form {
  margin: 0;
}

input {
  box-sizing: border-box;
  font-family: arial, sans-serif;
  font-size: 13px;
  margin-bottom: 8px;
  max-width: 100%;
}

input:not([type]),  /* type attribute is not specified */
input[type="text"] {
  border: 0;
  border-radius: 0;
  outline: 0;
  border-bottom: 1px solid #a9a9a9;
  background: transparent;
}

input:not([type]):focus,  /* type attribute is not specified */
input[type="text"]:focus {
  border-bottom: 2px solid #3b78e7;
  margin-bottom: 7px;
}

/* Show disabled input states with dotted line */
input:not([type]):disabled,  /* type attribute is not specified */
input[type="text"]:disabled {
  border-bottom: 1px dotted #a9a9a9;
}

/* Remove the focus frame for file upload input */
input[type="file"]:focus {
  border: 0;
  border-radius: 0;
  outline: 0;
}

.input {
  margin-bottom: .5em;
}

.photo-upload-input {
  width: 200px;
}

textarea {
  box-sizing: border-box;
}

select {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  outline: 0;
  border-bottom: 1px solid #a9a9a9;
  background: transparent;
}

.mandatory {
  color: #f00;
}

.hint {
  color: #888;
  font-size: 11px;
  font-weight: normal;
  margin-bottom: .5em
}

.hint .warning {
  color: red;
  font-weight: normal;
}

/* Expand Forms */

.expanded-part {
  margin: 8px 13px 8px 13px;
}

a.expand-button {
  display: block;
  padding: 10px 10px 10px 0px;
  border-top: 2px solid #dadada;
  margin-top: 5px;
  margin-bottom: 0px;
  text-decoration: none;
  color: black;
  font-weight: bold;
}

/* Icon for the expand-button before the form is expanded */
.expand-button-icon-down {
  background: url(https://google.org/personfinder/static/expand-icon-down.png);
  background-repeat: no-repeat;
  background-position: right;
}

/* Icon for the expand-button after the form is expanded */
.expand-button-icon-up {
  background: url(https://google.org/personfinder/static/expand-icon-up.png);
  background-repeat: no-repeat;
  background-position: right;
}

/* Multi-column page */

.column {
  max-width: 380px;
  width: 100%;
}

.column:first-of-type {
  margin-right: 40px;
}

.column.start {
  float: left;
}

.column.end {
  float: left;
}

.column.centered {
  margin-left: auto;
  margin-right: auto;
}

.column h2 {
  margin: 2px 0 6px;
  padding-left: 6px;
}

/* Cards which show a label and a value of each field e.g. in /view page.

See app/resources/view.html.template for a usage example.

Constructed with <div> and <span>, not <table>, so that:
- it looks like a table on normal UI (with CSS rules below)
- it looks like a normal div/span layout on ui=light (where CSS is not
  applied) which fits small screens.

You need:
  <div class="end-multi-columns"></div>
after a sequence of <div class="field">. Otherwise the bottom margin is not
correctly inserted.

We don't use "display: table" because IE 6/7 doesn't support it. IE 6/7 is
over 10% in penetration ratio.
*/

.card {
  background: #ffffff;
  border: 1px solid #dadada;
  box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.26);
  padding: 5px;
  margin: 5px;
  border-radius: 3px;
}

.card h1 {
  font-size: 20px;
  padding: 0px 10px;
}

.card h2 {
  padding: 0px 10px 10px;
}

/* card section is used in view page */
.card .section {
  border-bottom: 2px solid #e6e6e6;
  padding: 10px 4px 4px;
}

.card .section h1 {
  font-size: 20px;
  margin-bottom: 0;
  text-align: center;
}

.card .section h2 {
  font-size: 16px;
  font-weight: normal;
  margin-top: 5px;
}

.card .links {
  border-style: none;
}

.card .links a {
  color: #4285f4;
  display: block;
  font-size: 16px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px 4px 4px;
  text-align: center;
}

.card textarea {
  width: 100%;
}

.card .field {
  clear: both;
  display: flex;
  margin-left: 0;
}

.card .label {
  display: block;  /* to make float/width attribute work */
  float: left;
  height: 100%;
  text-align: right;
  width: 45%;
  margin-right: 10px;
}

.card .value {
  display: block;  /* to make float/width attribute work */
  float: right;
  width: 50%;
}

.card .long-text-input {
  max-width: 280px;
  width: 100%;
}

.card .medium-text-input {
  max-width: 140px;
  width: 100%;
}

.card .short-text-input {
  width: 70px;
}

/* Tables.

Mostly replaced by fields-table above, but we still have some e.g. in /admin
page.
*/

tr {
  vertical-align: baseline;
}

th, td {
  padding: 0px 4px;
  text-align: left;
}

tr.columns {
  vertical-align: top;
}

table.fields {
  margin-left: 3em;
}

tr.text, tr.description, tr.location, tr.other {
  vertical-align: top;
}

td.label {
  text-align: right;
  width: 12em;
}

.tracking, .note .contents div.tracking {
  font-size: 9px;
  color: #888;
  text-align: right;
  padding-top: 10px;
}

td.submit {
  text-align: left;
}

/* Footer */

.disclaimer {
  margin: 1em 0 1em 0;
  text-align: left;
}

.footer {
  clear: both;
  padding: 0 2em;
  color: #666;
}

.footer .logo {
  margin: 1em 0;
}

/* Error message and info message pages */

.error {
  color: #f00;
  padding: 2em;
  margin: 2em;
  border: 1px solid #f00;
  background: #ffe;
}

.info {
  color: #000;
  padding: 2em;
  margin: 2em;
  border: 1px solid green;
}

.deactivation {
  margin: 2em 1em;
}

/* Main page */

.main {
  font-size: 16px;
  width: 100%;
}

.main .row {
  margin: 16px;
  text-align: center;
}

.main .stats {
  font-size: 13px;
  text-align: center;
}

.main .action-outer {
  border: none;
  font-size: 20px;
  margin-bottom: 1em;
  max-width: 240px;
  min-height: 70px;
  padding: 16px;
  border-radius: 3px;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}

.main .row a {
  color: white;
  text-decoration: none;
}

.main .action-outer {
  margin: 0 auto 10px;
}

.main .action-outer.start {
  background: #4285f4;
}

.main .action-outer.end {
  background: #15a04a;
}

.main .action-inner {
  width: 240px;
  height: 70px;
  /* "display: table-cell" to make vertical-align work.
     Vertical centering doesn't work on IE 6/7 because it doesn't support
     "display: table-cell". But it would be acceptable. */
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}

.custom-message {
  max-width: 500px;
  margin: 1em 0;
}

.main .row.custom-message {
  display: table;
  margin: 24px auto;
}

.social {
  /* A trick to align all social share buttons vertically.
     https://stackoverflow.com/a/21919504/4339963 */
  line-height: 10px;
}

/* We want to display the "I have info"/"I'm seeking info" buttons side-by-side
   on desktop, but stacked on top of each other on mobile, so we have an extra
   couple CSS rules for larger screens. */
@media (min-width: 700px) {
  .main .action-outer {
    display: inline-block;
    margin: 10px;
  }
}

/* Query page */

.query {
  background: #bcf;
  border: none;
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 380px;
  padding: 1em;
  width: 100%;
}

.query h1 {
  font-size: 20px;
  margin-bottom: 0px;
}

.query .header {
  border-bottom: 2px solid #e6e6e6;
}

.query.seek,
.query.provide {
  background: #fff;
  border: 2px solid #e6e6e6;
}

.query.seek .field {
  display: block;
  margin: 8px 20px;
}

.query.seek .label {
  width: 100%;
  text-align: left;
}

.seek.results.border .query.seek,
.seek.results.border .query.provide{
  border: 0;
  margin: 0;
  padding: 0;
  width: 100%;
}

.seek.results.border .query.seek .header{
  border: 0px;
}

.seek.results.border .query.seek input{
  margin-left: 0px;
}

.query .instructions {
  padding-bottom: 0.5em;
}

.query .help-text {
  padding-top: 10px;
}

.query .button {
  margin-top: 20px;
}

.query .button input {
  margin: 10px auto;
}

/* View page */

.view .person {
  background: #ffffff;
  border: 2px solid #e6e6e6;
}

.view .person .section {
  border-bottom: 2px solid #e6e6e6;
}

.view .person .section .centered-photo {
  display: inline-block;
  margin: 0 auto;
}

.view .person .section .links {
  border-style: none;
}

.view .person .label {
  font-weight: bold;
}

img.photo {
  max-width: 250px;
  max-height: 250px;
  border: none;
}

img.icon {
  vertical-align: middle;
}

.view input.add-note {
  width: 100%;
  margin-top: 10px;  /* To vertically align the "Add note" button
                        with the record card */
}

.note .button input {
  margin: 10px auto;
}

.view.note .source {
  background: #e6e6e6;
  padding-top: 10px;
  padding-left: 4px;
  text-align: right;
}

.view .note .report-spam a {
  color: red;
  }

.self-notes {
  margin-top: 30px;
}

.self-notes .view.note.duplicate {
  background: #fe8;
}

.note .author {
  font-weight: bold;
  color: #000;
}

.note .author.unknown {
  font-weight: normal;
  color: #888;
}

.view.note .contact {
  font-size: 11px;
  color: #888;
}

.note .contents {
  background: #ffffff;
  padding: 8px;
  margin-top: 4px;
}

.note .contents div, .map-container {
  font-size: 11px;
  color: #666;
}

div.map {
  margin-top: 0.5em;
}

.view .field .warning {
  color: red;
  font-weight: normal;
}

.note .contents div.translation {
  margin-top: 8px;
  font-style: italic;
  font-size: 13px;
  color: #66c;
}

/* Multiview page */

table.multiview {
  background-color: #e8e8e8;
}

.multiview table.column {
  background: #e8e8e8;
  padding: 4px 0 1px;
  border: none;
}

.multiview .label {
  white-space: nowrap;
}

.multiview .field {
  background-color: #f8f8f8;
  min-width: 5em;
  border-left: 2px solid #e8e8e9;
}

.multiview .sectiontop {
  padding: 0.5em;
  background: #f8f8f8;
}

tr.sectionbottom td {
  padding-bottom: 0.5em;
  border-bottom: 2px solid #e8e8e8;
}

/* Create page */

label.option {
  font-weight: bold;
}

.create .subsection {
  padding-bottom: 10px;
  padding-top: 10px;
}

.create h2 {
  font-size: 14px;
  margin-top: 5px;
}

.create .card .photo .radio {
  display: block;
  float: left;
  width: 30px;
}

.create .card .photo .label {
  display: block;
  float: left;
  text-align: right;
  width: 70px;
}

.create .card .photo .value {
  display: block;
  float: right;
  max-width: 220px;
  width: 100%;
}

.create .card .profile .icon {
  display: block;
  float: left;
  width: 30px;
  margin-left: 30px;
}

.create .card .profile .value {
  display: block;
  width: 220px;
}

.create .card .profile .remove {
  display: block;
  float: right;
  width: 70px;
}

.create .button input {
  margin: 10px auto;
  min-width: 50%;
}

/* reCAPTCHA */
.create .recaptcha {
  margin: 0 auto;
  width: 302px;  /* Defined in captcha.get_display_html. */
}

.source .instructions {
  padding-top: 1em;
  padding-bottom: 1em;
}

/* cancel icon */
.photo-upload-cancel {
  height: 10px;
  width: 10px;
  vertical-align: middle;
}

/* results page */

.seek.results.border {
  background: #fff;
  border: 2px solid #e6e6e6;
  padding: 20px;
  padding-top: 0px;
  box-sizing: border-box;
  margin: 1em auto;
  max-width: 380px;
  width: 100%;
  box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.26);
  border-radius: 3px;
}

img.resultImage {
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 80px;
  border: 1px solid #dadada;
}

.resultsTitle {
  font-size: 18px;
  padding-top: 10px;
  width: 100%;
}

resultsList {
  width: 100%
}

.duplicate-checkbox {
  margin: 4px 6px 2px 2px;
}

#dup_form, #dup_form form {
  margin: 1em 0;
}

.result-link {
  color: #3b78e7;
  display: block;
  text-decoration: none;
}

.result-link:visited {
  color: #00008b;
}

.searchResults {
  list-style: none;
  margin: 0;
  padding: 0;
}

.searchResults .resultItem {
  padding: 5px;
  cursor: pointer;
}

.searchResults .resultItem:hover {
  background: #cdf;
}

.searchResults .resultItem .resultOrder {
  padding-right: 5px;
  float: left;
  color: #888;
}

.resultDataLabel {
  font-size: 14px;
  color: #888;
}

.resultDataValue {
  font-size: 14px;
}

.searchResults .resultDataPersonFound {
  background: lightGreen;
}

.searchResults .resultImageContainer {
  float: left;
}

.searchResults .resultDataTitle {
  font-size: 18px;
}

.searchResults .resultData {
  margin-left: 100px;  /* 80px for image + 20px gutter */
}

.searchResults .resultImageContainer,
.searchResults .resultData,
.searchResults .resultDataTitle,
.searchResults .tracking {
  display: block;
}

.searchResults .tracking {
  text-align: right;
}

.third-party-search-result {
  font-weight: bold;
}

/* Embedding instructions */

div.embed pre {
  margin-left: 2em;
  padding: 0.5em;
  background: #eee;
  border: 1px solid #ddd;
}

/* Admin page */

.admin-root {
  display: flex;
}

.admin-side-bar {
  flex-grow: 0;
  flex-shrink: 0;
  width: 170px;
  background-color: #d0d0d0;
  padding: 10px;
}

.admin-content {
  flex-grow: 1;
  flex-shrink: 1;
  max-width: 800px;
  padding: 0px 10px;
}

form.admin fieldset {
  border: 1px solid #888;
  margin: 24px 6px;
  padding: 6px;
}

form.admin legend {
  font-weight: bold;
}

form.admin .config {
  margin: 12px 2px;
}

form.admin input#subdomain_new {
  font-family: courier, monospace;
  font-size: 14px;
  text-align: right;
}

form.admin .config .response {
  margin-left: 4em;
}

form.admin .config input, form .config textarea, form code {
  font-family: courier, monospace;
  font-size: 14px;
}

form.admin .option label {
  width: 20em;
}

form.admin .config .note {
  margin-left: 4em;
}

#admin-reposelector {
  display: inline-block;
}

.subscribe_email_error {
  color: #f00;
}

#save_repo table td {
  vertical-align: top;
}

/* Review page */

table.review {
  border-collapse: collapse;
  font-size: 11px;
}

table.review th, table.review td {
  border: 1px solid #ccc;
  padding: 4px 4px;
}

table.review th {
  font-weight: normal;
}

table.review th.colgroup {
  font-size: 10px;
  text-transform: uppercase;
  color: #fff;
}

table.review th.person.colgroup {
  background: #5582dd;
}

table.review th.note.colgroup {
  background: #555;
}

table.review .person,
table.review .person a,
table.review .person a:visited {
  color: #04c;
}

table.review td.empty {
  text-align: center;
  border: none;
}

table.review td.caret, table.review td.checkbox {
  padding: 2px 0;
  border-left: none;
  border-right: none;
}

table.review td.date {
  white-space: nowrap;
}

table.review td.statuses {
  font-family: monospace;
}

table.review .email {
  color: #a66;
}

table.review .no-email {
  color: #aaa;
}

table.review .entry-date {
  color: #aaa;
}

/* Dashboard page */

table.counts {
  border-collapse: collapse;
  width: 100%;
}

table.counts tr.head {
  background: #cdf;
}

table.counts th, table.counts td {
  min-width: 3em;
  padding: 8px;
  border: 1px solid #aaaaaa;
}

table.counts th {
  text-align: left;
  font-weight: bold;
}

table.counts td {
  text-align: left;
}

/* Historical statistics page */

table.statistics {
  width: 100%;
  background: #ffffff;
  border-collapse: collapse;
}

table.statistics thead {
  color: #2a2a2a;
}

table.statistics th,
table.statistics td {
  padding: 8px;
  text-align: left;
  border: 1px solid #dadada;
}

table.statistics tbody tr:hover{
  background-color: #f4f4f4;
}

/* ACLs management page */

table.admin-acls {
  border-collapse: collapse;
}

table.admin-acls th,
table.admin-acls td {
  border: 1px solid #dadada;
}

/* API key management page */

table.api-keys {
  border-collapse: collapse;
  font-size: 11px;
}

table.api-keys th, table.api-keys td {
  border: 1px solid #999;
  padding: 4px 4px;
}

table.api-keys th {
  font-weight: normal;
}

table.api-keys th.colgroup {
  font-size: 10px;
  text-transform: uppercase;
  color: #fff;
}

table.api-keys th.contact.colgroup {
  background: #5582dd;
}

table.api-keys th.permission.colgroup {
  background: #555;
}

table.api-keys th.operation {
  background: #A55;
  color: #fff;
}

table.api-keys .contact,
table.api-keys .contact a,
table.api-keys .contact a:visited {
  color: #04c;
}

table.api-keys .invalid_key td {
  background: #CCC;
}

table.api-keys td.empty {
  text-align: center;
  border: none;
}

/* Import page */

.import {
  margin: 50px;
}

.import form {
  margin: 20px 0;
}

.import .stats {
  background: #f4f4f4;
  border: 1px solid #dadada;
  font-size: 12px;
  padding: 1em;
}

.import .stats .errors {
  color: red;
}

.import .stats .error {
  background: inherit;
  margin: 0.5em 0;
  padding: 0;
  border: none;
}

.import .stats .error .message {
  font-weight: bold;
}

#recaptcha_widget_div {
  overflow: auto;
}

/* Side menu */

.sidenav {
  height: 100%;
  width: 80%;
  max-width: 0;
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  background-color: #ffffff;
  overflow-x: hidden;
  transition: 0.5s;
  white-space: nowrap;
}

.sidenav h2 {
  margin: 8px;
}

.sidenav div {
  padding: 15px 8px;
}

.sidenav div a {
  color: blue;
  display: inline;
}

.sidenav select {
  margin: 8px;
}

.sidenav a {
  padding: 15px 8px;
  text-decoration: none;
  color: black;
  display: block;
  border-top: 1px solid #dadada;
}

.google-logo img {
  padding: 12px 8px;
  height: 32px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  display: none;
}


  /* Share buttons */
  .fb-share-button {
    vertical-align: top !important;
  }

