:root {
    --dj-primary: #00f2ff;
    --dj-secondary: #7000ff;
    --dj-bg-dark: #0a0a0c;
    --dj-card-bg: rgba(255, 255, 255, 0.03);
    --dj-border: rgba(255, 255, 255, 0.1);
    --dj-text: #ffffff;
    --dj-text-dim: #a0a0a0;
    --dj-gradient: linear-gradient(135deg, var(--dj-primary) 0%, var(--dj-secondary) 100%);
}

.dj-avatar-container {
    background: var(--dj-bg-dark);
    color: var(--dj-text);
    font-family: 'Outfit', 'Inter', sans-serif;
    padding: 40px;
    border-radius: 24px !important;
    max-width: 1000px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--dj-border);
}

.dj-avatar-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.05) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.dj-avatar-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.dj-avatar-header h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--dj-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.dj-avatar-header p {
    color: var(--dj-text-dim);
    font-size: 1.1rem;
}

.dj-avatar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .dj-avatar-grid {
        grid-template-columns: 1fr;
    }
}

/* Upload Area */
.dj-upload-section {
    background: var(--dj-card-bg);
    border: 2px dashed var(--dj-border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.dj-upload-section:hover,
.dj-upload-section.dragover {
    border-color: var(--dj-primary);
    background: rgba(0, 242, 255, 0.02);
}

.dj-upload-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.preview-container {
    margin-top: 20px;
    width: 100%;
    display: none;
}

.preview-container img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Config Section */
.dj-config-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dj-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dj-input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dj-text-dim);
}

.dj-input-group input {
    background: var(--dj-card-bg);
    border: 1px solid var(--dj-border);
    color: var(--dj-text);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.dj-input-group input:focus {
    border-color: var(--dj-primary);
}

/* Style Grid */
.dj-style-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dj-style-item {
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--dj-card-bg);
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.dj-style-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.dj-style-item:hover img {
    opacity: 0.8;
}

.dj-style-item.active {
    border-color: var(--dj-primary);
}

.dj-style-item.active img {
    opacity: 1;
}

.dj-style-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: rgba(0, 0, 0, 0.7);
    font-size: 0.7rem;
    text-align: center;
    backdrop-filter: blur(4px);
}

/* Action Button */
.dj-action-btn {
    background: var(--dj-gradient);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px !important;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dj-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(112, 0, 255, 0.3);
}

.dj-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading Overlay */
.dj-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dj-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--dj-border);
    border-top: 4px solid var(--dj-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result Area - Modern Interface */
.dj-result-area {
    margin-top: 40px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 5;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dj-result-header {
    text-align: center;
    margin-bottom: 25px;
}

.dj-result-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dj-primary);
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.dj-result-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid var(--dj-border);
    border-radius: 30px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.dj-result-preview {
    width: 100%;
    max-width: 500px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(112, 0, 255, 0.2);
}

.dj-result-preview img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.dj-result-preview:hover img {
    transform: scale(1.02);
}

.dj-result-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

@media (max-width: 600px) {
    .dj-result-actions {
        flex-direction: column;
    }
}

.dj-download-btn,
.dj-regenerate-btn,
.dj-reset-btn {
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 14px !important;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.dj-download-btn {
    background: var(--dj-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(112, 0, 255, 0.3);
    border-radius: 14px !important;
}

.dj-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(112, 0, 255, 0.4);
    color: white;
}

.dj-regenerate-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #ff0080 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.3);
    border-radius: 14px !important;
}

.dj-regenerate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.4);
}

.dj-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 14px !important;
}

.dj-reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Debug Trace Styles */
.dj-debug-trace {
    margin-top: 30px;
    background: #15151a;
    border: 1px solid #333;
    border-radius: 12px !important;
    overflow: hidden;
    color: #00ff00;
    /* Retro terminal green */
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    animation: fadeIn 0.4s ease;
}

.dj-debug-header {
    background: #222;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.dj-debug-header h4 {
    margin: 0;
    color: #888;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

#dj-close-debug {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

#dj-close-debug:hover {
    color: #fff;
}

.dj-debug-content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.dj-debug-section {
    margin-bottom: 15px;
}

.dj-debug-section strong {
    display: block;
    color: #aaa;
    margin-bottom: 5px;
    font-size: 0.7rem;
}

.dj-debug-section pre {
    background: #0a0a0c;
    padding: 10px;
    margin: 0;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #222;
    color: #00ff00;
}

/* Limit Reached Styles */
.dj-limit-reached {
    margin-top: 40px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 5;
}

.dj-limit-header {
    text-align: center;
    margin-bottom: 25px;
}

.dj-limit-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dj-primary);
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.dj-limit-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid var(--dj-border);
    border-radius: 30px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.dj-limit-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.dj-limit-content p {
    color: var(--dj-text-dim);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.dj-limit-actions {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .dj-limit-actions {
        flex-direction: column;
    }
}

.dj-download-software-btn,
.dj-buy-license-btn {
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 14px !important;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    min-width: 200px;
    justify-content: center;
}

.dj-download-software-btn {
    background: var(--dj-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(112, 0, 255, 0.3);
}

.dj-download-software-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(112, 0, 255, 0.4);
    color: white;
}

.dj-buy-license-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #ff0080 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.3);
}

.dj-buy-license-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.4);
}

.dj-limit-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--dj-border);
}

.dj-limit-note p {
    font-size: 0.9rem;
    color: var(--dj-text-dim);
    margin: 0;
}