@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

:root {
    --fs-12px: 0.75rem;
    --fs-14px: 0.875rem;
    --fs-16px: 1rem;
    --primary: #343a40;
    --secondary: #E7ECEF;
    --tertiary: #e9ecef;
    --blue: #457b9d;
    --light-blue: #457b9d;
    --dark-blue: #134074;
    --success: #2a9d8f;
    --warning: #fb8b24;
    --error:#e63946;
    --font-lato: 'Lato', sans-serif;
    /* CSS HEX */
    --prussian-blue: #012a4aff;
    --indigo-dye: #013a63ff;
    --indigo-dye-2: #01497cff;
    --indigo-dye-3: #014f86ff;
    --ucla-blue: #2a6f97ff;
    --cerulean: #2c7da0ff;
    --air-force-blue: #468fafff;
    --air-superiority-blue: #61a5c2ff;
    --sky-blue: #89c2d9ff;
    --light-blue: #a9d6e5ff;
}

/* Ensure the popup has a minimum size */
body, .container {
    min-width: 480px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-lato);
}

/* Container for the layout */
.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;  /* Two auto-sized rows for buttons, and the rest goes to the transcript */
    height: 100%;
    box-sizing: border-box;
}

/* Message styling */
.message {
    font-size: var(--fs-14px);
    color: var(--error);
    text-align: center;
    padding: 5px;
}

/* Button styles */
.button-container {
    display: flex;
    justify-content:space-between;
    align-items:center;
}

.button-container .button {
    align-self: start;
    background-color: var(--blue);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: var(--fs-12px);
    margin-left: 8px;
    padding: 2px 4px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.button-container .button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.button-container .button:hover:enabled {
    background-color: var(--blue);
    opacity: .9;
}

/* Loading spinner */
.loading {
    font-size: var(--fs-14px);
    text-align: center;
    color: #333;
}

/* Transcript Header */
.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--blue);
    font-size: var(--fs-16px);
    font-weight: bold;
    color: var(--secondary);
    padding: 4px 8px;
}

.header-title {
    font-size: var(--fs-12px);
    font-weight: 700;
    color: var(--secondary);
}

.video-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: end;
    padding: 0 8px;
}
.video-info .languages-box {
    display: flex;
    align-items: center;
    padding-right: 8px;
}

.video-info .languages-box select {
    font-size: var(--fs-12px);
    padding: 4px;
    border-radius: 4px;
    border: 1px solid var(--tertiary);
    background-color: var(--secondary);
    margin: 4px 0;
}

/* Transcript output box */
.transcript-box {
    background-color: white;
    box-sizing: border-box;
    font-size: var(--fs-16px);
    font-weight: 300;
    line-height: 1.5;
    min-height: 240px;
    max-height: 480px;
    overflow-y: auto;
    padding: 8px 16px;
    text-align: left;
    white-space: pre-wrap;
}

/* Scrollbar customization */
.transcript-box::-webkit-scrollbar {
    width: 8px;
}

.transcript-box::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.transcript-box::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* Spinner container to center only the spinner */
.spinner-container {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* Spinner styles */
.spinner {
    animation: spin 1s linear infinite;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--light-blue);
    border-radius: 50%;
    opacity: 0.5;
    height: 24px;
    width: 24px;
}

/* Spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner-text {
    font-size: var(--fs-14px);
    color: var(--blue);
    margin-top: 8px;
}
