:root {
    --color-white: #fff;
    --color-orange: #eb5505; 
}
html {
    height: 100vh;
    width: 100%;
    font-family:"Roboto",sans-serif;
}
html,body{
    border:none; 
    padding:0; 
    margin:0;
    background: var(--color-white);
    color:#202020;
}
body{
    text-align:center;
    height: 100%;
    height: -webkit-fill-available;
}
h1.title{
    color:#404040;
    margin: 0;
    padding: 10px;
}
#testWrapper {
    height: calc(100vh - 68px); 
}
#test { 
    height: 85%;
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    padding-top: 20px;
}
#startStopBtn{
    display:inline-block; 
    margin:0 auto;
    color:var(--color-white);
    background-color: var(--color-orange);
    border:0.15em solid var(--color-orange);
    border-radius:0.3em;
    transition:all 0.3s;
    box-sizing:border-box;
    width:8em; height:3em;
    line-height:2.7em;
    cursor:pointer;
    box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1);
    border-radius: 15px;
    width: 130px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
}
#startStopBtn:hover{
    box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
}
#startStopBtn.running{
    background-color:var(--color-orange);
    border-color:var(--color-orange);
    color:var(--color-white);
}
#startStopBtn:before{
    content:"START";
    font-size: 25px; 
    font-weight: bold;
}
#startStopBtn.running:before{
    content:"ABORT";
}
div.testArea{
    display:inline-block;
    width:16em;
    height:12.5em;
    position:relative;
    box-sizing:border-box;
}
#response {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 30px;
}
div.testArea2{
    position:relative;
}
div.testArea div.testName{
    position:absolute;
    top:0.1em; left:0;
    width:100%;
    font-size:1.4em;
    z-index:9;
}
div.testArea2 div.testName{
    display:block;
    text-align:center;
    font-size:1.4em;
}
div.testArea div.meterText{
    position:absolute;
    bottom:1.55em; left:0;
    width:100%;
    font-size:2.5em;
    z-index:9;
}
div.testArea2 div.meterText{
    display:inline-block;
    font-size:2.5em;
}
div.meterText:empty:before{
    content:"0.00";
}
div.testArea div.unit{
    position:absolute;
    bottom:2em; left:0;
    width:100%;
    z-index:9;
}
div.testArea2 div.unit{
    display:inline-block;
}
div.testArea canvas{
    position:absolute;
    top:10px; left:0; width:100%; height:100%;
    z-index:1;
}
div.testGroup{
    display:block;
    margin: 0 auto;
}
#shareArea{
    width:95%;
    max-width:40em;
    margin:0 auto;
    margin-top:2em;
}
#shareArea > *{
    display:block;
    width:100%;
    height:auto;
    margin: 0.25em 0;
}
#privacyPolicy{
    position:fixed;
    top:2em;
    bottom:2em;
    left:2em;
    right:2em;
    overflow-y:auto;
    width:auto;
    height:auto;
    box-shadow:0 0 3em 1em #000000;
    z-index:999999;
    text-align:left;
    background-color:var(--color-white);
    padding:1em;
}
a.privacy{
    text-align:center;
    font-size:0.8em;
    color:#808080;
    padding: 0 3em;
}
div.closePrivacyPolicy {
    width: 100%;
    text-align: center;
}
div.closePrivacyPolicy a.privacy {
    padding: 1em 3em;
}
.testName span {
    margin-left: 6px;
}


  /* ハンバーガーメニュー */
#hamburger-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

#hamburger-menu > div {
    width: 30px;
    height: 5px;
    background-color: #333;
    margin: 6px 0;
}

/* メニューアイテム */
#menu-items {
    position: fixed; /* absoluteからfixedに変更 */
    top: 0; /* 50pxから0に変更 */
    right: 0; /* 10pxから0に変更 */
    bottom: 0; /* 新たに追加 */
    width: 250px; /* 新たに追加 */
    background-color: #333;
    padding: 10px;
    border-radius: 5px;
    text-align: left;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    overflow: auto; /* 新たに追加 */
    z-index: 10000;
}

#menu-items a {
    display: block;
    margin-bottom: 10px;
    margin-right: auto;
    color: var(--color-white);
    text-decoration: none;
    border-bottom: 1px solid #fff; /* 新たに追加 */
    padding-bottom: 10px; /* 新たに追加 */
}

/* メニューヘッダー */
#menu-header {
    color: var(--color-white);
    border-bottom: 1px solid #fff;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* 閉じるボタン */
#close-button {
    font-size: 24px;
}

/* メニュー外をクリックしたときにメニューを閉じるためのdivのスタイル */
#menu-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* メニューアイテムのz-indexよりも1つ小さい値に設定 */
    background-color: rgba(0,0,0,0.5); /* 半透明の黒色に設定 */
}


/* 電話番号入力欄 */
#phone-input{
    position:fixed;
    top:2em;
    bottom:2em;
    left:2em;
    right:2em;
    overflow-y:auto;
    width:auto;
    height:auto;
    box-shadow:0 0 3em 1em #000000;
    z-index:999999;
    text-align:center;
    background-color:var(--color-white);
    padding:1em;
}

div.closePhoneInput {
    width: 100%;
    text-align:  center;
}


/*測定履歴表示*/
#view-history{
    position:fixed;
    top:2em;
    bottom:2em;
    left:2em;
    right:2em;
    overflow-y:auto;
    width:auto;
    height:auto;
    box-shadow:0 0 3em 1em #000000;
    z-index:999999;
    text-align:center;
    background-color:var(--color-white);
    padding:1em;
}

/*履歴削除ボタン*/
#clear-history{
    font-size: 1.5rem;
    color: #fff;
    background-color: #dc143c;
    border-radius: 10px;
    border: none;
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 8px 20px;
    width: 220px;
    height: 50px;
}

/*削除ボタンアイコン*/
.trash-icon{
    height:90%;
    backgroung-color:white;
}

#clear-history:hover {
    opacity: 0.7;
}

div.closeViewHistory{
    width: 100%;
    text-align:  center;
}

/*履歴ダウンロードボタン*/
#csv-download{
    font-size: 1.5rem;
    color: #fff;
    background-color: #008000;
    border-radius: 10px;
    border: none;
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 8px 20px;
    width: 220px;
    height: 50px;
}

#csv-download:hover{
    opacity: 0.7;
}

.history-button {
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .history-button {
        flex-direction: column;
    }
}

/*測定履歴のテーブルCSS*/
#view-history table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* 外周線を立体的に */
}

#view-history th, #view-history td {
    border: 1px solid #ddd;
    padding: 0.5em;
    text-align: center;
}

#view-history th {
    background-color: #f2f2f2;
    /*background-color: #333;    カラム名の背景色を調整*/ 
    /*color: var(--color-white);;*/
}

#view-history tr:nth-child(even) {
    background-color: #f2f2f2;
}

#view-history tr:hover {
    background-color: #ddd;
}

#view-history td:first-child, #view-history th:first-child {
    text-align: center;
}


/*ダークモード対応*/
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1c1c1e;
        color: var(--color-white);
    }
    h1.title{
        color:var(--color-white);
    }
    #privacyPolicy{
        background-color: #1c1c1e;
        color: var(--color-white);
    }
    #phone-input{
        background-color: #1c1c1e;
        color: var(--color-white);
    }
    #phone-input input, #phone-input button {
        background-color: #1c1c1e;
        color: var(--color-white);
        box-shadow: 0px 2px 5px rgba(255, 255, 255, 0.2);
    }
    
    #view-history{
        background-color: #1c1c1e;
        color: var(--color-white);
    }
    /*#view-history th{*/
    /*    background-color: #1c1c1e;*/
       
    /*    color: hsl(0, 0%, 80%);  */
    /*}*/
    
    #view-history th, #view-history td {
        border: 1px solid #555;
    }
    #view-history th {
        background-color: #555;
    }
    #view-history tr:nth-child(even) {
        background-color: #444;
    }
    #view-history tr:hover {
        background-color: #777;
    }
    
}

/*iPhone無印サイズ対応*/
@media only screen and (max-width: 400px) {
    body {
        font-size: 14px; /* フォントサイズを小さくする */
    }
}

/*iPhone mini対応*/
@media only screen and (max-width: 380px) {
    body {
        font-size: 12px; /* フォントサイズを小さくする */
    }
}

/*モーダルダイアログ*/
/* モーダルコンテンツ */
.modal {
  position: absolute;
  top: 0%;
  right: 0;
  left: 0;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  text-align: center;
  background: rgba(0,00,0,70%);
  padding: 40px 20px;
  overflow: auto;
  
  visibility: hidden;
  transition: .3s;
  box-sizing: border-box;
  
}

/* モーダルの擬似要素の指定 */
.modal:before{
  content: "";
  display: inline-block;
  vertical-align: middle;
  height: 100%;
  margin-left: -0.2em;
  
}


/* モーダル内側の指定 */
.modal-container{
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 600px;
  width: 90%;
  border-radius: 10px;
}

/* モーダルのコンテンツ部分の指定 */
.modal-content{
  background: #fff;
  text-align: center;
  line-height: 1.8;
  padding: 20px;
}

/* モーダルのコンテンツ部分のテキストの指定 */
.modal-content p{
  margin: 1em 0;
  font-size: 30px;
  color: black;
}

/* コンテンツ内のボタンデザイン */
#delete_button, #cancel_button {
    font-size: 1.6rem;
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    width: 180px;
    height: 50px;
}

#delete_button {
    background-color: red;
    margin-right: 10px;
}

#cancel_button {
    background-color: gray;
}

#delete_button:hover, #cancel_button:hover {
    opacity: 0.7;
}

.button_row {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media screen and (max-width: 600px) {
    .button_row {
        flex-direction: column;
    }

    #delete_button, #cancel_button {
        width: auto; /* モバイル表示では幅を自動調整 */
        margin: 5px; /* モバイル表示用のボタン間の余白 */
        width: 200px;
        height: 50px;
    }

    #delete_button {
        margin-right: 0; /* モバイル表示では余白をリセット */
        margin-bottom: 5px; /* モバイル表示用の余白調整 */
    }
}