/* soundraw-styles.css */

/* Style for labels */
form#soundraw-audio-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Style for text input fields */
form#soundraw-audio-form input[type="text"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* Style for submit button */
form#soundraw-audio-form input[type="submit"], .download-button {
  color: white;
  padding: 10px 20px !important;
  border: 1px solid #000000 !important;
  border-radius: 40px !important;
  cursor: pointer !important;
  background-color: #000000 !important;
}

form#soundraw-audio-form input[type="submit"]:hover, .download-button:hover {
  color: #000000 !important;
  background-color: #FFFFFF !important;
  border-color: #000000 !important;
}

form#soundraw-audio-form input[type="submit"]:disabled, .download-button:disabled {
  background-color: #666666 !important;
  border-color: #666666 !important;
  color: #ffffff !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* Style for response message */
/* .soundraw-response {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
} */

#soundraw-audio-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

#soundraw-audio-form div {
  width: 48%; /* Adjust the width as needed */
  margin-bottom: 10px;
}

@import url('https://use.fontawesome.com/releases/v5.3.1/css/all.css');
#app-cover {
    position: relative;
    top: 50%;
    right: 0;
    left: 0;
    width: 430px;
    height: 100px;
    margin: -4px auto;
}

#bg-artwork {
    position: fixed;
    top: -30px;
    right: -30px;
    bottom: -30px;
    left: -30px;
    z-index: 1;
}

#player {
    position: relative;
    height: 100%;
    z-index: 3;
    margin-top: 80px;
}

#player-track {
    position: absolute;
    top: 0;
    right: 15px;
    left: 15px;
    padding: 0px 22px 10px 184px;
    background-color: rgb(4 50 239 / 47%);
    border-radius: 15px 15px 0 0;
    transition: 0.3s ease top;
    z-index: 1;
}

#player-track.active {
    top: -92px;
}

#album-name {
    color: #0a0909;
    font-size: 17px;
    font-weight: bold;
}

#track-name {
    color: #0a0909;
    font-size: 13px;
    margin: 2px 0 13px 0;
}

#track-time {
    height: 12px;
    margin-bottom: 3px;
    overflow: hidden;
}

#current-time {
    float: left;
}

#track-length {
    float: right;
}

#current-time,
#track-length {
    color: transparent;
    font-size: 11px;
    background-color: #ffe8ee;
    border-radius: 10px;
    transition: 0.3s ease all;
}

#track-time.active #current-time,
#track-time.active #track-length {
    color: #1E73BD;
    background-color: transparent;
    margin: -8px 0 0 0px;
}

#s-area,
#seek-bar {
    position: relative;
    height: 4px;
    border-radius: 4px;
}

#s-area {
    background-color: #1e73bd6e;
    cursor: pointer;
}

#ins-time {
    position: absolute;
    top: -29px;
    color: #fff;
    font-size: 12px;
    white-space: pre;
    padding: 5px 6px;
    border-radius: 4px;
    display: none;
}

#s-hover {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    opacity: 0.2;
    z-index: 2;
}

#ins-time,
#s-hover {
    background-color: #3b3d50;
}

#seek-bar {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background-color: #1E73BD;
    transition: 0.2s ease width;
    z-index: 1;
}

#player-content {
    position: relative;
    height: 100%;
    background-color: #fff;
    box-shadow: 0 0px 2px #1E73BD;
    border-radius: 15px;
    z-index: 2;
}

#album-art {
    position: absolute;
    top: -40px;
    width: 115px;
    height: 115px;
    margin-left: 40px;
    transform: rotateZ(0);
    transition: 0.3s ease all;
    box-shadow: 0 0 0 10px #fff;
    border-radius: 50%;
    overflow: hidden;
}

#album-art.active {
    top: -60px;
    box-shadow: 0 0 0 4px #fff7f7, 0 30px 50px -15px #afb7c1;
}

#album-art:before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    width: 20px;
    height: 20px;
    margin: -10px auto 0 auto;
    background-color: #d6dee7;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px #fff;
    z-index: 2;
}

#album-art img {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: -1;
}

#album-art img.active {
    opacity: 1;
    z-index: 1;
}

#album-art.active img.active {
    z-index: 1;
    animation: rotateAlbumArt 3s linear 0s infinite forwards;
}

@keyframes rotateAlbumArt {
    0% {
        transform: rotateZ(0);
    }
    100% {
        transform: rotateZ(360deg);
    }
}

#buffer-box {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 13px;
    color: #1f1f1f;
    font-size: 13px;
    font-family: Helvetica;
    text-align: center;
    font-weight: bold;
    line-height: 1;
    padding: 6px;
    margin: -12px auto 0 auto;
    background-color: rgba(255, 255, 255, 0.19);
    opacity: 0;
    z-index: 2;
}

#album-art img,
#buffer-box {
    transition: 0.1s linear all;
}

#album-art.buffering img {
    opacity: 0.25;
}

#album-art.buffering img.active {
    opacity: 0.8;
    filter: blur(2px);
    -webkit-filter: blur(2px);
}

#album-art.buffering #buffer-box {
    opacity: 1;
}

#player-controls {
    width: 250px;
    height: 100%;
    margin: 0 5px 0 141px;
    float: right;
    overflow: hidden;
}

#soundraw .control {
    width: 33.333%;
    float: left;
    padding: 12px 0;
}

div#play-previous {
    display: none !important;
}

div#play-next {
    display: none !important;
}

/* Responsive design for tablets */
@media only screen and (min-width: 767px) and (max-width: 1260px) {
    #app-cover {
        width: 290px;
    }
    #album-art {
        width: 76px;
        height: 76px;
        margin-left: 35px;
    }
}

/* Responsive design for mobile */
@media (max-width: 600px) {
    #app-cover {
        width: 280px;
    }
    #player-track {
        padding: 0px 10px 10px 140px !important;
    }
    #album-art {
        width: 76px;
        height: 76px;
        margin-left: 35px;
    }
    #album-art {
        width: 102px;
        height: 102px;
    }
    #soundraw-audio-form {
        display: block;
    }
    #soundraw-audio-form div {
        width: 100%;
    }
}

.action-wrapper {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.action-wrapper button {
    width: 100%;
    margin: 0 !important;
    padding: 10px 20px !important;
    border: 1px solid #000000 !important;
    border-radius: 40px !important;
    cursor: pointer !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    text-align: center;
}

.action-wrapper button:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

.action-wrapper button:disabled {
    background-color: #666666 !important;
    border-color: #666666 !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

#download-link:disabled, .new-beat-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-radius: 40px;
    background-color: #666666;
    border-color: #666666;
}

#download-link, .new-beat-button, #save-to-files {
    padding: 10px 20px;
    border: 1px solid #000000;
    border-radius: 40px;
    cursor: pointer;
    background-color: #000000;
    color: #ffffff;
    font-weight: 500;
}

#download-link:hover, .new-beat-button:hover, #save-to-files:hover {
    background-color: #ffffff;
    color: #000000;
    border-color: #000000;
}

#save-to-files {
    background-color: #28a745;
    border-color: #28a745;
}

#save-to-files:hover {
    background-color: #218838;
    border-color: #218838;
    color: #ffffff;
}

/* Add loading spinner styles */
.select-loading {
    position: relative;
    pointer-events: none;
}

.select-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: select-spin 1s linear infinite;
}

@keyframes select-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Style for disabled selects */
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Form loading overlay */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.form-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: form-spin 1s linear infinite;
    z-index: 11;
}

@keyframes form-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    /* Hide the form when class is applied */
    #soundraw-audio-form.form-hidden-mobile {
        display: none !important;
    }
    
    /* Show player when class is applied */
    #custom-player.player-visible-mobile {
        display: block !important;
        margin-top: 20px;
    }
    
    /* Style for the back button */
    .new-beat-button {
        display: block;
        margin: 10px auto;
    }
}

/* Add styles for action wrapper */
.action-wrapper {
    text-align: center;
    margin-top: 30px;
    width: 100%;
}

.action-wrapper button {
    margin: 5px;
}

/* Base player hiding */
#custom-player {
    display: none;
}

/* Show state */
#custom-player.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Remove any conflicting mobile styles */
@media screen and (max-width: 768px) {
    #custom-player {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* Base player styles */
#custom-player {
    display: none;
    width: 100%;
    max-width: 800px;
    border-radius: 10px;
    padding: 20px;
}

#custom-player.show {
    display: block !important;
}

/* Ensure player container is visible */
.player-container {
    display: block !important;
    visibility: visible !important;
}

/* Update download popup styles to match Matchering */
#download-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.download-popup-content {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: popupFadeIn 0.3s ease-out;
    max-width: 400px;
    width: 90%;
}

.download-popup-content p {
    margin: 0;
    font-size: 16px;
    color: #000000;
    font-weight: 500;
    line-height: 1.5;
}

/* Add loading spinner */
.download-popup-content::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Multi-Select Dropdown Styling */
.multi-select-wrapper {
    position: relative;
    width: 100%;
    min-width: 320px;
}

.multi-select-display {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    min-height: 40px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.multi-select-display:hover {
    border-color: #999;
}

.multi-select-display.active {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.multi-select-display.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
    color: #999;
}

.multi-select-display.disabled:hover {
    border-color: #ccc;
}

.multi-select-wrapper.disabled .multi-select-dropdown {
    display: none !important;
}

.multi-select-wrapper.disabled .multi-select-option {
    pointer-events: none;
    opacity: 0.6;
}

.multi-select-wrapper.disabled .multi-select-display {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
}

.multi-select-wrapper.disabled .multi-select-text {
    color: #999 !important;
}

.multi-select-wrapper.disabled .multi-select-arrow {
    color: #ccc !important;
}

.multi-select-option input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.multi-select-text {
    color: #666;
    flex: 1;
    white-space: nowrap;
    margin-right: 12px;
    min-width: 200px;
}

.multi-select-text.has-selections {
    color: #333;
}

.multi-select-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.multi-select-arrow.rotated {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.multi-select-dropdown.show {
    display: block;
}

.multi-select-option {
    display: block;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    background: white;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    min-width: 280px;
    font-size: 13px;
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-option:hover {
    background-color: #f5f5f5;
}

.multi-select-option input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.multi-select-option span {
    vertical-align: middle;
}

/* Mobile responsive for multi-select */
@media (max-width: 600px) {
    .multi-select-wrapper {
        min-width: 280px;
    }
    
    .multi-select-display {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .multi-select-option {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 250px;
    }
    
    .multi-select-option input[type="checkbox"] {
        margin-right: 6px;
        transform: scale(1.0);
    }
}
