/* Suno AI VN v5 Styles - Tách từ generator-form.php */

/* Expiration notice */
.expiration-notice {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: center;
    font-style: italic;
}

/* Audio controls */
.audio-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px;
    border-radius: 0 0 8px 8px;
    flex-direction: column;
}

.audio-controls-top {
    display: flex;
    align-items: center;
    width: 100%;
}

.play-pause-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.duration-counter {
    color: white;
    font-size: 12px;
    margin-left: 8px;
    position: relative;
}

.duration-loader {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

.progress-container {
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-top: 5px;
    cursor: pointer;
    position: relative;
}

.progress-bar-audio {
    height: 100%;
    background-color: #1db954;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    display: none;
}

.progress-container:hover .progress-handle {
    display: block;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Audio source transition effect */
@keyframes audio-source-updated {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.audio-source-updated {
    animation: audio-source-updated 1.5s ease-in-out;
}

/* Stream URL vs Audio URL indicator */
.item-image {
    position: relative;
}

.audio-source-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.stream-source {
    background-color: rgba(255, 152, 0, 0.8);
}

.audio-source {
    background-color: rgba(76, 175, 80, 0.8);
}

/* Improve download button visibility */
.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.item-actions button:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.download-audio {
    position: relative;
}

.radio-group {
    display: inline-flex;
    gap: 10px;
}

.item-info {
    align-self: center;
}
.play-pause-btn:hover{
    background: none;
}
.play-pause-btn:focus{
    background: none;
}
.credits-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

.credits-info h2 {
    margin-top: 0;
    color: #007bff;
}

.generator-form {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
    padding-right: 70px;
    line-height: 1.5;
    scrollbar-width: thin;
}

.char-counter {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 0.85rem;
    pointer-events: none;
    color: #6c757d;
}

.char-counter.limit-reached {
    color: #dc3545;
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Style/Prompt inputs */
.style-inputs,
.prompt-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.style-inputs input,
.prompt-inputs textarea {
    width: 100%;
    
}

.select-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
}

.select-wrapper select {
    flex: 1;
    min-width: 0;
}

.style-addon,
.prompt-addon {
    width: 100%;
}

/* Switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 1rem;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #007bff;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.label-text {
    font-weight: 500;
    color: #2c3e50;
    display: inline-flex;
    width: auto;
    margin-left: 10px;
    line-height: 32px;
    vertical-align: middle;
}

.form-group.inline-label {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
}

/* Generate button */
.generate-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.generate-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.generate-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
/* History list */
.history-list {
    margin-top: 3rem;
}

.history-list h3 {
    margin-bottom: 1.5rem;
}

.history-items {
    display: grid;
    gap: 1.5rem;
    max-height: 470px;
    overflow: auto;
    scrollbar-width: thin;
}

.history-sort {
    margin-bottom: 1rem;
}

.history-sort select {
    width: auto;
    min-width: 150px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

.history-sort select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.history-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.item-image {
    position: relative;
    width: 120px;
    height: 120px;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.audio-controls {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    border-radius: 0 0 4px 4px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.play-pause-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: white;
    opacity: 0.9;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.play-pause-btn:hover {
    opacity: 1;
}

.play-pause-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: white;
}

.duration-counter {
    color: white;
    font-size: 12px;
    font-weight: 500;
    min-width: 68px;
    text-align: right;
    justify-items: right;
}

.item-image audio {
    display: none;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-title {
    margin: 0;
    font-size: 1.2rem;
}

.item-meta {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-tags span {
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.item-player {
    margin-top: auto;
}

.item-player audio {
    width: 100%;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.item-actions button:hover {
    background-color: #f0f0f0;
}

.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

/* Loading indicator styles */
.dashicons-spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.item-time {
    font-size: 0.7em;
} 
h4.item-title {
    margin-bottom: 0px;
}

@media (max-width: 420px) {
    
    .history-item {
    display: grid;
    grid-template: none;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
    
    .ai-music-generator {
        padding: 0.5rem;
    }

    .generator-form {
        padding: 1.5rem;
    }

    .style-inputs,
    .prompt-inputs {
        flex-direction: column;
    }

    .select-wrapper {
        display: flex;
        flex-direction: column; /* Force row direction on mobile */
        flex-wrap: nowrap; /* Prevent wrapping on mobile */
        gap: 10px;
    }

    .select-wrapper select {
        flex: 1;
        width: 100%; /* Ensure each select takes up 50% */
        min-width: 0; /* Allow shrinking if needed */
    }

    .form-control {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on mobile */
    }

    textarea.form-control {
        min-height: 120px;
    }

    .generate-button {
        padding: 0.875rem 1.5rem;
    }
    .item-actions {
    display: flex;
    flex-direction: row;
    gap: 0rem;
}
    
}

/* History list header styles */
.history-header {
    display: none; /* Hidden by default */
    margin-bottom: 1.5rem;
}

.history-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.history-sort {
    margin: 0;
}

.history-expiration {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.history-sort select {
    width: auto;
    min-width: 150px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

/* Show header when there are items */
.history-list:not(:empty) .history-header {
    display: block;
}

@media (max-width: 420px) {
    .history-header-top {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .history-sort select {
        width: 100%;
    }
}