/* AiM Config Merge - Frontend Styles */
/* Uses Rush Auto Works design tokens where available */

.acm-wrap {
    max-width: 640px;
    margin: 2rem auto;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text-primary, #e0e0e0);
}

.acm-intro h3 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: var(--raw-cyan, #47C7FC);
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.acm-intro p {
    color: var(--text-muted, #a0a0a0);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.acm-note {
    font-size: 0.82rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 200, 0, 0.06);
    border: 1px solid rgba(255, 200, 0, 0.15);
    border-radius: 6px;
    color: var(--text-muted, #a0a0a0);
    margin-bottom: 1.5rem;
}

/* Steps */
.acm-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.acm-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.acm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--raw-orange, #FF8000);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.acm-step code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Dropzone */
.acm-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.acm-dropzone:hover,
.acm-dropzone--active {
    border-color: var(--raw-cyan, #47C7FC);
    background: rgba(71, 199, 252, 0.04);
}

.acm-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.acm-upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted, #a0a0a0);
    margin-bottom: 0.5rem;
}

.acm-dropzone-text {
    font-size: 1rem;
    color: var(--text-primary, #e0e0e0);
}

.acm-dropzone-sub {
    font-size: 0.85rem;
    color: var(--text-dim, #666);
}

.acm-dropzone-hint {
    font-size: 0.75rem;
    color: var(--text-dim, #666);
    margin-top: 0.5rem;
}

.acm-browse-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--raw-orange, #FF8000);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.acm-browse-btn:hover {
    background: #e67300;
}

#acm-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* File info */
.acm-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.acm-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted, #a0a0a0);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.acm-remove-btn:hover {
    color: #ff4444;
}

/* Submit button */
.acm-submit-btn {
    display: block;
    width: 100%;
    padding: 0.875rem;
    margin-top: 1rem;
    background: var(--raw-orange, #FF8000);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.acm-submit-btn:hover:not(:disabled) {
    background: #e67300;
}

.acm-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.acm-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.acm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acm-spin 0.6s linear infinite;
}

@keyframes acm-spin {
    to { transform: rotate(360deg); }
}

/* Preview section */
.acm-preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.acm-scan-icon {
    width: 32px;
    height: 32px;
    color: var(--raw-cyan, #47C7FC);
}

.acm-preview-header h3 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: var(--raw-cyan, #47C7FC);
    font-size: 1.3rem;
    text-transform: uppercase;
    margin: 0;
}

/* Version info */
.acm-version-info {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(71, 199, 252, 0.06);
    border: 1px solid rgba(71, 199, 252, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
}

.acm-version-info p {
    margin: 0;
}

/* Preview diff */
.acm-preview-diff {
    margin-bottom: 1.5rem;
}

.acm-preview-diff h4 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: var(--raw-cyan, #47C7FC);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* Accordions */
.acm-accordion {
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.acm-accordion summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.acm-accordion summary::-webkit-details-marker { display: none; }

.acm-accordion summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

.acm-accordion[open] summary::after {
    transform: rotate(90deg);
}

.acm-accordion-add summary  { background: rgba(34, 197, 94, 0.08); color: #22c55e; }
.acm-accordion-mod summary  { background: rgba(255, 200, 0, 0.07); color: #ffc800; }
.acm-accordion-skip summary { background: rgba(255, 255, 255, 0.03); color: var(--text-muted, #a0a0a0); }
.acm-accordion-warn summary { background: rgba(239, 68, 68, 0.08); color: #ef4444; }

.acm-accordion-body {
    padding: 0.5rem 0.9rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
}

.acm-accordion-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.acm-diff-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.acm-diff-list li {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.02);
}

.acm-diff-name {
    font-weight: 600;
}

.acm-diff-unit {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted, #a0a0a0);
    font-weight: 400;
}

.acm-diff-detail {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim, #666);
    margin-top: 2px;
    font-family: monospace;
}

.acm-alarm-badges {
    display: inline-flex;
    gap: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.acm-alarm-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(71, 199, 252, 0.12);
    color: var(--raw-cyan, #47C7FC);
    border: 1px solid rgba(71, 199, 252, 0.2);
}

.acm-uptodate {
    font-size: 0.85rem;
    color: var(--text-muted, #a0a0a0);
    margin: 0.5rem 0 0;
}

.acm-diff-conflict-label {
    color: #ef4444;
}

/* Feature selection */
.acm-features-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.acm-features-section h4 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: var(--raw-cyan, #47C7FC);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

.acm-features-desc {
    font-size: 0.85rem;
    color: var(--text-muted, #a0a0a0);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.acm-features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.acm-feature-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.acm-feature-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.acm-feature-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.acm-feature-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--raw-orange, #FF8000);
    cursor: pointer;
    flex-shrink: 0;
}

.acm-feature-toggle-label {
    font-weight: 600;
}

.acm-feature-desc {
    font-size: 0.8rem;
    color: var(--text-dim, #666);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

.acm-feature-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    background: var(--bg-primary, #041E42);
    color: var(--text-primary, #e0e0e0);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.9rem;
    appearance: auto;
}

.acm-feature-select:focus {
    border-color: var(--raw-cyan, #47C7FC);
    outline: none;
}

.acm-feature-detected {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 500;
}

/* Results */
.acm-results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.acm-check-icon {
    width: 32px;
    height: 32px;
    color: #22c55e;
}

.acm-results-header h3 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: var(--raw-cyan, #47C7FC);
    font-size: 1.3rem;
    text-transform: uppercase;
    margin: 0;
}

.acm-detected {
    margin-bottom: 1.5rem;
}

.acm-detected p {
    margin: 0.25rem 0;
}

.acm-detected-customer {
    font-size: 0.85rem;
    color: var(--text-muted, #a0a0a0);
}

.acm-detected-source {
    font-size: 0.85rem;
    color: var(--text-muted, #a0a0a0);
}

.acm-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.acm-summary-table th,
.acm-summary-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.acm-summary-table th {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-muted, #a0a0a0);
}

.acm-summary-table td:nth-child(2),
.acm-summary-table td:nth-child(3) {
    text-align: center;
    font-weight: 600;
}

.acm-count-added {
    color: #22c55e;
}

.acm-uptodate {
    text-align: center;
    color: #22c55e;
    font-weight: 600;
    padding: 0.5rem;
}

/* Changelog */
.acm-changelog {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(71, 199, 252, 0.06);
    border: 1px solid rgba(71, 199, 252, 0.12);
    border-radius: 6px;
}

.acm-changelog-text {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Warnings */
.acm-warnings {
    background: rgba(255, 200, 0, 0.08);
    border: 1px solid rgba(255, 200, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.acm-warnings ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.acm-warnings li {
    font-size: 0.9rem;
    color: #ffc800;
}

/* Download button */
.acm-download-section {
    margin-bottom: 1.5rem;
}

.acm-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--raw-orange, #FF8000);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s;
}

.acm-download-btn:hover {
    background: #e67300;
    color: #fff !important;
}

.acm-download-btn svg {
    width: 20px;
    height: 20px;
}

/* Try again / Retry */
.acm-try-again-btn {
    display: block;
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    color: var(--text-muted, #a0a0a0);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    margin-top: 0.75rem;
}

.acm-try-again-btn:hover {
    border-color: var(--raw-cyan, #47C7FC);
    color: var(--raw-cyan, #47C7FC);
}

/* Error */
.acm-error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.acm-error-icon {
    width: 32px;
    height: 32px;
    color: #ef4444;
}

.acm-error-header h3 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    color: #ef4444;
    font-size: 1.3rem;
    text-transform: uppercase;
    margin: 0;
}

#acm-error-message {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Mobile */
@media (max-width: 640px) {
    .acm-wrap {
        margin: 1rem;
    }

    .acm-dropzone {
        min-height: 160px;
        padding: 1.5rem;
    }

    .acm-features-section {
        padding: 1rem;
    }

    .acm-feature-item {
        padding: 0.6rem;
    }
}
