/*
 * SUMMARY
 * =======
 *
 * - BASE
 *
 * - HEADER
 * - MENU
 * - CONTAINER
 *
 * - TOP/LEFT PANEL
 * - BOTTOM/RIGHT PANEL
 *
 * - FLOATING BUTTON
 *
 */



/***************************\
  BASE
\***************************/
@import url('https://fonts.googleapis.com/css?family=Lato:300,400');

body {
  margin: 0;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

body, textarea {
  font-family:  'Lato', sans-serif;
  font-size:    1rem;
  overflow:     hidden;
}

h1 {
  font-size:    inherit;
  font-weight:  inherit;
  margin:       0;
}



/***************************\
  HEADER
\***************************/
header {
  position:     relative;
  background:   linear-gradient(to right top, #03A9F4, #5313cb);
  color:        #fff;
  box-sizing:   border-box;
  line-height:  64px;
  font-size:    2rem;
  font-weight:  lighter;
  box-shadow:   0 0 10px rgba(0,0,0,0.5);
  z-index:      10;
  user-select:  none;
}

header > label {
  cursor: pointer;
}

#menu-button__checkbox {
  display: none;
}

header .menu-button {
  display:        block;
  float:          left;
  font-size:      52px;
  width:          64px;
  height:         64px;
  transition:     300ms cubic-bezier(0.0, 0.0, 0.2, 1) all;
  text-align:     center;
}

#menu-button__checkbox:checked ~ header .menu-button {
  transform: rotate(90deg);
}



/***************************\
  CONTAINER
\***************************/
#container {
  display:  flex;
  position: absolute;
  top:      64px;
  bottom:   0;
  left:     0;
  right:    0;
}

@media (max-width: 520px) {
  #container {
    display:  flex;
    top:      48px;
  }
}

#container > * {
  flex:       1;
  box-sizing: border-box;
  overflow:   auto;
  height: 100%;
}


@media (max-aspect-ratio: 5/4) {
  #container      { flex-direction: column; }
  #container > *  { height: 50vh; }
}



/***************************\
  TOP/LEFT PANEL
\***************************/
#main-panel {
  display:        flex;
  flex-direction: column;
  box-shadow:     0 0 16px rgba(0,0,0,0.2);
  z-index:        1;
}

#main-panel > *,
#menu-button__checkbox:checked ~ #container #menu {
  padding:    20px;
}

#word-list {
  flex:         1;
  background:   #fff;
  color:        #1E88E5;
  border:       none;
  outline:      none;
  word-spacing: 1em;
  line-height:  1.5em;
  resize:       none;
  overflow:     auto;
}



/***************************\
  MENU
\***************************/
#menu {
  height:         0;
  padding-top:    0;
  padding-bottom: 0;
  overflow:       hidden;
  transition:     200ms cubic-bezier(0.4, 0.0, 1, 1) all;
  background:     #555;
  color:          #fff;
  transform:      translateY(-100px);
  box-shadow:     inset 0 0 30px rgba(0,0,0,0.2);
}

#menu > * {
  margin: 0;
  padding: 0;
}

#menu-button__checkbox:checked ~ #container #menu {
  height:     50%;
  overflow:   auto;
  transform:  translateY(0);
  transition: 200ms cubic-bezier(0.0, 0.0, 0.2, 1) all;
}

#menu h2 {
  color: #888;
}

#menu label {
  display:  block;
  margin:   1em 0;
}

#menu input,
#menu select {
  width:          100%;
  border:         none;
  box-sizing:     border-box;
  padding:        5px 0;
  margin-bottom:  1em;
  background:     none;
  color:          #40C4FF;
  border-top:     3px solid transparent;
  border-bottom:  1px solid #aaa;
  outline:        none;
  transition:     120ms all;
}

#menu input:focus,
#menu select:focus {
  border-top-width:     0;
  border-bottom-width:  4px;
  border-bottom-color:  #40C4FF;
}

#menu input::placeholder {
  color:      #888;
  font-style: italic;
}



/***************************\
  BOTTOM/RIGHT PANEL
\***************************/
body { background:   #f4f4f4; }

@keyframes newWordListSlideInFromRight {
  0%    { transform: translateX(5%);  opacity: 0; }
  100%  { transform: translateX(0%); opacity: 1; }
}

#new-word-list {
  flex:         1.6;
  white-space:  pre-line;
  column-width: 120px;
  column-fill:  auto;
  white-space:  pre;
  padding:      20px;
  transition:   200ms cubic-bezier(0.0, 0.0, 0.2, 1) flex;
  animation:    400ms cubic-bezier(0.0, 0.0, 0.2, 1) 0s 1 newWordListSlideInFromRight;
}

@media (max-aspect-ratio: 5/4) and (max-width: 900px), (max-width: 900px) {
  #menu-button__checkbox:checked ~ #container #new-word-list {
    flex: 0.5;
  }
}

@keyframes messageSlideInFromBottom {
  0%    { transform: translateY(10%); opacity: 0; }
  100%  { transform: translateY(0);   opacity: 1; }
}

#new-word-list.new-word-list--no-result {
  text-align:   center;
  white-space:  normal;
  column-width: auto;
  color:        #ccc;
  font-size:    1.5rem;
  font-weight:  bold;
  margin:       auto;
  animation:    400ms cubic-bezier(0.0, 0.0, 0.2, 1) 0s 1 messageSlideInFromBottom;
}

#new-word-list.new-word-list--no-result .icon {
  font-size:    7em;
}



/***************************\
  FLOATING BUTTON
\***************************/
@keyframes slideInFromBottom {
  0%    { transform: translateY(200%); }
  100%  { transform: translateY(0); }
}

#main-button {
  position:   absolute;
  background: #e91e63;
  color:      #fff;
  bottom:     20px;
  right:      20px;
  width:      64px;
  line-height: 64px;
  text-align: center;
  font-size:  2rem;
  border:     none;
  border-radius: 100px;
  outline:    none;
  box-shadow: 0 0 6px rgba(0,0,0,0.2),
              0 6px 12px rgba(0,0,0,0.4);
  transition: all 200ms cubic-bezier(0.0, 0.0, 0.2, 1);
  cursor:     pointer;
  user-select: none;
}

#main-button > * {
  display: block;
}

@media (hover: hover) {
  #main-button:not(.main-button--disabled):hover,
  #main-button:not(.main-button--disabled):active {
    box-shadow: 0 0 12px rgba(0,0,0,0.2),
                0 12px 24px rgba(0,0,0,0.4);
  }

  #main-button:active {
    background: #FF4081;
  }
  
  #main-button:hover > * {
    transform:  rotate(0deg);
  }
}

#main-button.main-button--disabled {
  transform: translateY(200%);
  transition: all 200ms cubic-bezier(0.4, 0.0, 1, 1);

}
