* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0D0D0D 0%, #1a1a1a 100%);
    color: #8A2BE2;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid #8A2BE2;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFD700;
}

.back-btn {
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid #8A2BE2;
    color: #8A2BE2;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 18px;
}

.back-btn:hover {
    background: #8A2BE2;
    color: #000;
    transform: scale(1.05);
}

.refresh-btn, .create-new-btn {
    background: #8A2BE2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover, .create-new-btn:hover {
    background: #9A3BF2;
    transform: translateY(-2px);
}

.header-right {
    display: flex;
    gap: 12px;
}

.info-banner {
    background: rgba(138, 43, 226, 0.15);
    border-left: 4px solid #8A2BE2;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Professional Select Dropdowns */
.persona-select,
select.persona-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    color: #9A3BF2;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239A3BF2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.persona-select:hover {
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.15);
}

.persona-select:focus {
    outline: none;
    border-color: #9A3BF2;
    background: rgba(154, 59, 242, 0.15);
    box-shadow: 0 0 0 3px rgba(154, 59, 242, 0.1);
}

.persona-select option {
    background: #1a1a1a;
    color: #9A3BF2;
    padding: 10px;
}

.persona-select option:hover {
    background: rgba(138, 43, 226, 0.2);
}

.user-auth-section {
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.auth-input-group {
    flex: 1;
    min-width: 200px;
}

.auth-input-group label {
    display: block;
    color: #9A3BF2;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.auth-input-group input {
    width: 100%;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    color: #FFFFFF;
    font-size: 14px;
    transition: all 0.3s ease;
}

.auth-input-group input:focus {
    outline: none;
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.15);
}

.auth-input-group input::placeholder {
    color: rgba(138, 43, 226, 0.5);
}

.load-personas-btn {
    background: #8A2BE2;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.load-personas-btn:hover {
    background: #9A3BF2;
    transform: translateY(-2px);
}

.info-banner i {
    font-size: 20px;
}

.info-banner p {
    font-size: 15px;
    color: #8A2BE2;
}

.stats-bar {
    background: rgba(138, 43, 226, 0.1);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #8A2BE2;
}

.stat-item i {
    font-size: 18px;
}

.stat-item strong {
    color: #9A3BF2;
    font-weight: 600;
}

.personas-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.songs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8A2BE2;
    font-size: 18px;
}

.loading-message i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.persona-card {
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
}

.persona-card:hover {
    border-color: #8A2BE2;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.3);
}

.song-card {
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.song-card:hover {
    border-color: #8A2BE2;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
}

.persona-avatar {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    background: rgba(138, 43, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.persona-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.persona-avatar i {
    font-size: 80px;
    color: #8A2BE2;
}

.song-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    background: rgba(138, 43, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-image i {
    font-size: 24px;
    color: #8A2BE2;
}

.persona-name {
    font-size: 20px;
    font-weight: bold;
    color: #8A2BE2;
    margin-bottom: 10px;
}

.persona-description {
    font-size: 14px;
    color: rgba(138, 43, 226, 0.8);
    margin-bottom: 12px;
    line-height: 1.4;
}

.song-title {
    font-size: 14px;
    font-weight: bold;
    color: #8A2BE2;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-meta {
    font-size: 13px;
    color: rgba(138, 43, 226, 0.7);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.song-meta i {
    font-size: 12px;
}

.song-version {
    display: inline-block;
    background: rgba(138, 43, 226, 0.3);
    color: #8A2BE2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.clip-id-compact {
    font-family: monospace;
    font-size: 11px;
    color: rgba(138, 43, 226, 0.6);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow: auto;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #0D0D0D 0%, #1a1a1a 100%);
    border: 2px solid #8A2BE2;
    border-radius: 16px;
    max-width: 600px;
    margin: 50px auto;
    animation: slideDown 0.3s ease;
}

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

.modal-header {
    background: rgba(138, 43, 226, 0.1);
    padding: 20px 25px;
    border-bottom: 2px solid #8A2BE2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 14px 14px 0 0;
}

.modal-header h2 {
    color: #FFD700;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-btn {
    background: none;
    border: 2px solid #8A2BE2;
    color: #8A2BE2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #8A2BE2;
    color: #000;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #9A3BF2;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #FFFFFF;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(138, 43, 226, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.avatar-upload-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.avatar-upload-section .form-group {
    flex: 1;
}

.dropzone {
    border: 2px dashed rgba(138, 43, 226, 0.5);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(138, 43, 226, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.dropzone:hover {
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.1);
}

.dropzone.dragover {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.dropzone i {
    font-size: 48px;
    color: #8A2BE2;
    margin-bottom: 12px;
    display: block;
}

.dropzone p {
    color: #9A3BF2;
    font-size: 14px;
    margin: 0;
}

.dropzone input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.dropzone.has-file {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.dropzone.has-file i {
    color: #4CAF50;
}

.file-preview {
    margin-top: 10px;
    color: #FFD700;
    font-size: 13px;
    font-weight: 600;
}

.ai-avatar-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-top: 28px;
}

.ai-avatar-btn:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.selected-song-info {
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8A2BE2;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row i {
    font-size: 16px;
    width: 20px;
}

.create-btn {
    width: 100%;
    background: #8A2BE2;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.create-btn:hover {
    background: #9A3BF2;
    transform: translateY(-2px);
}

.create-btn:disabled {
    background: rgba(138, 43, 226, 0.5);
    cursor: not-allowed;
    transform: none;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.status-message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #4CAF50;
    display: block;
}

.status-message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #F44336;
    color: #F44336;
    display: block;
}

.status-message.loading {
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid #8A2BE2;
    color: #8A2BE2;
    display: block;
}

@media (max-width: 768px) {
    .songs-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .header h1 {
        font-size: 22px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }
}
