/* style.css */

body {
    width: 100vw;
    height: var(--vh, 100vh);
    margin: 0;
    font-family: Verdana, "Hiragino Sans", 'Noto Sans JP', sans-serif;
    display: flex;
    overflow: hidden;
}
main {
    flex: 4;
    box-sizing: border-box;
    padding: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 4px;
}
video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 44%;
    font-size: 16px;
    color: white;
    background-color: #ccc;
    cursor: pointer;
}
input {
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    background-color: rgba(240, 240, 240);
}

/* Icon */
.material-symbols-rounded {
  font-variation-settings:
  'FILL' 1,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

/* Grid */
#grid {
    flex: 1;
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}
.video-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden
}
#self-video {
    transform: scaleX(-1);
}
#peer-video-wrapper {
    display: none;
}
.audio-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid #4caf50;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px white;
    display: none;
    pointer-events: none;
}
#connection-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    gap: 4px;
    justify-content: center;  /* 横方向の中央 */
    align-items: center;      /* 縦方向の中央 */
}
#loading-spinner {
    display: blcok;
    width: 44px;
    height: 44px;
    margin: 8px;
    border: 4px solid #ccc;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 4s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#status-text {
    display: blcok;
}

/* Toolbar */
#toolbar {
    position: relative;
    height: 60px;
    border-radius: 8px;
    box-sizing: border-box;
    padding: 16px;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-color: #e5e5e5;
}
#code {
    position: absolute;
    left: 8px;
    width: 144px;
    height: 44px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 16px;
    text-align: center;
}
#call-button {
    background-color: #4CAF50;
}
#chat-button {
    position: absolute;
    right: 8px;
    display: none;
}

/* Sidebar */
#sidebar {
    flex: 1;
    height: 100%;
    box-sizing: border-box;
    padding: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    display: none;
    flex-direction: column;
    gap: 8px;
    background-color: #e5e5e5;
}
#log {
    flex: 1;
    display: flex;
    width: 100%;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
#log div {
    width: fit-content; 
    max-width: 75%;
    padding: 4px;
    padding-right: 8px;
    padding-left: 8px;
    border-radius: 8px;
    overflow-wrap: anywhere;
}
.self-message {
    color: white;
    background-color: #d1d1d1;
    align-self: flex-end;
}
.peer-message {
    color: black;
    background-color: #fafafa;
    align-self: flex-start;
}
#text-field {
    width: 100%;
    height: 52px;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 16px;
}
