/* ============================================
   Audio Joiner - Stylesheet
   Dark Mode Support with Light Mode Default
   Color Theme: Blue (#3399cc)  Prefix: aj-
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --aj-transition: 0.25s;
    --aj-primary: #3399cc;
    --aj-primary-light: #E0F2FE;
    --aj-primary-dark: #2d88b8;
    --aj-accent: #339966;
    --aj-accent-light: #E8F5E9;
    --aj-success: #339966;
    --aj-warning: #f59e0b;
    --aj-danger: #e64e4e;
    --aj-danger-light: #FEE2E2;
    --aj-bg: #F0F9FF;
    --aj-bg-elevated: #ffffff;
    --aj-bg-secondary: #F1F5F9;
    --aj-bg-tertiary: #E2E8F0;
    --aj-text: #1E293B;
    --aj-text-secondary: #475569;
    --aj-text-muted: #64748B;
    --aj-border: #BAE6FD;
    --aj-border-light: #E2E8F0;
    --aj-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --aj-shadow-primary: 0 4px 14px rgba(51, 153, 204, 0.25);
    --aj-radius-sm: 6px;
    --aj-radius-md: 12px;
    --aj-radius-lg: 16px;
    --aj-radius-full: 9999px;
    --aj-input-bg: #ffffff;
    --aj-input-border: #BAE6FD;
}

/* Dark Mode (light is default) */
[data-theme="dark"] {
    --aj-primary: #38BDF8;
    --aj-primary-light: rgba(56, 189, 248, 0.15);
    --aj-primary-dark: #0EA5E9;
    --aj-accent: #4ade80;
    --aj-accent-light: rgba(74, 222, 128, 0.15);
    --aj-success: #4ade80;
    --aj-danger: #f87171;
    --aj-danger-light: rgba(248, 113, 113, 0.15);
    --aj-bg: #0F172A;
    --aj-bg-elevated: #1E293B;
    --aj-bg-secondary: #1E293B;
    --aj-bg-tertiary: #334155;
    --aj-text: #F1F5F9;
    --aj-text-secondary: #CBD5E1;
    --aj-text-muted: #94A3B8;
    --aj-border: #334155;
    --aj-border-light: #334155;
    --aj-input-bg: #0F172A;
    --aj-input-border: #334155;
}

/* Layout */
.aj-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.aj-header {
    text-align: center;
    margin-bottom: 28px;
}
.aj-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}
.aj-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--aj-radius-md);
    background: var(--aj-primary);
    color: #fff;
}
.aj-icon-wrapper i,
.aj-icon-wrapper svg { width: 32px; height: 32px; }
.aj-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--aj-text);
    margin: 0;
}
.aj-description {
    max-width: 800px;
    margin: 0 auto;
    color: var(--aj-text-secondary);
    font-size: 1rem;
    line-height: 1.65;
}
.aj-description a {
    color: var(--aj-primary);
    text-decoration: none;
    font-weight: 600;
}
.aj-description a:hover { text-decoration: underline; }

/* Upload */
.aj-upload-section { margin-bottom: 20px; }
.aj-upload-area {
    border: 2px dashed var(--aj-border);
    border-radius: var(--aj-radius-lg);
    background: var(--aj-bg-elevated);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--aj-transition);
}
.aj-upload-area:hover,
.aj-upload-area.dragover {
    border-color: var(--aj-primary);
    background: var(--aj-primary-light);
}
.aj-upload-icon { color: var(--aj-primary); margin-bottom: 14px; }
.aj-upload-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--aj-text);
    margin: 0 0 6px;
}
.aj-upload-subtitle {
    color: var(--aj-text-muted);
    margin: 0 0 16px;
    font-size: 0.92rem;
}
.aj-file-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}
.aj-file-badge {
    padding: 4px 12px;
    border-radius: var(--aj-radius-full);
    background: var(--aj-bg-secondary);
    color: var(--aj-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}
.aj-upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--aj-text-muted);
    font-size: 0.8rem;
}

/* Error banner */
.aj-error-banner {
    background: var(--aj-danger-light);
    border: 1px solid var(--aj-danger);
    border-radius: var(--aj-radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
}
.aj-error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--aj-danger);
    font-weight: 600;
    font-size: 0.92rem;
}
.aj-error-help {
    margin: 8px 0 0 30px;
    font-size: 0.85rem;
    color: var(--aj-text-secondary);
}
.aj-error-help a { color: var(--aj-primary); font-weight: 600; }

/* Editor */
.aj-editor {
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-lg);
    overflow: hidden;
}
.aj-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--aj-border-light);
}
.aj-editor-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--aj-text);
}
.aj-count { color: var(--aj-text-muted); font-weight: 600; }
.aj-editor-head-actions { display: flex; gap: 8px; }

.aj-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-full);
    background: var(--aj-bg-elevated);
    color: var(--aj-text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--aj-transition);
}
.aj-chip:hover {
    border-color: var(--aj-primary);
    color: var(--aj-primary);
    background: var(--aj-primary-light);
}

/* Track list */
.aj-track-list {
    list-style: none;
    margin: 0;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aj-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-sm);
    transition: border-color var(--aj-transition), box-shadow var(--aj-transition);
}
.aj-track.aj-dragging {
    opacity: 0.6;
    border-color: var(--aj-primary);
    box-shadow: var(--aj-shadow-primary);
}
.aj-track.aj-drop-target {
    border-color: var(--aj-primary);
    box-shadow: inset 0 2px 0 0 var(--aj-primary);
}
.aj-track-grip {
    color: var(--aj-text-muted);
    cursor: grab;
    display: inline-flex;
    flex: none;
}
.aj-track-grip:active { cursor: grabbing; }
.aj-track-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--aj-primary-light);
    color: var(--aj-primary);
    font-size: 0.78rem;
    font-weight: 700;
    flex: none;
}
.aj-track-info {
    flex: 1;
    min-width: 0;
}
.aj-track-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--aj-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aj-track-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--aj-text-muted);
    margin-top: 2px;
}
.aj-track-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}
.aj-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-sm);
    background: transparent;
    color: var(--aj-text-secondary);
    cursor: pointer;
    transition: all var(--aj-transition);
}
.aj-icon-btn:hover:not(:disabled) {
    border-color: var(--aj-primary);
    color: var(--aj-primary);
    background: var(--aj-primary-light);
}
.aj-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.aj-icon-btn.aj-danger-btn:hover:not(:disabled) {
    border-color: var(--aj-danger);
    color: var(--aj-danger);
    background: var(--aj-danger-light);
}
.aj-total-line {
    margin: 0;
    padding: 0 20px 14px;
    font-size: 0.82rem;
    color: var(--aj-text-muted);
}

/* Settings */
.aj-settings {
    padding: 16px 20px;
    border-top: 1px solid var(--aj-border-light);
    border-bottom: 1px solid var(--aj-border-light);
}
.aj-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}
.aj-settings-row:last-child { margin-bottom: 0; }
.aj-setting { flex: 1; min-width: 200px; }
.aj-setting-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--aj-text-secondary);
    margin-bottom: 6px;
}
.aj-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--aj-input-border);
    border-radius: var(--aj-radius-sm);
    background: var(--aj-input-bg);
    color: var(--aj-text);
    font-size: 0.9rem;
    cursor: pointer;
}
.aj-amount-value {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--aj-primary);
}
.aj-range {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--aj-border-light);
    border-radius: 3px;
    outline: none;
}
.aj-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--aj-primary);
    cursor: pointer;
    border: none;
}
.aj-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--aj-primary);
    cursor: pointer;
    border: none;
}
.aj-check-setting {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.aj-check-wide { flex-basis: 100%; }
.aj-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
.aj-checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--aj-primary);
    cursor: pointer;
    margin-right: 0 !important;
}
.aj-checkbox-text {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--aj-text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}
.aj-setting-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.74rem;
    color: var(--aj-text-muted);
}

/* Action bar */
.aj-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
}
.aj-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--aj-radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--aj-transition);
    text-decoration: none;
}
.aj-btn-primary {
    background: var(--aj-primary);
    color: #fff;
}
.aj-btn-primary:hover {
    background: var(--aj-primary-dark);
    box-shadow: var(--aj-shadow-primary);
}
.aj-btn-secondary {
    background: var(--aj-bg-secondary);
    color: var(--aj-text-secondary);
}
.aj-btn-secondary:hover { background: var(--aj-bg-tertiary); }

/* Processing overlay */
.aj-processing {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}
.aj-processing-content {
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border);
    border-radius: var(--aj-radius-lg);
    padding: 32px 36px;
    text-align: center;
    min-width: 340px;
}
.aj-processing-content h3 {
    margin: 16px 0 14px;
    color: var(--aj-text);
    font-size: 1.05rem;
}
.aj-progress-container {
    height: 8px;
    background: var(--aj-bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.aj-progress-bar {
    height: 100%;
    background: var(--aj-primary);
    transition: width 0.3s ease;
}
.aj-progress-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--aj-text-muted);
}
.aj-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--aj-bg-secondary);
    border-top-color: var(--aj-primary);
    border-radius: 50%;
    animation: aj-spin 0.8s linear infinite;
    display: inline-block;
}
.aj-spinner-lg { width: 44px; height: 44px; border-width: 4px; }
@keyframes aj-spin { to { transform: rotate(360deg); } }

/* Results */
.aj-results {
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-lg);
    padding: 32px 24px;
    text-align: center;
}
.aj-success-icon { color: var(--aj-success); margin-bottom: 8px; }
.aj-results-header h2 {
    margin: 0 0 6px;
    color: var(--aj-text);
    font-size: 1.4rem;
}
.aj-results-subtitle {
    margin: 0 0 22px;
    color: var(--aj-text-muted);
    font-size: 0.92rem;
}
.aj-results-preview {
    max-width: 460px;
    margin: 0 auto 20px;
}
.aj-preview-player {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--aj-bg-secondary);
    border-radius: var(--aj-radius-md);
    text-align: left;
}
.aj-btn-play-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--aj-primary);
    color: #fff;
    cursor: pointer;
    flex: none;
    transition: all var(--aj-transition);
}
.aj-btn-play-preview:hover { background: var(--aj-primary-dark); }
.aj-preview-info { min-width: 0; }
.aj-preview-name {
    display: block;
    font-weight: 600;
    color: var(--aj-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aj-preview-meta {
    display: block;
    font-size: 0.82rem;
    color: var(--aj-text-muted);
    margin-top: 2px;
}
.aj-results-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 22px;
}
.aj-stat { text-align: center; }
.aj-stat-label {
    display: block;
    font-size: 0.74rem;
    color: var(--aj-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.aj-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--aj-text);
    margin-top: 4px;
}
.aj-stat-value.aj-highlight { color: var(--aj-primary); }
.aj-stat-arrow { color: var(--aj-text-muted); }
.aj-results-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.aj-extra-downloads {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    text-align: left;
}
.aj-extra-dl {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-sm);
    font-size: 0.85rem;
    color: var(--aj-text-secondary);
    text-decoration: none;
    transition: all var(--aj-transition);
}
.aj-extra-dl:hover {
    border-color: var(--aj-primary);
    color: var(--aj-primary);
    background: var(--aj-primary-light);
}
.aj-extra-dl span { display: inline-flex; align-items: center; gap: 8px; }
.aj-results-tip {
    margin: 18px auto 0;
    max-width: 600px;
    font-size: 0.85rem;
    color: var(--aj-text-muted);
    line-height: 1.6;
}
.aj-results-tip a { color: var(--aj-primary); font-weight: 600; text-decoration: none; }
.aj-results-tip a:hover { text-decoration: underline; }

/* ============================================
   INFO SECTION - uses site .info-card via custom_styles.css
   ============================================ */
.aj-steps {
    counter-reset: aj-step-counter;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.aj-step {
    display: flex;
    gap: 14px;
    counter-increment: aj-step-counter;
}
.aj-step-number {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--aj-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.aj-step-number::before { content: counter(aj-step-counter); }
.aj-step-content h4 {
    margin: 4px 0 6px;
    color: var(--aj-text);
    font-size: 1rem;
}
.aj-step-content p {
    margin: 0;
    color: var(--aj-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}
.aj-step-content a { color: var(--aj-primary); text-decoration: none; font-weight: 600; }
.aj-step-content a:hover { text-decoration: underline; }

.aj-features,
.aj-usecases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.aj-feature,
.aj-usecase {
    display: flex;
    gap: 12px;
    min-width: 0;
}
.aj-feature-icon,
.aj-usecase-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--aj-radius-md);
    background: var(--aj-primary-light);
    color: var(--aj-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.aj-feature-content h4,
.aj-usecase-content h4 {
    margin: 2px 0 6px;
    color: var(--aj-text);
    font-size: 0.98rem;
}
.aj-feature-content p,
.aj-usecase-content p {
    margin: 0;
    color: var(--aj-text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}
.aj-feature-content a,
.aj-usecase-content a { color: var(--aj-primary); text-decoration: none; font-weight: 600; }
.aj-feature-content a:hover,
.aj-usecase-content a:hover { text-decoration: underline; }

/* Long-tail intent help sections */
.aj-intent-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.aj-intent {
    padding: 16px 18px;
    background: var(--aj-bg-elevated);
    border: 1px solid var(--aj-border);
    border-radius: var(--aj-radius-md, 12px);
}
.aj-intent h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--aj-text);
}
.aj-intent p {
    margin: 0;
    color: var(--aj-text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}
.aj-intent a {
    color: var(--aj-primary);
    text-decoration: none;
    font-weight: 600;
}
.aj-intent a:hover { text-decoration: underline; }

.aj-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.aj-related-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-md);
    background: var(--aj-bg-elevated);
    color: var(--aj-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--aj-transition);
}
.aj-related-tool:hover {
    border-color: var(--aj-primary);
    background: var(--aj-primary-light);
    color: var(--aj-primary);
}
.aj-related-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--aj-radius-sm);
    background: var(--aj-bg-secondary);
    color: var(--aj-primary);
    flex: none;
}

.aj-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aj-faq-item {
    border: 1px solid var(--aj-border-light);
    border-radius: var(--aj-radius-sm);
    overflow: hidden;
}
.aj-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--aj-bg-elevated);
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--aj-text);
}
.aj-faq-question:hover { background: var(--aj-bg-secondary); }
.aj-faq-question i,
.aj-faq-question svg {
    flex: none;
    transition: transform var(--aj-transition);
    color: var(--aj-text-muted);
}
.aj-faq-item.open .aj-faq-question i,
.aj-faq-item.open .aj-faq-question svg { transform: rotate(180deg); }
.aj-faq-answer {
    display: none;
    padding: 0 16px 14px;
}
.aj-faq-item.open .aj-faq-answer { display: block; }
.aj-faq-answer p {
    margin: 0;
    color: var(--aj-text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
}
.aj-faq-answer a { color: var(--aj-primary); text-decoration: none; font-weight: 600; }
.aj-faq-answer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 640px) {
    .aj-title { font-size: 1.6rem; }
    .aj-settings-row { flex-direction: column; }
    .aj-action-bar { flex-direction: column-reverse; }
    .aj-action-bar .aj-btn { width: 100%; justify-content: center; }
    .aj-track-name { font-size: 0.84rem; }
}
