/* Panel Styles */
.tm-control-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-white-20);
    backdrop-filter: blur(5px);
    z-index: 1500;
    transform: translateY(-85px);  /* Hidden by default */
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.tm-control-panel.tm-expanded {
    transform: translateY(-10px);  /* Fully visible when expanded */
}

.tm-panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    padding: 30px 1rem 0.25rem;
}

/* Speech Selector */
.tm-speech-selector {
    width: 100%;
    max-width: 300px;
    margin: 0;
    padding: 0;
}

.tm-speech-select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--color-white-30);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--color-white);
    cursor: pointer;
}

/* Control Buttons */
.tm-control-buttons {
    display: flex;
    gap: 0.4rem; /* Reduced gap between icons */
    justify-content: center;
    padding: 1rem 1rem 0.25rem;
    margin-top: auto;
    position: relative;
    outline: none;
}

.tm-icon-button {
    background: none;
    border: none;
    color: var(--color-white);
    width: 80px;
    height: 80px;
    padding: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
}

.tm-icon-button:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.tm-icon-button:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
}

.tm-icon {
    width: 24px; /* Adjust size if needed */
    height: 24px;
    margin: auto;
    vertical-align: middle; /* Align with other icons */
}

/* Panel Toggle */
.tm-panel-toggle {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white-20);
    backdrop-filter: blur(5px);
    border-radius: 0 0 8px 8px;
    width: 60px;
    height: 32px;
    z-index: 1499;
    user-select: none;
}

.tm-panel-toggle .tm-toggle-button {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0 0 8px 8px;
    padding: 5px 12px;
    cursor: pointer;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    outline: none;
}

.tm-panel-toggle .tm-toggle-button:focus {
    outline: none;
    background: transparent;
}

.tm-panel-toggle .tm-toggle-button:focus-visible {
    outline: none;
    background: transparent;
}

.tm-arrow {
    display: inline-block;
    transition: transform 0.4s ease;
    font-size: 16px;
    line-height: 1;
    color: var(--color-white);
    pointer-events: none;
    user-select: none;
    transform: rotate(180deg);  /* Point up by default */
}

.tm-control-panel.tm-expanded .tm-arrow {
    transform: rotate(0deg);  /* Point down when expanded */
}

.speakipedia-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    outline: none;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    width: 80px;
    height: 80px;
    margin: 0;
}

.speakipedia-button img {
    width: 48px;
    height: 48px;
    padding: 0;
}

.speakipedia-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}