:root {
    --yde-primary: #ff0000;
    --yde-primary-hover: #cc0000;
    --yde-bg: #ffffff;
    --yde-card-bg: #f8fafc;
    --yde-text: #1e293b;
    --yde-text-muted: #64748b;
    --yde-border: #e2e8f0;
    --yde-accent: #facc15;
    --yde-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --yde-radius: 12px;
}

/* Theme Fixer: Force escape from pre/code tags */
pre.yde-fixed, code.yde-fixed {
    all: unset !important;
    display: block !important;
    width: 100% !important;
}

.yde-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--yde-bg);
    border-radius: var(--yde-radius);
    box-shadow: var(--yde-shadow);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--yde-text);
    border: 1px solid var(--yde-border);
    line-height: 1.5;
    box-sizing: border-box;
}

.yde-container * {
    box-sizing: border-box;
}

.yde-header {
    text-align: center;
    margin-bottom: 2rem;
}

.yde-header h2 {
    font-size: 1.875rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: var(--yde-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.yde-header p {
    color: var(--yde-text-muted);
    margin: 0;
    font-size: 1rem;
}

.yde-search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.yde-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--yde-border);
    border-radius: var(--yde-radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: #fff;
}

.yde-input:focus {
    outline: none;
    border-color: var(--yde-primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.yde-btn-primary {
    background: var(--yde-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--yde-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.yde-btn-primary:hover {
    background: var(--yde-primary-hover);
}

.yde-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.yde-api-info {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 1rem;
    border-radius: var(--yde-radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.yde-api-info a {
    color: #b45309;
    font-weight: 600;
    text-decoration: none;
}

.yde-api-info input {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #fde68a;
    border-radius: 6px;
}

.yde-status {
    padding: 1rem;
    border-radius: var(--yde-radius);
    margin-bottom: 1.5rem;
    display: none;
    font-weight: 500;
}

.yde-status.loading { display: block; background: #f1f5f9; color: #475569; }
.yde-status.success { display: block; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.yde-status.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.yde-results {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.yde-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .yde-grid {
        grid-template-columns: 300px 1fr;
    }
}

.yde-thumb-card {
    background: var(--yde-card-bg);
    padding: 1rem;
    border-radius: var(--yde-radius);
    border: 1px solid var(--yde-border);
}

.yde-thumb-wrapper {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.yde-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yde-info-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.yde-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--yde-text-muted);
    margin-bottom: 0.375rem;
}

.yde-value {
    background: var(--yde-card-bg);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--yde-border);
    font-size: 0.9375rem;
}

.yde-desc {
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap !important;
}

.yde-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.yde-tag {
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: #475569;
}

.yde-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.yde-btn-secondary {
    background: #fff;
    border: 1px solid var(--yde-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.yde-btn-secondary:hover {
    background: var(--yde-card-bg);
    border-color: var(--yde-text-muted);
}

.yde-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile Adjustments */
@media (max-width: 640px) {
    .yde-container {
        padding: 1.25rem;
        margin: 1rem;
    }
    .yde-search-box {
        flex-direction: column;
    }
    .yde-btn-primary {
        width: 100%;
        justify-content: center;
    }
}
