/* Diagnostic Module - Base Layout */

.diagnostic-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
}

.diagnostic-layout__header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.diagnostic-layout__title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
}

.diagnostic-layout__subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Search */

.diagnostic-search {
    margin-bottom: 2rem;
}

.diagnostic-search__form {
    max-width: 800px;
}

.diagnostic-search__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.diagnostic-search__input-group {
    display: flex;
    gap: 0.5rem;
}

.diagnostic-search__input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
}

.diagnostic-search__input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.diagnostic-search__button {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background-color: #3b82f6;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.diagnostic-search__button:hover {
    background-color: #2563eb;
}

.diagnostic-search__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.diagnostic-search__reset {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s;
}

.diagnostic-search__reset:hover {
    color: #1a1a2e;
}

.diagnostic-search__hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Toolbar (tokens + copy URL) */

.diagnostic-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.diagnostic-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.diagnostic-copy-url__button {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}

.diagnostic-copy-url__button:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.diagnostic-copy-url__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results placeholder */

.diagnostic-results__empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    background-color: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
}

/* Turbo loading state */

turbo-frame#diagnostic-results {
    transition: opacity 0.15s;
}

turbo-frame[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

turbo-frame#diagnostic-results[aria-busy="true"]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: #3b82f6;
    z-index: 9999;
    animation: diagnostic-progress 1.5s ease-in-out infinite;
}

@keyframes diagnostic-progress {
    0% { width: 0; left: 0; }
    50% { width: 50%; left: 25%; }
    100% { width: 0; left: 100%; }
}
