:root {
  --bg-main-color: #27b8b8;
  --bg-menu-color: #2553ea4a;
  --bg-accent-color: #2195cb;
  --bg-soft-color: #57b98d95;

  --text-normal-color: #1a1d1c;
  --text-accent-color: #2589da;
  --text-secondary-color: #fdf8f8;
  
  --accent-color: #e4821f;
  --button-bg-color: #57b98d;

  
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

body {
  background: url("../assets/background.jpeg") center/cover no-repeat;
  height: 100vh;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  overflow: hidden;
}

.app {
  display: flex;
}

/* -- Menu-left -- */
.menu {
  flex: 1 1 20%;  
  /* border-right: 1px solid var(--text-secondary-color); */
  height: 100vh;
  position: sticky;
  left: 0;
  top: 0;
  background-color: var(--bg-menu-color);
}

.menu .menu__title {
  font-size: 2rem;
  width: 100%;
  color: var(--text-secondary-color);
  padding: 2rem;
  margin-top: 2rem;
  white-space: nowrap;
}

.menu .control-panel {
  display: flex;
  flex-direction: column;  
  align-items: center;
}

/* -- each item -- */
.menu .control-panel li {
  margin: 10px 0;

}

/* create-button */
.menu .control-panel li .create-button {
  outline: none;
  background-color: var(--button-bg-color);
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-secondary-color);
  border: none;  
  text-align: center;
  white-space: nowrap;
  width: 10em;
}

.menu .control-panel li .create-button:hover {
  background-color: var(--accent-color);
  transition: 200ms ease-out;
}

.menu .control-panel li .create-button.menu-selected {
  background-color: var(--accent-color);
}

/* -- Container-right -- */ 
.container {  
  flex: 1 1 80%;
  height: 100vh;
  overflow: auto; /* 요소가 넘칠 경우에만 스크롤 바를 보여준다*/       
}

.page {
  position: relative; 
  display: flex;
  align-items: flex-start;
  /* justify-content: space-between; */
  width: 100%;
  height: 100%; 
  padding: 2rem;
  /* box-sizing: border-box; */
}

/* page-section */
.page-section {  
  background-color: var(--bg-soft-color); 
  border-radius: 10px;  
  padding: 1rem;
  min-width: 180px;
  flex: 1;
}

/* except the last element */
.page-section:not(:last-of-type) { 
  margin-right: 1rem;
}

/* > 자식 요소로 .page-section이 있어야하며 1개만 있는 경우, 자식요소로 2개까지 있는 경우 */
.page:has(>.page-section:only-of-type),
.page:has(>.page-section:first-of-type:nth-of-type(2)){
  justify-content: center;
}

/* when the page section exists only one */
.page-section:only-of-type {
  flex: 0 0 60%;
}

/* 자식요소 2개 있는 경우 크기가 너무 커서 별도로 줄임 */
.page-section:first-of-type:nth-of-type(2),
.page-section:first-of-type:nth-of-type(2)~.page-section{
  flex: 0 0 calc(50% - 100px);
}

/* page section title */
.page-section-title {
  display: inline-block;
  font-size: 1.5em;
  color: var(--text-normal-color);
  width: 100%;    
}

/* page item (li) */
.page-item {
  display: flex;
  flex-direction: column;   
  background-color: var(--bg-menu-color);
  padding: 10px;
  border: 2px solid var(--bg-menu-color);
  border-radius: 5px;  
  transition: box-shadow,transform 200ms ease-in-out;  
}

.page-item:first-of-type {
  margin-top: 10px;
}

.page-item:not(:last-of-type) {
  margin-bottom: 1rem;
}

.page-item:hover,
.page-item:focus {
  box-shadow: 0 0.5em 0.5em -0.4em #ffa260;
  transform: translateY(-0.25em);
  border-color: #ffa260;
}

.page-item__controls {
  display: flex;
  flex-direction: column;
}

.page-item__controls>.close {
  align-self: flex-end;
  padding: 0.3rem 0.5rem;  
  margin-bottom: 5px;
  border-radius: 10px;
}
.page-item__controls>.close:hover {
  background-color: var(--bg-soft-color);
}

.page__body {
  width: 100%;
  overflow: hidden;
  
}

.section-item__title {
  padding: 0.5rem;
  border-radius: 5px;
  background-color: var(--text-secondary-color);  
  color: var(--text-normal-color);
  font-size: 1.2rem;
}

.photo__title,.youtube__title {
  margin-top: 5px;
}

.memo__title,.todo__title {
  margin-bottom: 10px;
}

.photo__holder {
  width: 100%;
  font-size: 0;
}

.photo__thumbnail {
  display: inline-block;  
  width: 100%;   
  /* height: 100%;        */
  box-sizing: border-box;
  font-size: 0;
  min-width: 50px;
  border-radius: 5px;
}

/* to make responsive iframe */
/* https://www.w3schools.com/howto/howto_css_responsive_iframes.asp */
.youtube__player {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio, 100% is 1:1 */
}

.youtube__iframe {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* -- Dialog -- */
.dialog {
  position: absolute;  /* relative to page class to be placed to the right */
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  z-index: 1;  
  background-color: #4344448f;
  overflow: hidden;
}

.dialog__container {  
  display: flex;
  flex-direction: column;  
  background-color: var(--accent-color);
  width: 30rem;
  border-radius: 10px;
  padding: 1em;
}

.dialog__form {
  display: flex;
  flex-direction: column;
  align-items: center;  
}

.dialog__body {
  width: 100%;
  margin: 1rem;
}

.close,.dialog__submit {
  padding: 0.5em 1em;
}

.dialog__submit {
  background-color: var(--text-accent-color);
  border: none;  
  border-radius: 5px;
}

.close { 
  align-self: flex-end;  
  border: none;
}

.dialog__submit:hover,
.close:hover,
.close:focus {
    transform: scale(1.1);
    color: var(--text-secondary-color);
    background-color: var(--button-bg-color);
    text-decoration: none;
    cursor: pointer;    
    transition: all 200ms ease-out;    
}

.dialog__submit {
  width: 40%;  
  min-width: 100px;
}

.form__container {
  display: flex;
  align-items: center;  
  margin: 0.5rem;
}

.form__container>label {
  display: inline-block;
  min-width: 3rem; 
}

.form__container>input,textarea {
  flex: 1;
  font-size: 1rem;  
  padding: 0.4rem;
  outline: none;
}

/* --- Drag and Drop --- */
/* prevent bubbling for all children elements */
.mute-children * {
  pointer-events: none;
}

.drag-started {
  animation: drag_start 400ms;
  opacity: 0.2;
}
@keyframes drag_start {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.drop-area {
  border: 3px solid var(--accent-color);
}

/* Resposible */

@media only screen and (max-width: 768px) {
  /* app */
  .app {
    flex-direction: column;
  }

  body {
    min-height: 100vh;
    height: 100%;
    overflow: auto;
  }

  .menu {
    background-color: var(--bg-accent-color);
    z-index: 1;
  }

  .menu .menu__title {
    padding: 1rem;
    margin: 0;
  }

  .menu .control-panel {
    flex-direction: row;
    justify-content: center;
    gap: 10px;    
  }

  .menu .control-panel li .create-button {
    width: 100%;
    font-size: 0.9rem;
  }

  /* page */
  .page {
    flex-direction: column;        
    padding: 1rem;
    position: initial;
    height: auto;
  }

  .page-section {  
    flex: 0;
    width: 100%;        
    margin-bottom: 1.2rem;
  }
  
  /* except the last element */
  .page-section:not(:last-of-type) { 
    margin-right: 0;    
  } 
  
  /* when the page section exists only one */
  .page-section:only-of-type {
    flex: 0;
  }

  .dialog {
      position: fixed;  /* relative to page class to be placed to the right */
      top: 121.5px;
      align-items: flex-start;
  }  
  .dialog__container {
    display: flex;
    flex-direction: column;  
    background-color: var(--accent-color);
    width: 25rem;
    border-radius: 10px;
    padding: 1em;
  }



  
  
}