/* Base Styling - Full Screen Dark Theme */
body {
    font-family: 'Noto Sans', sans-serif;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    color: #e0e0e0;
    overflow: hidden;

            background-image: url('../image/2831103df9e6ce71fe8b5a5330879859.music-studio-background.jpg');
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
}


/* Utility */
.hidden { display: none !important; }

/* Main Content Area: Status and Visualization */
#main-area {
    flex-grow: 1;
    position: relative;
    padding-top: 60px; /* Account for fixed title bar */
    padding-bottom: 80px; /* Account for fixed taskbar */
}

/* Title and Info - Fixed at the Top */
#title-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #1f1f1f;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000; /* High Z-index */
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0f0f0;
/*    letter-spacing: 0.05em;*/
    margin: 0;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f0f0f0;
/*    letter-spacing: 0.05em;*/
/*    margin: 0;*/
}

#intro-tone-img {
    width: 70%;
    height: auto;
    margin: 20px 0 20px;
/*    transform: scale(0.5);*/
}

#mic-select-dropdown {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #555;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: #3a3a3a;
    color: #f0f0f0;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23f0f0f0"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2em;
    margin-top: 10px;
}

p.info-text {
    color: #b0b0b0;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}


/* Visualization Canvas */
#visualizer {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    z-index: 1;
}

/* Task Bar Styling (Fixed Bottom Control Strip) */
#task-bar {
    position: fixed;
    /* 3 equally sized columns */
    grid-template-columns: 1fr 1fr 1fr;
    display: grid;
    justify-items: center;
    justify-content: center;
    /*vertically center all children */
    align-items: center;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: #1f1f1f;
    border-top: 1px solid #333;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
/*    padding: 0 20px;*/
    padding: 0;
    z-index: 1000; /* same Z-index as title bar */
}

.task-group-left {
    display: flex;
    justify-self: start;
    align-items: center;
/*    gap: 20px;*/
/*    min-width: 150px;*/
}

.task-group-mid {
    display: flex;
    justify-self: center;
    align-items: center;
}

.task-group-right {
    display: flex;
    justify-self: end;
    align-items: center;
/*    gap: 20px;*/
/*    min-width: 150px;*/
}

.rightmost-text {
    padding-right: 10px;
}

/* Language Dropdown (moved to title-container) */
.lang-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #555;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background-color: #3a3a3a;
    color: #f0f0f0;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23f0f0f0"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    min-width: 100px;
    cursor: pointer;
}

/* Button Styles */
.task-bar-button {
    background-color: #4a4a4a;
    color: #f0f0f0;
    font-weight: 700;
    margin: 0 10px 0 10px;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.task-bar-button:hover:not(:disabled) {
    background-color: #5a5a5a;
}
.task-bar-button:active:not(:disabled) {
    transform: translateY(1px);
}
.task-bar-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.taskbar-minor-text {
    margin-left: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Tooltip container */
.tooltip {
 position: relative;
 display: inline-block;
 border-bottom: 1px dotted black; /* Optional: dots under the hoverable text */
 font-size: 0.8rem;
 font-weight: 500;
}
/* Tooltip text */
.tooltip .tooltiptext {
 visibility: hidden;
 width: 120px;
 background-color: #555;
 color: #fff;
 text-align: center;
 padding: 5px 0;
 border-radius: 6px;
 position: absolute;
 z-index: 1;
 bottom: 125%; /* Position the tooltip above the text */
 left: 50%;
 margin-left: -60px; /* Center the tooltip */
 opacity: 0;
 transition: opacity 0.3s; /* Fade-in effect */
}
/* Tooltip arrow */
.tooltip .tooltiptext::after {
 content: "";
 position: absolute;
 top: 100%; /* Position the arrow at the bottom */
 left: 50%;
 margin-left: -5px;
 border-width: 5px;
 border-style: solid;
 border-color: #555 transparent transparent transparent; /* Arrow color */
}
/* Show the tooltip text when hovering over the container */
.tooltip:hover .tooltiptext {
 visibility: visible;
 opacity: 1;
}

/* Main Control Button (Start/Pause) */
.main-control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
    border: 2px solid #007bff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.main-control-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-start {
    background-color: #007bff;
    background-image: linear-gradient(145deg, #007bff, #0056b3);
    margin: 0 10px 0 10px;
}
.btn-start:hover:not(:disabled) {
     background-image: linear-gradient(145deg, #0056b3, #004085);
}
#record-svg {
    width: 40px;
    height: 40px;
}
#pause-svg {
    width: 40px;
    height: 40px;
}
#delete-svg {
    width: 40px;
    height: 40px;
}
#config-svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}
#copy-svg {
    width: 20px;
    height: 20px;
    /*can't override it?
    stroke: #ffffff; */
}

.minor-control-btn {
    width: 40px;
    height: 40px;
/*    border-radius: 50%; */
    margin: 0 10px 0 10px;
/*    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);*/
/*    border: 2px solid #007bff;*/
    transition: all 0.2s ease;
    flex-shrink: 0;

    padding: 0.4rem 0.6rem;
    border: 1px solid #555;
    border-radius: 0.5rem;
    background-color: #3a3a3a;
/*    color: #ffffff;*/
    appearance: none;
    cursor: pointer;

    font-size: 0.8rem;
    font-weight: 500;
}
.minor-control-btn:hover:not(:disabled) {
    transform: scale(1.05);
}
.minor-control-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-config {
    /*
    background-color: #007bff;
    background-image: linear-gradient(145deg, #007bff, #0056b3);
    */
}
.btn-config:hover:not(:disabled) {
    /*
     background-image: linear-gradient(145deg, #0056b3, #004085);
     */
}


.btn-delete {
    background-color: #dc3545;
    background-image: linear-gradient(145deg, #dc3545, #a3222e);
    width: 60px;
    height:60px;

    margin: 0 10px;

    box-shadow: 0 0 15px rgba(255, 32, 0, 0.4);
    border: 2px solid #ff2000;
}
.btn-delete:hover:not(:disabled) {
    background-image: linear-gradient(145deg, #a3222e, #7a1b24);
}
.btn-delete:disabled {
    background-color: #4a4a4a !important;
    background-image: none !important;
    color: #a0a0a0;
    box-shadow: none;
    border: 2px solid #000000;
}

/* Speed Selector (Radio Buttons) */
#speed-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3a3a3a;
    padding: 8px 12px;
    border-radius: 0.5rem;
    border: 1px solid #4a4a4a;
    flex-grow: 1; /* Allow it to fill space */
    max-width: 400px;
}

.speed-option input[type="radio"] {
    display: none;
}

.speed-option label {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #b0b0b0;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-width: 40px;
    text-align: center;
}

.speed-option input[type="radio"]:checked + label {
    background-color: #5a5a5a;
    color: #f0f0f0;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* spectrogram */
#recordingCanvas {
    display: block;
    width: 100%;
    height: 100%;
}
/* hack; I know the size of the title bar and task bar*/
#recordingCanvas-container {
    /* 100% of the viewport */
    width: 100vw;
    /* title bar is 60, task bar is 80 */
    height: calc(100vh - 60px - 80px - 40px);
    /* Start just under the title bar 60 plus a bit */
    margin-top: 80px;
}



/* mic selection dialog */
#freqCanvas {
    display: block;
    width: 100%;
    max-height: 150px;
    margin-bottom: 10px;
    background: #111;
    border-radius: 8px
}


/* Button Styles */
.dialog-button {
    background-color: #4a4a4a;
    color: #f0f0f0;
    //font-weight: 700;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dialog-button:hover:not(:disabled) {
    background-color: #5a5a5a;
}
.dialog-button:active:not(:disabled) {
    transform: translateY(1px);
}
.dialog-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Sensitivity Selector (Radio Buttons) */
#sensitivity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3a3a3a;
    padding: 8px 12px;
    border-radius: 0.5rem;
    border: 1px solid #4a4a4a;
    flex-grow: 1; /* Allow it to fill space */
    max-width: 400px;
    /* Put some space between this and the Microphone text */
    margin-left: 10px;
}

.sensitivity-option input[type="radio"] {
    display: none;
}

#sensitivity-label-text {
    color:#b0b0b0;
    font-size: 0.8rem;
    margin-right: 5px;
}

.sensitivity-option label {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #b0b0b0;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-width: 40px;
    text-align: center;
}

.sensitivity-option input[type="radio"]:checked + label {
    background-color: #5a5a5a;
    color: #f0f0f0;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Sensitivity Selector (Radio Buttons) */
#speed-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3a3a3a;
    padding: 8px 12px;
    border-radius: 0.5rem;
    border: 1px solid #4a4a4a;
    flex-grow: 1; /* Allow it to fill space */
    max-width: 400px;
}

.speed-option input[type="radio"] {
    display: none;
}

#speed-label-text {
    color:#b0b0b0;
    font-size: 0.8rem;
    margin-right: 5px;
}

.speed-option label {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #b0b0b0;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-width: 40px;
    text-align: center;
}

.speed-option input[type="radio"]:checked + label {
    background-color: #5a5a5a;
    color: #f0f0f0;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}
