* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;
    font-weight: 300;
    background: #363636;
    color: white;
}
main {
    height: 100%;
    display: grid;
    grid-template:
        "s r"
        "s r" 60px / 300px 1fr;
}
@media screen and (max-width: 600px) {
    main {
        grid-template:
            "s s" auto
            "r r" 1fr;
    }
    .side-panel {
        justify-self: center;
        width: 320px;
    }
}
.logo {
    width: 100%;
    margin: 20px 0;
}
.side-panel {
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow: auto;
    grid-area: s;
}
.side-panel button {
    font-size: 14px;
    border: none;
    border-radius: 3px;
    display: inline-block;
    padding: 6px 18px;
    vertical-align: middle;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    box-shadow: none;
    color: #fff;
    height: 36px;
    outline: none;
}
.side-panel input, .side-panel select {
    width: 100%;
    height: 36px;
    margin: 20px 0;
    display: inline-block;
    border: none;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 3px;
    line-height: 36px;
    font-size: 14px;
    font-weight: 400;
    background-color: hsla(0,0%,100%,.15);
    box-shadow: inset 0 0 0 1px hsl(0deg 0% 100% / 10%);
    color: inherit;
    outline: none;
}
.renderer-container {
    display: grid;
    grid-template-rows: 40px 1fr;
    background-color: #1a1a1a;
    color: inherit;
    grid-area: r;
}
.meeting-link {
    display: grid;
    grid-template-columns: auto auto auto 24px auto;
    justify-self: end;
    visibility: hidden;
    padding: 10px 20px;
}
.in-call .meeting-link {
    visibility: visible;
}
.meeting-link img {
    padding: 0 5px;
    height: 20px;
    opacity: 0.5;
}
.meeting-link img:hover {
    opacity: 0.75;
}
.meeting-link img:active {
    opacity: 1;
}
.meeting-link span {
    line-height: 20px;
    padding: 0 5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.controls button {
    position: relative;
    border: none;
    outline: none;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    height: 48px;
    width: 48px;
}
.controls button:hover {
    box-shadow: inset 0 0 0 1px hsl(0deg 0% 100% / 10%);
}
.controls button:active {
    background-color: #262626;
}
.controls button:disabled {
    pointer-events: none;
    opacity: 50%;
}
input[type="text"]:disabled {
    background: rgba(239, 239, 239, 0.3);
}
.btnstart {
    background-color: transparent;
    background-image: url(./assets/callStart.png);
    background-size: 28px;
}
.btnend {
    background-color: #6e1e14;
    background-image: url(./assets/end_call.svg);
}
body.in-call .btnstart {
    display: none;
}
body:not(.in-call) .btnend {
    display: none;
}
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5c92d6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-popup {
    min-width: 200px;
    max-width: 300px;
    position: absolute;
    display: grid;
    grid-template-rows: auto 50px;
    justify-items: center;
    align-self: center;
    justify-self: center;
    background-color: #262626;
    border-radius: 5px;
    padding: 15px;
}
.loading-popup::before {
    content: attr(data-text);
    margin-bottom: 10px;
    line-height: 22px;
    padding: 10px;
}
.loading-popup:not([data-text]),
.loading-popup[data-text=""] {
    display: none;
}
.room-info-popup-container {
    background-color: rgba(16, 22, 26, 0.7);
    display: grid;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.room-info-popup {
    min-width: 400px;
    max-width: 600px;
    min-height: 400px;
    max-height: 800px;
    position: absolute;
    display: grid;
    grid-template-rows: auto 50px;
    justify-items: center;
    align-self: center;
    justify-self: center;
    background-color: #262626;
    border-radius: 5px;
    padding: 15px;
}
.room-info-popup-close-btn {
    background-color: #83c36d;
    border-radius: 3px;
    height: 38px;
    font-size: 14px;
    line-height: 18px;
    color: #fff;
    background-image: none;
    box-shadow: none;
    border: none;
    text-transform: uppercase;
    width: 100%;
    cursor: pointer;
    margin: 1em;
    padding: 1em;
}
.room-info-popup-close-btn:hover {
    background-color: #68a254;
}
.room-info-text {
    margin-top: 0px;
    font-family: inherit;
    font-size: 12pt;
    font-weight: 300;
    line-height: 12pt;
    white-space: pre-wrap;
}

.room-info-text a {
    color: white;
}

.room-info-popup-container:not([data-show]){
   display: none;
}

.tooltip {
position: absolute;
width: 250px;
padding: 20px;
border-radius: 15px;
line-height: 20px;
font-size: 16px;
font-weight: 200;
color: white;
text-align: center;
background-color: #5c92d6;
transform: translate(-50%);
top: 65px;
left: 50%;
opacity: 0;
transition: opacity ease-in .25s;
pointer-events: none;
}
.tooltip::after {
position: absolute;
content: "";
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #5c92d6;
transform: translateX(-50%);
top: -10px;
left: 50%;
}
.tooltip.active {
transition: opacity ease-in 2s;
opacity: 1;
}

/* 翻譯區域樣式 */
.translation-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-height: 300px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
    color: white;
    font-weight: 500;
}

.translation-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.translation-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.translation-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.translation-content.collapsed {
    display: none;
}

.translation-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.translation-item:last-child {
    margin-bottom: 0;
}

.original-text {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 4px;
    font-style: italic;
}

.translated-text {
    color: white;
    font-size: 15px;
    font-weight: 400;
}

/* 語言選擇樣式 */
.side-panel select {
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    width: 100%;
}

.side-panel select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 響應式設計 */
@media screen and (max-width: 600px) {
    .translation-overlay {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}
